# besoda/sign_lang_to_text architecture

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

- Interactive diagram: https://gitdiagram.com/besoda/sign_lang_to_text
- Repository: https://github.com/besoda/sign_lang_to_text

## Overview

This is an ASL alphabet gesture-recognition application with two user workflows: collect labeled camera examples, then train a classifier; and run live camera recognition using the saved classifier. The training path reads CSV landmarks and writes a checkpoint, while live recognition extracts landmarks, classifies them, and displays the predicted letter. The README documents real-time camera recognition. The source excerpts show these flows, but do not show speech output or persistence of the live result JSON.

Main entry points: [`live_recognition.py`](https://github.com/besoda/sign_lang_to_text/blob/main/live_recognition.py) (Recognition loop), [`model.py`](https://github.com/besoda/sign_lang_to_text/blob/main/model.py) (Training loop), [`manual_data.py`](https://github.com/besoda/sign_lang_to_text/blob/main/manual_data.py) (Gesture collector), [`gesture_data`](https://github.com/besoda/sign_lang_to_text/tree/main/gesture_data) (Gesture CSV samples)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_collection["Data collection"]
  node_collector["Gesture collector<br/>[manual_data.py]"]
  node_collector_landmarks["Landmark extraction<br/>[manual_data.py]"]
  node_gesture_csv[("Gesture CSV samples")]
end

subgraph group_training["Model training"]
  node_dataset["Dataset loader<br/>[model.py]"]
  node_trainer["Training loop<br/>[model.py]"]
  node_classifier["Gesture classifier<br/>[model.py]"]
  node_checkpoint["Model checkpoint"]
end

subgraph group_recognition["Live recognition"]
  node_live["Recognition loop"]
  node_live_landmarks["Hand landmark detection"]
  node_live_classifier["Live classifier"]
  node_display["Gesture display"]
end

node_user(("Operator"))
node_camera["Webcam"]

node_user -->|"starts collection"| node_collector
node_camera -->|"captures frames"| node_collector
node_collector -->|"processes frames"| node_collector_landmarks
node_collector_landmarks -->|"appends samples"| node_gesture_csv
node_gesture_csv -->|"loads samples"| node_dataset
node_dataset -->|"provides batches"| node_trainer
node_trainer -->|"trains"| node_classifier
node_trainer -->|"saves weights"| node_checkpoint
node_user -->|"runs recognition"| node_live
node_camera -->|"captures frames"| node_live
node_live -->|"processes frames"| node_live_landmarks
node_checkpoint -->|"loads weights"| node_live_classifier
node_live_landmarks -->|"provides keypoints"| node_live_classifier
node_live -->|"draws prediction"| node_display

click node_collector "https://github.com/besoda/sign_lang_to_text/blob/main/manual_data.py"
click node_collector_landmarks "https://github.com/besoda/sign_lang_to_text/blob/main/manual_data.py"
click node_gesture_csv "https://github.com/besoda/sign_lang_to_text/tree/main/gesture_data"
click node_dataset "https://github.com/besoda/sign_lang_to_text/blob/main/model.py"
click node_trainer "https://github.com/besoda/sign_lang_to_text/blob/main/model.py"
click node_classifier "https://github.com/besoda/sign_lang_to_text/blob/main/model.py"
click node_checkpoint "https://github.com/besoda/sign_lang_to_text/blob/main/gesture_classifier.pth"
click node_live "https://github.com/besoda/sign_lang_to_text/blob/main/live_recognition.py"
click node_live_landmarks "https://github.com/besoda/sign_lang_to_text/blob/main/live_recognition.py"
click node_live_classifier "https://github.com/besoda/sign_lang_to_text/blob/main/live_recognition.py"
click node_display "https://github.com/besoda/sign_lang_to_text/blob/main/live_recognition.py"

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_collector,node_collector_landmarks,node_gesture_csv toneBlue
class node_dataset,node_trainer,node_classifier,node_checkpoint toneAmber
class node_live,node_live_landmarks,node_live_classifier,node_display toneMint
class node_user,node_camera toneIndigo
```

## Components

### Data collection

- [Gesture collector](https://github.com/besoda/sign_lang_to_text/blob/main/manual_data.py): `manual_data.py`
- [Landmark extraction](https://github.com/besoda/sign_lang_to_text/blob/main/manual_data.py): `manual_data.py`
- [Gesture CSV samples](https://github.com/besoda/sign_lang_to_text/tree/main/gesture_data): `gesture_data`

### Model training

- [Dataset loader](https://github.com/besoda/sign_lang_to_text/blob/main/model.py): `model.py`
- [Training loop](https://github.com/besoda/sign_lang_to_text/blob/main/model.py): `model.py`
- [Gesture classifier](https://github.com/besoda/sign_lang_to_text/blob/main/model.py): `model.py`
- [Model checkpoint](https://github.com/besoda/sign_lang_to_text/blob/main/gesture_classifier.pth): `gesture_classifier.pth`

### Live recognition

- [Recognition loop](https://github.com/besoda/sign_lang_to_text/blob/main/live_recognition.py): `live_recognition.py`
- [Hand landmark detection](https://github.com/besoda/sign_lang_to_text/blob/main/live_recognition.py): `live_recognition.py`
- [Live classifier](https://github.com/besoda/sign_lang_to_text/blob/main/live_recognition.py): `live_recognition.py`
- [Gesture display](https://github.com/besoda/sign_lang_to_text/blob/main/live_recognition.py): `live_recognition.py`

### Other components

- **Operator**
- **Webcam**

## Connections

- Operator → Gesture collector: starts collection (evidence: `manual_data.py`)
- Webcam → Gesture collector: captures frames (evidence: `manual_data.py`)
- Gesture collector → Landmark extraction: processes frames (evidence: `manual_data.py`)
- Landmark extraction → Gesture CSV samples: appends samples (evidence: `manual_data.py`)
- Gesture CSV samples → Dataset loader: loads samples (evidence: `model.py`)
- Dataset loader → Training loop: provides batches (evidence: `model.py`)
- Training loop → Gesture classifier: trains (evidence: `model.py`)
- Training loop → Model checkpoint: saves weights (evidence: `model.py`)
- Operator → Recognition loop: runs recognition (evidence: `README.md`)
- Webcam → Recognition loop: captures frames (evidence: `live_recognition.py`)
- Recognition loop → Hand landmark detection: processes frames (evidence: `live_recognition.py`)
- Model checkpoint → Live classifier: loads weights (evidence: `live_recognition.py`)
- Hand landmark detection → Live classifier: provides keypoints (evidence: `live_recognition.py`)
- Recognition loop → Gesture display: draws prediction (evidence: `live_recognition.py`)
