Assistive, real-time hand-gesture-to-text system aimed at helping people with selective mutism (and anyone who prefers hands over voice) communicate using a webcam. The app detects a single hand, recognizes the sign, and builds words/sentences on screen.
People who can’t speak in certain social situations often rely on gestures or writing. This tool turns hand signs into text instantly so conversations can flow in classrooms, workplaces, clinics, or day-to-day life.
- Live hand tracking via webcam
- Gesture recognition with a lightweight ML classifier (Random Forest)
- Uses ~42 features from one hand (2D landmark pairs)
- Word builder: append predicted letters/words to an on-screen text area
- Low-latency: runs locally on CPU; no internet required
- Python
- OpenCV – camera frames & drawing
- MediaPipe (or similar) – hand landmarks
- scikit-learn – Random Forest classifier
- NumPy / Pandas – feature processing
Model idea: extract 21 landmark points → normalize → build a 42-feature vector (x,y) → predict letter/word.
git clone https://github.com/Ridit07/Selective-Mutism-Hand-Gesture-To-Text.git
cd Selective-Mutism-Hand-Gesture-To-Text# create & activate a venv (recommended)
python -m venv .venv
# Windows
.venv\Scripts\activate
# macOS/Linux
source .venv/bin/activate
pip install -r requirements.txt
#If you don’t have a requirements.txt, install the essentials:
pip install opencv-python mediapipe scikit-learn numpy pandaspython app.py- Allow webcam access when prompted.
- Hold your hand inside the guide box and show a supported sign.
- Watch predictions appear in real time.
- Press Space or Enter (or click the on-screen button) to add the prediction to the text area.
💡 If your entry file is named differently, run it accordingly:
python main.py
- Capture – Read webcam frames using OpenCV.
- Landmarks – Detect a single hand and extract 21 keypoints.
- Features – Normalize coordinates (scale/translate) into a 42-dimensional vector.
- Predict – Random Forest classifier maps features to a letter/word.
- Compose – Append results into an editable text area for live communication.
- Record landmark samples for each class (A–Z / words).
- Build a CSV of features and labels.
- Train with:
from sklearn.ensemble import RandomForestClassifier
clf = RandomForestClassifier(n_estimators=300, max_depth=None, random_state=42)
clf.fit(X_train, y_train)
# Save model
import joblib
joblib.dump(clf, "models/rf_gesture.pkl")- Replace the file models/rf_gesture.pkl in the app.
