A simple webcam hand-tracking app built with OpenCV and MediaPipe.
- Opens your webcam
- Detects hands in real time
- Draws hand landmarks on the video feed
- Swaps left and right labels to match the mirrored preview
- Windows
- Python installed
- Visual Studio Code installed
- A webcam
- Open VS Code.
- Choose
File>Open Folder.... - If you have not downloaded the project yet, clone it from GitHub:
git clone <your-repo-url>- Open the
python-hand-trackingfolder in VS Code. - Open the integrated terminal in VS Code.
If the .venv folder already exists, activate it:
Set-ExecutionPolicy -Scope Process -ExecutionPolicy RemoteSigned
.\.venv\Scripts\Activate.ps1If .venv does not exist, create it first:
py -m venv .venv
.\.venv\Scripts\Activate.ps1Run this inside the activated virtual environment:
pip install opencv-python mediapipepython main.pyIf python does not work in your terminal, try:
py main.py- Press
qin the video window, or - Click the
Xbutton on the window title bar
- The first run downloads the MediaPipe hand landmarker model automatically.
- Keep the webcam connected and allow camera access if Windows asks for permission.
- If the window opens but stays black, close it, wait a moment, and run the program again.