How gajalakshmi0133/suhwa works
Purpose and Entry Points
Suhwa is a sign-language learning/detection system combining server-rendered web pages, browser-side camera interactions, ML inference/training utilities, and a relational user-data layer. The primary application entry point is app.py; deployment/runtime settings are centralized in config.py. HTML routes render templates from templates/, with frontend behavior and assets served from static/.
Web Application Layer
The Python application owns navigation and feature pages for authentication, dashboard/profile, learning content, sign detection, uploads, community/chat, and video calls. Page-level boundaries are visible in templates/detect.html, templates/learn.html, and templates/video_call.html. Shared presentation is rooted at templates/layout.html; browser workflows are implemented in static/js/main.js, static/js/detect.js, and static/js/video_call.js.
Sign Detection and Inference
backend/sign_detection/ is the ML-serving boundary. It separates model acquisition/loading (backend/sign_detection/model_loader.py) from single-input prediction (backend/sign_detection/predict.py, backend/sign_detection/predict_image.py) and live camera inference (backend/sign_detection/realtime_inference.py). Sequence-oriented recognition has a separate decode/language layer via backend/sign_detection/ctc_decode.py and backend/sign_detection/language_model.py, allowing frame/landmark model output to become text-like labels.
Model Development Pipeline
Training is intentionally decoupled from request-time inference. Image classifiers are trained through backend/sign_detection/train_image_model.py and backend/sign_detection/train_asl_image_model.py; temporal/landmark models use backend/sign_detection/train_sequence_model.py and backend/sign_detection/train_sequence_landmarks.py. Alternative experimentation and model families are retained under tools/, including CNN, ViT, and YOLO workflows (tools/train_asl_cnn.py, tools/vit_detect.py, tools/yolo_asl_alphabet.py).
Data and Feature Boundaries
The repository contains both source image datasets and derived ML artifacts. Alphabet/digit image data is organized under dataset/American_Sign_Language/, while ISL material is under dataset/ISL/. Prepared array datasets (dataset/prepared/X.npy, dataset/prepared/y.npy) and many per-label sequence tensors in dataset/sequences/ supply the sequence training path. Landmark extraction and dataset conversion are offline preprocessing responsibilities of tools/extract_landmarks.py and tools/prepare_dataset.py, not web-request responsibilities.
Identity, Persistence, and Security
Application-facing account and persistence concerns are isolated from detection code in backend/utils/auth.py, backend/utils/db.py, and backend/utils/crypto.py. SQL schema/bootstrap and migration workflows are represented by schema.sql, init_database.py, and migrate_sample_data.py. The checked-in SQL Server ODBC connection descriptor indicates Microsoft SQL Server is a material external infrastructure dependency; credentials/encryption guidance is maintained in CREDENTIALS.TEMPLATE.md and ENCRYPTION_GUIDE.md.
Runtime Composition
The system spans a Python backend/ML runtime (dependencies declared in requirements.txt and pyproject.toml) and a browser JavaScript runtime (static/js/, with Node package metadata in package.json). Static curriculum/reference content is file-backed, including static/data/learning_content.json, static/data/tutorials.json, and sign-reference imagery under static/img/signs/. This makes web content delivery, ML inference, and SQL-backed user state distinct operational boundaries.
Main entry points: app.py Python application · model_loader.py Model loader · prepare_dataset.py Dataset preprocessing · realtime_inference.py Live camera inference
Components 19
Web experience
- Python application · Owns routes and feature pages.
app.py - Runtime settings
config.py - Page templates · Shared layout and feature pages.
- Browser workflows · Camera detection and video-call interactions.
- Learning content
static/data/learning_content.json
Detection serving
- Model loader
backend/sign_detection/model_loader.py - Image prediction
backend/sign_detection/predict.py - Live camera inference
backend/sign_detection/realtime_inference.py - Sequence decoding · Converts temporal model output into labels.
backend/sign_detection/ctc_decode.py
ML data & training
- Sign image datasets · ASL alphabet/digits and ISL material.
- Prepared arrays
dataset/prepared/X.npy - Sequence tensors
- Dataset preprocessing · Prepares arrays and extracts landmarks.
tools/prepare_dataset.py - Image model training
backend/sign_detection/train_image_model.py - Sequence model training
backend/sign_detection/train_sequence_model.py
Identity & persistence
- Authentication
backend/utils/auth.py - Database access
backend/utils/db.py - Microsoft SQL Server · Stores application user state.
- Database schema
schema.sql
Connections 23
- Runtime settings → Python application: configures
- Python application → Page templates: renders
- Page templates → Browser workflows: loads
- Python application → Learning content: serves
- Browser workflows → Python application: camera and page requests
- Python application → Image prediction: image detection
- Python application → Live camera inference: live detection
- Model loader → Image prediction: supplies model
- Model loader → Live camera inference: supplies model
- Live camera inference → Sequence decoding: decodes sequences
- Dataset preprocessing → Prepared arrays: creates
- Dataset preprocessing → Sequence tensors: creates
- Sign image datasets → Dataset preprocessing: source images
- Sign image datasets → Image model training: trains from
- Prepared arrays → Sequence model training: trains from
- Sequence tensors → Sequence model training: trains from
- Image model training → Model loader: produces model artifacts
- Sequence model training → Model loader: produces model artifacts
- Python application → Authentication: authenticates users
- Python application → Database access: user data operations
- Authentication → Database access: uses
- Database access → Microsoft SQL Server: ODBC connection
- Database schema → Microsoft SQL Server: defines