An AI-powered desktop application that allows you to draw on a digital canvas using hand gestures and control the interface with head movements. Built with Python, MediaPipe, OpenCV, and PyQt6.
To run this project efficiently, you need the following Python packages:
opencv-python: For image processing and camera access.mediapipe: For AI-based hand and face tracking.numpy: For numerical operations and array handling.PyQt6: For the graphical user interface.Follow these steps to set up the project on your local machine:
git clone https://github.com/Amit123103/HandDetectionDrawing.git
cd HandDetectionDrawing
It’s best practice to use a virtual environment to manage dependencies.
Windows:
python -m venv .venv
.venv\Scripts\activate
macOS / Linux:
python3 -m venv .venv
source .venv/bin/activate
Install all required packages using pip:
pip install -r requirements.txt
Make sure you have a webcam connected. Run the following command:
python main.py
This will launch the application window.
If deploying to a cloud service like Render, the app will automatically start in Server Mode (API only) to prevent crashing on headless systems.
python main.py or uvicorn server:app --host 0.0.0.0 --port $PORT| Gesture | Action |
|---|---|
| Index Finger | Move Cursor |
| Pinch (Index + Thumb) | Draw / Paint |
| Closed Fist | Undo Last Stroke |
| Head Tilt Left | Previous Color |
| Head Tilt Right | Next Color |
| Head Nod Up | Increase Brush Size |
| Head Nod Down | Decrease Brush Size |
ModuleNotFoundError: Ensure you have activated your virtual environment and installed requirements.