This project uses MediaPipe to extract hand landmarks and a Random Forest model to recognize American Sign Language (ASL) alphabet letters. It also includes real-time sign recognition using your webcam.
- Uses the ASL Alphabet dataset from Kaggle
- Extracts hand landmarks using MediaPipe
- Trains a Random Forest classifier on landmark data
- Tests accuracy on validation data
- Predicts ASL hand signs in real-time via webcam
Install the required Python libraries:
pip install mediapipe opencv-python scikit-learn joblib tqdm
- Download the ASL Alphabet Dataset from Kaggle:
https://www.kaggle.com/datasets/grassknoted/asl-alphabet - Extract it and place it inside a folder named
datasetin the root of this project.
python data_extractor.py
Run the training script:
python train.py
This will train and save the model as asl_model.pkl.
Evaluate the model:
python test.py
Start real-time webcam recognition:
python predict.py
- Ensure your webcam is working.
- Show your hand clearly in front of the camera.
- Press q to quit.
- MediaPipe detects 21 hand landmarks (x, y, z coordinates).
- These landmarks are used as features.
- A Random Forest classifier is trained on this feature set to predict ASL letters.
- OpenCV manages real-time webcam access and display.
- The model uses landmark coordinates, not raw images, for better efficiency.
- For best results: use a clean background and keep your hand visible and centered.
- Supports static ASL letters (A–Z), excluding motion-based gestures like "J" and "Z".
Pull requests are welcome! Feel free to fork or open an issue.
This project is open-source under the MIT License.
Vivan Rajath
GitHub: https://github.com/VivanRajath