A computer vision project that detects facial and hand gestures in real time using the webcam and displays a corresponding meme.
- Python 3.10.0
- OpenCV
- MediaPipe
- NumPy
- Python 3.8 – 3.11 (MediaPipe is not compatible with later versions)
Install the dependencies using:
pip install opencv-python mediapipe numpy
Or, if you have the requirements file:
pip install -r requirements.txt
| Gesture | Meme |
|---|---|
| Raised or furrowed eyebrows | dog.jpeg |
| Tongue sticking out | cat1.png |
| Finger touching the mouth | cristiano.png |
| Both hands on either side of the face | face.jpeg |
| Both hands above the nose | Sonic.jpeg |
| Index and middle fingers extended | rat.jpeg |
gesture_meme/
├── main.py
├── requirements.txt
├── face.jpeg
├── cristiano.png
├── cat1.png
├── dog.jpeg
├── rat.jpeg
└── Sonic.jpeg
-
Clone the repository
-
Install the dependencies
-
Place the images in the same folder as
main.py -
Run:
python main.py -
When the programme starts, look straight ahead with a neutral expression during calibration
-
Once calibrated, try out the gestures in front of the camera
-
Press ESC to exit
- The calibration takes a few seconds at the start; it is necessary for the gestures to work correctly
- The images must be in the same folder as
main.py - Works best with good lighting
- Compatible with Windows (uses
CAP_DSHOWfor the camera)