Piyush23890/Sign_Language_Decoder
π€ SignBridge β Indian Sign Language Smart Communication System
Real-time ISL gesture β Text β Speech, with live English β Hindi translation. Single-click desktop app β no Python required for end users.
Table of Contents
- What is SignBridge?
- Features
- System Architecture
- Project Structure
- Quick Start (End Users)
- Developer Setup
- Data Collection
- Training Models
- Running the App
- Building the .exe
- Controls & Keyboard Shortcuts
- Tech Stack
- Troubleshooting
What is SignBridge?
SignBridge converts Indian Sign Language (ISL) hand gestures captured via a standard webcam into readable English text and spoken audio β in real time.
It bridges the communication gap between India's ~6.3 million hearing-impaired ISL users and the general public, requiring no specialist hardware beyond a laptop camera.
Features
System Architecture
Webcam Frame (OpenCV)
β
βΌ
MediaPipe Hands
21 landmarks Γ 3 coords Γ 2 hands = 126 features
β
βΌ
Motion Score = βkeypoints_t β keypoints_{t-1}β
β
ββββββ΄βββββββββββββββββββββ
β motion < 0.10 β motion β₯ 0.10
βΌ βΌ
Random Forest ONNX LSTM
(static AβZ) (dynamic words)
β β
ββββββββββββ¬βββββββββββββββ
βΌ
SentenceBuilder
(auto-space Β· backspace Β· clear)
β
βΌ
Deep-Translator (EN β HI)
β
βββββββ΄ββββββ
βΌ βΌ
WebSocket Video Feed
(SocketIO) (MJPEG stream)
β
βΌ
Browser UI
(HTML + JS)
β
Web Speech API
(TTS + STT)Project Structure
SignBridge/
β
βββ app.py β Main Flask application (run this)
βββ sentence_builder.py β SentenceBuilder class (also importable)
β
βββ templates/
β βββ index.html β UI template (Jinja2)
β
βββ static/
β βββ style.css β Dark glassmorphism styles
β βββ script.js β WebSocket + STT/TTS + clipboard JS
β
βββ dataset/ β Static landmark CSVs (created by collection)
β βββ A/data.csv
β βββ B/data.csv
β βββ ...Z/data.csv
β
βββ dynamic_dataset/ β Dynamic .npy sequences
β βββ hello/
β β βββ 0.npy ... N.npy
β βββ thank_you/
β βββ 0.npy ... N.npy
β
βββ isl_alphabet_model.pkl β Trained static RF model (Git LFS)
βββ dynamic_sign_model.h5 β Trained LSTM model (Git LFS)
βββ dynamic_sign_model.onnx β ONNX version for runtime (Git LFS)
β
βββ hand_landmarks_dataset.py β Collect static data
βββ collect_dynamic_data.py β Collect dynamic data
βββ merge_dataset.py β Merge per-letter CSVs β final_dataset.csv
βββ train_model.py β Train Random Forest
βββ train_dynamic_model.py β Train LSTM
βββ convert_to_onnx.py β Convert .h5 β .onnx
βββ run_setup_wizard.py β All-in-one first-time setup
βββ live_predict.py β Standalone webcam prediction demo
β
βββ test_sentence_builder.py β Unit tests
βββ requirements.txt
βββ SignBridge.spec β PyInstaller build spec
βββ .gitignore
βββ .gitattributes β Git LFS configQuick Start (End Users)
- Download
SignBridge.exefrom thedist/folder (or the GitHub Release). - Double-click
SignBridge.exe. - Your browser opens automatically at
http://127.0.0.1:5000. - Show your hand to the webcam and start signing β.
No Python, no installation required.
Developer Setup
1 β Clone the repository
git lfs install
git clone https://github.com/HetviPandav123/sign-language-smart-communication.git
cd sign-language-smart-communication
git lfs pull # download model files tracked via LFS2 β Create a virtual environment
python -m venv venv
# Windows
venv\Scripts\activate
# Linux / macOS
source venv/bin/activate3 β Install dependencies
pip install -r requirements.txtGPU users: Replacetensorflowwithtensorflow-gpuin requirements.txt CPU-only machines: Usetensorflow-cpuinstead
Data Collection
Option A β Automated wizard (recommended for first-time setup)
python run_setup_wizard.pyThe wizard guides you through:
- Recording 50 samples per letter (AβZ) with on-screen prompts
- Recording 30 gesture sequences each for "Hello" and "Thank You"
- Training both models automatically after collection
Option B β Manual collection
Static signs (AβZ):
# Collect 200 samples for letter A
python hand_landmarks_dataset.py --sign A --samples 200
# Repeat for B through Z
python hand_landmarks_dataset.py --sign B --samples 200
# ...Dynamic gestures:
python collect_dynamic_data.py --action hello --samples 200
python collect_dynamic_data.py --action thank_you --samples 200Tips for good data: - Use consistent lighting (avoid backlighting) - Vary hand distance (30β80 cm from camera) - Slightly vary the angle between samples for robustness
Training Models
Train static Random Forest model
python train_model.pyOutput: isl_alphabet_model.pkl + label_map.pkl
Train dynamic LSTM model
python train_dynamic_model.pyOutput: dynamic_sign_model.h5
Convert LSTM β ONNX (required for app.py)
python convert_to_onnx.pyOutput: dynamic_sign_model.onnx
Merge static CSVs (optional β for inspection)
python merge_dataset.pyOutput: final_dataset.csv
Running the App
python app.pyThe browser opens automatically at http://127.0.0.1:5000.
If the browser doesn't open, navigate there manually.
Building the .exe
Requires both models to be trained and present first.
pip install pyinstaller
pyinstaller SignBridge.specThe executable is written to dist/SignBridge.exe.
The spec file excludes TensorFlow from the bundle (it is mocked at runtime) which keeps the .exe size manageable. Only onnxruntime is bundled for inference.Controls & Keyboard Shortcuts
In-app buttons
Keyboard shortcuts
Tech Stack
Troubleshooting
"Paging file too small" on Windows
Caused by Flask debug mode + memory-mapped files. Fix: app.py already sets debug=False. If you still see this, restart your PC to clear the paging file.
Webcam not detected
# Check which index works (try 0, 1, 2)
python -c "import cv2; cap=cv2.VideoCapture(0); print(cap.isOpened())"Change cv2.VideoCapture(0) in app.py to the correct index.
MediaPipe import error in .exe
The SignBridge.spec already includes collect_all('mediapipe') and sys._MEIPASS path resolution. Rebuild with the provided spec β do not use pyinstaller app.py directly.
Static sign flickering
Each letter is locked after STATIC_FRAMES=5 stable frames and won't repeat until the hand moves away. Increase STATIC_FRAMES in app.py for stricter locking.
Poor recognition accuracy
- Collect more samples per sign (200+ recommended)
- Vary lighting conditions during collection
- Ensure both hands are visible for two-handed signs
- Re-train with the new data
Translation not working
Requires an internet connection. deep-translator uses Google Translate API. If offline, the raw English sentence is shown as fallback.
Author
Hetvi Pandav BE β Artificial Intelligence & Machine Learning
β If SignBridge helped you, star the repo!
