This is a Python based sign language detector that uses computer vision and machine learning to recognize and classify sign language gestures in real-time.
- Real-time gesture recognition: The application uses your webcam to detect and classify sign language gestures in real-time.
- 26-letter alphabet support: The model is trained to recognize all 26 letters of the American Sign Language (ASL) alphabet.
- Easy to use: The application is easy to set up and use. Simply run the
inference_classifier.pyscript to start detecting gestures. - Customizable: You can easily retrain the model on your own custom gestures by following the data collection and training instructions below.
- Python 3.10
- OpenCV
- MediaPipe
- Scikit-learn
- Clone the repository:
git clone https://github.com/88448844/sign-language-detector.git cd sign-language-detector - Create a virtual environment:
python -m venv env source env/bin/activate # On Windows, use `env\Scripts\activate`
- Install the requirements:
pip install -r requirements.txt
This is the most important step for creating an accurate model. You will need to collect a few hundred images for each sign language gesture you want to recognize.
Run the collect_imgs.py script to start the data collection process.
python collect_imgs.pyThe script will open your webcam and guide you through the process. For each letter of the alphabet (A-Z), you will be prompted to press 'Q' to start collecting images. Make sure to move your hand around and show the gesture from different angles to create a robust dataset. The script will collect 200 images for each letter.
Once you have collected the images, run the create_dataset.py script to process them and create a dataset file (data.pickle). This script will extract the hand landmarks from the images and save them in a format that can be used for training the model.
python create_dataset.pyRun the train_classifier.py script to train a machine learning model on the dataset you created. This script will create a model.p file, which contains the trained model.
python train_classifier.pyFinally, run the inference_classifier.py script to see the sign language detector in action! The script will use your webcam to recognize and classify the gestures you trained it on.
python inference_classifier.pyThis project is licensed under the MIT License. See the LICENSE file for details.