This is a small project I built to recognize hand signs (like letters) using the webcam.
The idea is simple:
- detect the hand
- extract its shape (landmarks)
- train a model
- predict the sign in real time
- Python
- OpenCV → for camera and image processing
- MediaPipe → to detect hand landmarks
- Scikit-learn → Random Forest model
-
Collect data I capture images of different hand signs using the webcam.
-
Feature extraction MediaPipe gives me hand landmarks (basically coordinates of fingers and joints).
-
Dataset I store these coordinates with labels (A, B, etc.).
-
Training I train a Random Forest classifier on this data.
-
Prediction The webcam runs in real time and predicts the hand sign.
collect_img.py→ collect images from webcamcreate_dataset.py→ convert images to landmark datatrain_classifier.py→ train the modelinference_classifier.py→ run real-time predictiondata/→ saved imagesdata.pickle→ processed datasetmodel.p→ trained model
- Accuracy depends a lot on the dataset (lighting, angles, etc.)
- Works well for simple signs, but not full words