Skip to content

Palak1703/Sign-Language-ASL

Repository files navigation


✋ Sign Language Interpreter (ASL)

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.


🚀 Features

• Recognizes 26 ASL alphabets (A–Z)Real-time gesture detection using webcam • Custom dataset collection pipelineMediaPipe hand landmark extractionRandom Forest ML model for classification • Lightweight and runs on CPU without GPU


🧠 Tech Stack

  • Python
  • OpenCV
  • MediaPipe
  • Scikit-learn
  • NumPy
  • Random Forest Classifier

📂 Project Structure

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

📊 Dataset

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.


⚙️ Installation

Clone the repository:

git clone https://github.com/Palak1703/Sign-Language-ASL.git
cd Sign-Language-ASL

Create and activate a virtual environment:

Windows (PowerShell):

python -m venv .venv
.\.venv\Scripts\Activate.ps1

Windows (Command Prompt):

python -m venv .venv
.\.venv\Scripts\activate.bat

macOS / Linux:

python3 -m venv .venv
source .venv/bin/activate

Install dependencies:

pip install -r requirements.txt

📸 Step 1: Collect Gesture Images

Run the script to collect gesture images.

python collect_imgs.py

Capture around 200 images per alphabet gesture.


🗂 Step 2: Create Dataset

Convert collected images into a structured dataset.

python create_dataset.py

This will generate:

data.pickle

🤖 Step 3: Train the Model

Train the Random Forest classifier.

python train_classifier.py

This generates the trained model:

model.p

🎥 Step 4: Run Real-Time Interpreter

Run the gesture recognition system:

python inference_classifier.py

The webcam will start and the system will predict ASL letters in real-time.


🔍 How It Works

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


📈 Model

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


🔮 Future Improvements

• Add word and sentence detection • Improve accuracy with deep learning models (CNN / LSTM) • Add speech output from predicted text • Support dynamic gestures


📜 License

This project is licensed under the MIT License.


👩‍💻 Author

Palak

If you like this project, consider ⭐ starring the repository.


About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages