Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/marlenezw/face-and-body-detector-with-mediapipe
This code detects face and body landmarks using mediapipe.
https://github.com/marlenezw/face-and-body-detector-with-mediapipe
Last synced: 29 days ago
JSON representation
This code detects face and body landmarks using mediapipe.
- Host: GitHub
- URL: https://github.com/marlenezw/face-and-body-detector-with-mediapipe
- Owner: marlenezw
- License: apache-2.0
- Created: 2022-10-05T13:46:04.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2022-10-05T16:22:17.000Z (over 2 years ago)
- Last Synced: 2024-12-14T02:16:47.384Z (about 2 months ago)
- Language: Jupyter Notebook
- Size: 3.19 MB
- Stars: 112
- Watchers: 3
- Forks: 15
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- stars - marlenezw/face-and-body-detector-with-mediapipe - This code detects face and body landmarks using mediapipe. (Jupyter Notebook)
- stars - marlenezw/face-and-body-detector-with-mediapipe - This code detects face and body landmarks using mediapipe. (Jupyter Notebook)
README
# face-and-body-detector-with-mediapipe
This code detects face and body landmarks using mediapipe, a python ML package. (This code is adapted from [nicknochnack's](https://github.com/nicknochnack) longer tutorial on using mediapipe for body language detection that can be found [here](https://github.com/nicknochnack/Body-Language-Decoder/blob/main/Body%20Language%20Decoder%20Tutorial.ipynb).
It's important to note that MediaPipe Python on PyPI officially supports the 64-bit version of Python 3.7 to 3.10 on the following OS:
- x86_64 Linux
- x86_64 macOS 10.15+
- amd64 WindowsYou'll need to be using a virtual environment that's running one of these versions of Python.
## Mac0S
(The following steps are courtesy of user [josiahsrc](https://github.com/josiahsrc) on GitHub and [stackoverflow](https://stackoverflow.com/questions/68659865/cannot-pip-install-mediapipe-on-macos-m1)
Here are the steps you need to take in order to use mediapipe with Apple's M1:
1. Launch terminal using the Rosetta 2 translation layer. You can do this by opening Finder, going to Applications > Utilities and right clicking Terminal. In the right-click menu, click on get-info and then tick the Open Using Rosetta checkbox.
2. Open a new Terminal window. (If terminal was previously opened, quit and relaunch it).
3. Use the following command to install Homebrew for x86_64 architecture. arch -x86_64 /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)". We do this because we'd like to install Python 3.8 for x86_64 where mediapipe is supported.
4. Now that we have brew for x86_64, we can install Python 3.8 for x86_64 by running the command arch -x86_64 /usr/local/homebrew/bin/brew install [email protected]. This installation may take a while.
5. Now that we have the Python version we need, we can create a new Virtual Environment. By using the command arch -x86_64 /usr/local/homebrew/opt/[email protected]/bin/python3 -m venv myvenv. Remember, you need to specify your path to the x86_64 Python (the one we just installed). For me it was installed to /usr/local/homebrew/opt/[email protected]/bin/python3. For you it could be different. Either ways after Brew finishes installing Python, it'll display the path it was installed to. You should see "Python was installed at /Path/to/newly/installed/python". Also, the Virtual Environment will be created at ~/myvenv. You can change that by changing the myvenv part in the command.
6. Start your Virtual Environment source ~/myvenv/bin/activate. I used this path ~/myvenv because thats where I created my Virtual Environment. If you created your Virtual Environment elsewhere, use that path.
7. Now you should be inside the Virtual Environment, upgrade pip. pip install --upgrade pip
8. Install mediapipe from pip, pip install mediapipe
That's it :) Now you can open your venv. Specify the interpreter as the path of the x86_64 Python we just installed (Example /usr/local/homebrew/opt/[email protected]/bin/python3). Now you should be able to use mediapipe.
![example output](facemesh.gif)