A Machine Learning based Sign Language Interpreter that detects and translates American Sign Language (ASL) alphabets (A–Z) into text in real-time using computer vision.
The system uses MediaPipe hand tracking to extract hand landmarks and a Random Forest Classifier trained on a custom dataset to recognize gestures accurately.
• Recognizes 26 ASL alphabets (A–Z) • Real-time gesture detection using webcam • Custom dataset collection pipeline • MediaPipe hand landmark extraction • Random Forest ML model for classification • Lightweight and runs on CPU without GPU
- Python
- OpenCV
- MediaPipe
- Scikit-learn
- NumPy
- Random Forest Classifier
Sign-Language-Interpreter
│
├── collect_imgs.py # Collect gesture images using webcam
├── create_dataset.py # Convert collected images to training dataset
├── train_classifier.py # Train Random Forest model
├── inference_classifier.py# Run real-time gesture detection
│
├── model.p # Trained ML model
├── data.pickle # Processed dataset
├── asl.jpg # ASL reference chart
│
├── requirements.txt
├── LICENSE
└── README.md
A custom dataset was created for this project.
- 26 Classes (A–Z)
- ~200 frames collected per alphabet
- Captured using webcam
- Hand landmarks extracted using MediaPipe
The dataset was converted into numerical feature vectors before training the model.
Clone the repository:
git clone https://github.com/Palak1703/Sign-Language-ASL.git
cd Sign-Language-ASLCreate and activate a virtual environment:
Windows (PowerShell):
python -m venv .venv
.\.venv\Scripts\Activate.ps1Windows (Command Prompt):
python -m venv .venv
.\.venv\Scripts\activate.batmacOS / Linux:
python3 -m venv .venv
source .venv/bin/activateInstall dependencies:
pip install -r requirements.txtRun the script to collect gesture images.
python collect_imgs.pyCapture around 200 images per alphabet gesture.
Convert collected images into a structured dataset.
python create_dataset.pyThis will generate:
data.pickle
Train the Random Forest classifier.
python train_classifier.pyThis generates the trained model:
model.p
Run the gesture recognition system:
python inference_classifier.pyThe webcam will start and the system will predict ASL letters in real-time.
1️⃣ OpenCV captures webcam frames 2️⃣ MediaPipe detects hand landmarks (21 key points) 3️⃣ Landmarks are converted into feature vectors 4️⃣ Random Forest Classifier predicts the ASL letter 5️⃣ Prediction is displayed on screen
Algorithm used:
Random Forest Classifier
Why Random Forest?
• Works well with small datasets • Handles non-linear relationships • Fast training and inference • Good accuracy for gesture classification
• Add word and sentence detection • Improve accuracy with deep learning models (CNN / LSTM) • Add speech output from predicted text • Support dynamic gestures
This project is licensed under the MIT License.
Palak
If you like this project, consider ⭐ starring the repository.