A real-time hand, face and full-body recognition system built with MediaPipe. Tracks landmarks using a webcam. Can be used for sign language recognition, gesture-based controls or interactive applications, such as VR.
Also included by MediaPipe, but not yet implemented here, is hand gesture categorization.
-
Clone the repository:
git clone https://github.com/Vessel9817/hand-gesture-recognition.git cd hand-gesture-recognition -
Download the landmarking models:
mkdir models curl -o "./models/hand_landmarker.task" https://storage.googleapis.com/mediapipe-models/hand_landmarker/hand_landmarker/float16/1/hand_landmarker.task curl -o "./models/face_landmarker.task" https://storage.googleapis.com/mediapipe-models/face_landmarker/face_landmarker/float16/1/face_landmarker.task curl -o "./models/pose_landmarker.task" https://storage.googleapis.com/mediapipe-models/pose_landmarker/pose_landmarker_heavy/float16/latest/pose_landmarker_heavy.task
Newer hand, face or full-body models may be available in the future.
-
Create a virtual environment:
py -m venv "./venv" -
Activate the virtual environment:
source "./venv/Scripts/activate"
-
Install the required libraries:
pip install -r "./requirements-freeze.txt"
-
Ensure you have a working webcam connected to your device.
-
Run the script:
-
If not already done in the current shell, activate the virtual environment:
source "./venv/Scripts/activate"
-
Run the main Python script:
py -m src.main
-
-
Move your hands, face and body around in view of the camera. Play around with it and test its limits!
-
With the window focused, press
qto exit the program.
See MediaPipe's custom hand gesture recognition sample for how to create a custom model. The same principles apply to models in general.
See: CONTRIBUTING.md
This project is licensed under the AGPLv3 License - see the LICENSE file for details.
Credit to the MediaPipe authors for creating the samples this project is in part based on. Individual files contain more specific attributions.