# longhoang1208/handgesturedetector architecture

> Architecture diagram of the GitHub repository longhoang1208/handgesturedetector, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-10). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/longhoang1208/handgesturedetector
- Repository: https://github.com/longhoang1208/handgesturedetector

## Overview

Hand Gesture Detector is a desktop webcam application for recognizing hand signs, with user-managed labels and models, data collection, model training, single-sign recognition, and multi-sign sentence assembly. The main workflow is to select a user and feature, then collect landmark sequences and train a model or load an existing model and labels for live prediction; recognized text can be spoken aloud. The README documents the broader product capabilities, while source excerpts show key calls. Some subsystem links rely on README descriptions because their complete implementations were not sampled.

Main entry points: [`a1_data_collect_module.py`](https://github.com/longhoang1208/handgesturedetector/blob/main/a1_data_collect_module.py) (Data Collection), [`_detector.py`](https://github.com/longhoang1208/handgesturedetector/blob/main/_detector.py) (Gesture Detector), [`b1_module1_single_sign.py`](https://github.com/longhoang1208/handgesturedetector/blob/main/b1_module1_single_sign.py) (Single Sign), [`b2_module2_multi_sign.py`](https://github.com/longhoang1208/handgesturedetector/blob/main/b2_module2_multi_sign.py) (Multi Sign)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Application"]
  node_main["App and User Setup<br/>[A_main.py]"]
  node_module_nav["Feature Navigation<br/>[A_main.py]"]
  node_ui_assets["UI Resources<br/>[resources_rc.py]"]
end

subgraph group_authoring["Data and Training"]
  node_collection["Data Collection"]
  node_training["Model Training"]
end

subgraph group_recognition["Recognition"]
  node_single["Single Sign"]
  node_multi["Multi Sign"]
  node_detector_ui["Recognition Setup<br/>[_detector.py]"]
  node_detector["Gesture Detector<br/>[_detector.py]"]
  node_sequence["Sequence Assembly"]
end

subgraph group_shared["Shared Services"]
  node_landmarks["Landmark Processing<br/>[_landmark.py]"]
  node_config["Shared Configuration<br/>[_config.py]"]
  node_speech["Speech Output<br/>[_tts_module.py]"]
end

subgraph group_state["User Data"]
  node_labels["Label Files"]
  node_dataset[("Collected Sequences")]
  node_models[("Trained Models")]
end

node_user(("User"))
node_camera(("Webcam"))
node_speaker(("Audio Device"))

node_user -->|"starts"| node_main
node_main -->|"configures"| node_config
node_main -->|"opens"| node_module_nav
node_main -->|"uses"| node_ui_assets
node_module_nav -->|"opens"| node_collection
node_module_nav -->|"opens"| node_training
node_module_nav -->|"opens"| node_single
node_module_nav -->|"opens"| node_multi
node_user -->|"defines labels"| node_collection
node_collection -->|"captures frames"| node_camera
node_collection -->|"extracts landmarks"| node_landmarks
node_collection -->|"writes sequences"| node_dataset
node_collection -->|"saves labels"| node_labels
node_user -->|"selects dataset"| node_training
node_training -->|"trains from"| node_dataset
node_training -->|"loads labels"| node_labels
node_training -->|"saves model"| node_models
node_single -->|"inherits setup"| node_detector_ui
node_multi -->|"inherits setup"| node_detector_ui
node_single -->|"loads labels"| node_labels
node_single -->|"loads model"| node_models
node_multi -->|"loads labels"| node_labels
node_multi -->|"loads model"| node_models
node_detector_ui -->|"initializes"| node_detector
node_detector -->|"reads frames"| node_camera
node_detector -->|"extracts features"| node_landmarks
node_detector -.->|"predicts with"| node_models
node_single -->|"runs detection"| node_detector
node_multi -->|"collects predictions"| node_sequence
node_sequence -->|"runs detection"| node_detector
node_single -->|"starts speech"| node_speech
node_multi -->|"starts speech"| node_speech
node_speech -->|"plays audio"| node_speaker
node_detector -->|"reads settings"| node_config
node_collection -->|"reads settings"| node_config
node_training -->|"reads settings"| node_config

click node_main "https://github.com/longhoang1208/handgesturedetector/blob/main/A_main.py"
click node_module_nav "https://github.com/longhoang1208/handgesturedetector/blob/main/A_main.py"
click node_ui_assets "https://github.com/longhoang1208/handgesturedetector/blob/main/resources_rc.py"
click node_collection "https://github.com/longhoang1208/handgesturedetector/blob/main/a1_data_collect_module.py"
click node_training "https://github.com/longhoang1208/handgesturedetector/blob/main/a2_model_training_module.py"
click node_single "https://github.com/longhoang1208/handgesturedetector/blob/main/b1_module1_single_sign.py"
click node_multi "https://github.com/longhoang1208/handgesturedetector/blob/main/b2_module2_multi_sign.py"
click node_detector_ui "https://github.com/longhoang1208/handgesturedetector/blob/main/_detector.py"
click node_detector "https://github.com/longhoang1208/handgesturedetector/blob/main/_detector.py"
click node_sequence "https://github.com/longhoang1208/handgesturedetector/blob/main/b2_module2_multi_sign.py"
click node_landmarks "https://github.com/longhoang1208/handgesturedetector/blob/main/_landmark.py"
click node_config "https://github.com/longhoang1208/handgesturedetector/blob/main/_config.py"
click node_speech "https://github.com/longhoang1208/handgesturedetector/blob/main/_tts_module.py"
click node_labels "https://github.com/longhoang1208/handgesturedetector/tree/main/labels"
click node_models "https://github.com/longhoang1208/handgesturedetector/tree/main/models"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_main,node_module_nav,node_ui_assets,node_user toneBlue
class node_collection,node_training toneAmber
class node_single,node_multi,node_detector_ui,node_detector,node_sequence toneMint
class node_landmarks,node_config,node_speech toneRose
class node_labels,node_dataset,node_models,node_camera,node_speaker toneIndigo
```

## Components

### Application

- [App and User Setup](https://github.com/longhoang1208/handgesturedetector/blob/main/A_main.py): `A_main.py`
- [Feature Navigation](https://github.com/longhoang1208/handgesturedetector/blob/main/A_main.py): `A_main.py`
- [UI Resources](https://github.com/longhoang1208/handgesturedetector/blob/main/resources_rc.py): `resources_rc.py`

### Data and Training

- [Data Collection](https://github.com/longhoang1208/handgesturedetector/blob/main/a1_data_collect_module.py): `a1_data_collect_module.py`
- [Model Training](https://github.com/longhoang1208/handgesturedetector/blob/main/a2_model_training_module.py): `a2_model_training_module.py`

### Recognition

- [Single Sign](https://github.com/longhoang1208/handgesturedetector/blob/main/b1_module1_single_sign.py): `b1_module1_single_sign.py`
- [Multi Sign](https://github.com/longhoang1208/handgesturedetector/blob/main/b2_module2_multi_sign.py): `b2_module2_multi_sign.py`
- [Recognition Setup](https://github.com/longhoang1208/handgesturedetector/blob/main/_detector.py): `_detector.py`
- [Gesture Detector](https://github.com/longhoang1208/handgesturedetector/blob/main/_detector.py): `_detector.py`
- [Sequence Assembly](https://github.com/longhoang1208/handgesturedetector/blob/main/b2_module2_multi_sign.py): `b2_module2_multi_sign.py`

### Shared Services

- [Landmark Processing](https://github.com/longhoang1208/handgesturedetector/blob/main/_landmark.py): `_landmark.py`
- [Shared Configuration](https://github.com/longhoang1208/handgesturedetector/blob/main/_config.py): `_config.py`
- [Speech Output](https://github.com/longhoang1208/handgesturedetector/blob/main/_tts_module.py): `_tts_module.py`

### User Data

- [Label Files](https://github.com/longhoang1208/handgesturedetector/tree/main/labels): `labels`
- **Collected Sequences**
- [Trained Models](https://github.com/longhoang1208/handgesturedetector/tree/main/models): `models`

### Other components

- **User**
- **Webcam**
- **Audio Device**

## Connections

- User → App and User Setup: starts (evidence: `README.md`)
- App and User Setup → Shared Configuration: configures (evidence: `A_main.py`)
- App and User Setup → Feature Navigation: opens (evidence: `A_main.py`)
- App and User Setup → UI Resources: uses (evidence: `A_main.py`)
- Feature Navigation → Data Collection: opens (evidence: `A_main.py`)
- Feature Navigation → Model Training: opens (evidence: `A_main.py`)
- Feature Navigation → Single Sign: opens (evidence: `A_main.py`)
- Feature Navigation → Multi Sign: opens (evidence: `A_main.py`)
- User → Data Collection: defines labels (evidence: `README.md`)
- Data Collection → Webcam: captures frames (evidence: `a1_data_collect_module.py`)
- Data Collection → Landmark Processing: extracts landmarks (evidence: `a1_data_collect_module.py`)
- Data Collection → Collected Sequences: writes sequences (evidence: `README.md`)
- Data Collection → Label Files: saves labels (evidence: `README.md`)
- User → Model Training: selects dataset (evidence: `README.md`)
- Model Training → Collected Sequences: trains from (evidence: `README.md`)
- Model Training → Label Files: loads labels (evidence: `a2_model_training_module.py`)
- Model Training → Trained Models: saves model (evidence: `README.md`)
- Single Sign → Recognition Setup: inherits setup (evidence: `b1_module1_single_sign.py`)
- Multi Sign → Recognition Setup: inherits setup (evidence: `b2_module2_multi_sign.py`)
- Single Sign → Label Files: loads labels (evidence: `b1_module1_single_sign.py`)
- Single Sign → Trained Models: loads model (evidence: `b1_module1_single_sign.py`)
- Multi Sign → Label Files: loads labels (evidence: `b2_module2_multi_sign.py`)
- Multi Sign → Trained Models: loads model (evidence: `b2_module2_multi_sign.py`)
- Recognition Setup → Gesture Detector: initializes (evidence: `_detector.py`)
- Gesture Detector → Webcam: reads frames (evidence: `_detector.py`)
- Gesture Detector → Landmark Processing: extracts features (evidence: `_detector.py`)
- Gesture Detector → Trained Models: predicts with
- Single Sign → Gesture Detector: runs detection (evidence: `b1_module1_single_sign.py`)
- Multi Sign → Sequence Assembly: collects predictions (evidence: `b2_module2_multi_sign.py`)
- Sequence Assembly → Gesture Detector: runs detection (evidence: `b2_module2_multi_sign.py`)
- Single Sign → Speech Output: starts speech (evidence: `b1_module1_single_sign.py`)
- Multi Sign → Speech Output: starts speech (evidence: `b2_module2_multi_sign.py`)
- Speech Output → Audio Device: plays audio (evidence: `_tts_module.py`)
- Gesture Detector → Shared Configuration: reads settings (evidence: `_detector.py`)
- Data Collection → Shared Configuration: reads settings (evidence: `a1_data_collect_module.py`)
- Model Training → Shared Configuration: reads settings (evidence: `a2_model_training_module.py`)
