This document provides instructions for setting up and running the gesture recognition model on your webcam
- Python 3.7 or higher (Python 3.11.9 was used)
(Optional) It is recommended to install all Python dependencies in a virtual environment1, but you can skip this step
Windows Powershell:
python -m venv myenv
myenv\Scripts\activate
cd "myenv"
MacOS/Linux bash:
python3 -m venv myenv
source myenv/bin/activate
cd "myenv"
-
Unzip the folder into virtual environment
-
Install all dependencies
Windows Powershell:
cd "Handy Mandy"
pip install -r .\requirements.txt
MacOS/Linux bash:
cd "Handy Mandy"
pip install -r ./requirements.txt
- Adjust the settings on the model
Webcam dimensions(Line 7, webcam.py)
wCam, hCam = 1280, 720
- Run the model (Note: this will not ask for permission before running your webcam!)
Windows Powershell:
python3 .\webcam.py
MacOS/Linux bash:
python3 ./webcam.py
- If left/right hand is not accurately determined, check the following settings in the model:
Comment out Line 24, webcam.py
img = cv2.flip(img, 1)
Footnotes
-
Best practice is to use virtual environments to manage dependency conflicts between projects ↩