A playful real-time computer-vision project: the webcam tracks your hand and face, recognises a few gestures, and shows a reaction image that matches what you're doing. It pairs OpenCV for the video pipeline with Google's MediaPipe for hand and face landmark detection.
How it works
Each frame is run through two MediaPipe models at once — a single-hand tracker and a face mesh. From their landmarks the app classifies a gesture:
- Thumbs up — thumb extended, other fingers folded.
- Thinking — one finger raised near the mouth, found by comparing the fingertip to the face's mouth landmark.
- Yes — a single finger raised in the upper part of the frame.
The matching reaction is then displayed, and the detected gesture is drawn onto the webcam feed.
Gesture smoothing
Raw frame-by-frame detection flickers, so a gesture only "confirms" once it has held steady for a short delay (about half a second). That debouncing keeps the reaction from flipping on a single noisy frame and makes the whole thing feel deliberate.
Run it
It needs Python with opencv-python, mediapipe and numpy, plus a webcam.
pip install opencv-python mediapipe numpy
python monke.py