This repository contains a collection of small, interactive mini-projects built with Python, OpenCV, and MediaPipe. These applications leverage real-time hand and body tracking to create intuitive human-computer interfaces.
These projects are based on the FreeCodeCamp computer vision course by Murtaza Hassan, with updated code as of 2025 and my own improvisations.
mediapipe used in these projects is deprecated and works reliably only with Python versions 3.8 - 3.10.
Control your computer's cursor and click using hand gestures.
- Move Cursor: Raise your index finger and move it around.
- Click: Bring your index and middle fingers together.
A virtual drawing application that lets you draw on the screen with your finger.
- Draw: Raise your index finger to draw with the selected color.
- Select Mode: Raise your index and middle fingers to select different colors (pink, blue, green) or an eraser from the header image.
Control your system's master volume using your hand.
- The distance between your thumb tip (landmark 4) and index finger tip (landmark 8) is measured.
- This distance is mapped to the system's volume range (MinVol to MaxVol) to set the master volume.
An exercise repetition counter that uses pose estimation to track your movements.
- This project tracks the angle of the elbow (using landmarks 12, 14, and 16) to monitor bicep curls.
- It counts half-reps (
dir = 0ordir = 1) as the arm moves between 0% (straight) and 100% (curled).
A simple application that detects and counts the number of fingers you hold up to the camera. It overlays a corresponding image (from the FingerImages folder) on the screen.
- Python (3.8 - 3.10)
- OpenCV: For video capture, image processing, and display.
- MediaPipe: For real-time hand and pose landmark detection.
- NumPy: For numerical operations and image manipulation.
- pycaw: (for Gesture Volume Control) To interface with the Windows Core Audio API.
- pynput: (for AI Virtual Mouse) To control the mouse cursor and clicks.
-
Clone the repository:
git clone [https://github.com/your-username/Advanced-python-computer-vision-course.git](https://github.com/your-username/Advanced-python-computer-vision-course.git) cd Advanced-python-computer-vision-course -
Create a Virtual Environment (Recommended): Make sure you are using Python 3.8, 3.9, or 3.10.
python -m venv venv source venv/bin/activate # On Windows, use `venv\Scripts\activate`
-
Install Dependencies for a Project: Each project folder contains its own
requirements.txtfile.# Example for AI Virtual Mouse cd aivirtualmouse pip install -r requirements.txt
Navigate to the directory of the project you want to run and execute the main Python script.
Example (AI Trainer):
cd aitrainer
python aitrainer.py