This project enables real-time recognition of hand gestures (A-Z, 0-9) using OpenCV, MediaPipe, and a trained LSTM model in TensorFlow/Keras. It provides tools to collect data, train the model, and recognize gestures live from a webcam feed.
- Capture hand gesture data (A-Z, 0-9)
- Process data using MediaPipe for hand keypoint extraction
- Train an LSTM-based deep learning model
- Predict gestures in real time with OpenCV visualization
⚠️ Recommended Environment: Use Anaconda with Python 3.12 (due to compatibility issues with newer versions of some libraries). Tested with:
- Conda version:
conda 24.11.3
for %i in (A B C D E F G H I J K L M N O P Q R S T U V W X Y Z 0 1 2 3 4 5 6 7 8 9) do mkdir %i
If you wanna use this particular code then follow the particular steps
- You can go for anaconda or python , but most preferable is anaconda (Jupyter Notebook)
- Create a folder names as Images with subfolders of all alphabets and digits
- copy collectdata.py and run it to save your images into a file named as Images
- Capture a few images and save them
- copy and run function.py to run all the necessary functions which will create points on hand to track them
- copy and run data.py to save the end points of your hand and save thema as npy format for each alphabet
- Copy and run trainmodel.py to run the model and train your model
- If you want you can change the epoch size in a range of 200 and 500
- A new file will be automatically saved model.h5 where your model will be saved
- If your accuracy is greater than 0.8 then go ahead
- Copy and run app.py to run the final code as required
Requirements
-
tensorflow==2.15.0
-
mediapipe==0.10.9
-
opencv-python==4.9.0.80
-
scikit-learn==1.4.2
-
numpy
Check the ASl