This project is a collection of Python scripts for experimenting with computer vision using OpenCV and MediaPipe. It includes webcam testing, face detection, hand skeleton tracking, face dataset creation, face model training, and face recognition.
- Webcam Check (
webcam-check.py): Simple script to test your webcam. - Face Detection (
face-detection.py): Detects faces in real-time from your webcam using OpenCV's Haar cascades. - Hand Skeleton Tracking (
hand-skeleton.py): Tracks and visualizes hand skeletons using MediaPipe. - Face Dataset Creation (
face_create_dataset.py): Captures and saves face images from your webcam to build a dataset for training. - Face Model Training (
face_training.py): Trains a face recognition model using images in the dataset folder. - Face Recognition (
face_recognition.py): Recognizes faces using a trained model (LBPH) and displays the name and confidence. - Rock Paper Scissor (Hand Gesture Game) (
rock-paper-scissor/main.py): Play rock-paper-scissors against the AI using your hand gestures! The script uses your webcam and MediaPipe to detect your hand and recognize your move (rock, paper, or scissors). The UI shows your camera at the bottom and the AI at the top, with real-time scoring and handedness detection.
- Python 3.x
- See
requirements.txtfor dependencies
- Install dependencies:
pip install -r requirements.txt
- (Optional) Create a
.envfile to set the webcam index:By default, the scripts use camera index 0. Change this if you have multiple cameras.cam=0
- Webcam Check:
python webcam-check.py
- Face Detection:
python face-detection.py
- Hand Skeleton Tracking:
python hand-skeleton.py
- Create Face Dataset:
python face_create_dataset.py
- Train Face Model:
python face_training.py
- Face Recognition:
python face_recognition.py
- Rock Paper Scissor Game:
python rock-paper-scissor/main.py
- All scripts support setting the camera index via the
camvariable in a.envfile. - For face recognition, you must first create a dataset and train the model.
- The face recognition script expects a
face-model.ymlfile generated by the training script.
License: This project is licensed under the MIT License. You are free to use, modify, and distribute this software with attribution.