How vinn369/sign-language-detection-system works
Project Type and Purpose
• This is a stand-alone computer-vision tool (a single-service Python application) for real-time sign-language gesture detection and classification. It provides two main workflows:
• Data Collection (datacollection.py)
• Real-Time Detection and Classification (test.py)
Main Components
a. Input Devices and Data Sources
• Webcam (Video Stream)
b. Preprocessing & Hand-Tracking Pipeline
• OpenCV (cv2) Video Capture
• cvzone Hand-Tracking Module
• Frame preprocessing (cropping, resizing, normalization)
c. Model Inference Layer
• Keras Model (keras_model.h5)
• NumPy for tensor manipulation
d. Postprocessing & Presentation
• Window (cv2.imshow)
e. Data Collection Subsystem
• datacollection.py script
• Local file storage for raw/processed images
f. Model Training (External)
• Retraining workflow (outside of real-time app)
• Dataset directory (generated by datacollection.py)
g. Storage & Configuration
• labels.txt (gesture class definitions)
• keras_model.h5 (model weights)
Relationships & Data Flow
1) Webcam → OpenCV Capture → Frame Buffer
2) Frame → cvzone Hand-Tracker → Extracted Hand ROI
3) ROI → Preprocessor (resize, normalize) → NumPy Array
4) Array → Keras Model → Prediction Vector
5) Prediction → labels.txt lookup → Gesture Label
6) Label + ROI → Overlay → Display Window
7) (In Data Collection mode)
• Press ‘s’ → Save processed ROI → Local Dataset Folder
8) (External) Dataset Folder → Model Training Script → keras_model.h5
Architectural Patterns & Design Principles
• Pipeline Pattern: clearly separated stages (capture → detect → infer → render).
• Single Responsibility: distinct scripts for data collection vs inference.
• Modularity: interchangeable model file and label set for extensibility.
Technologies & Libraries
• Python 3.x
• OpenCV (cv2) for capture and display
• cvzone for robust hand detection
• NumPy for array manipulation
• Keras (TensorFlow backend) for deep learning inference
• File I/O for labels and data storage
Detail & Granularity
• Parameters (e.g., input size to model, number of classes).
• Make clear the trigger points (e.g., “press ‘s’ → save image,” “press ‘q’ → exit”).