# p-yashavanth/asl-sr architecture

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

- Interactive diagram: https://gitdiagram.com/p-yashavanth/asl-sr
- Repository: https://github.com/p-yashavanth/asl-sr

## Overview

This is an ASL alphabet recognition application with both a Flask/webcam interface and a standalone OpenCV interface, plus a CSV-based model training workflow. In the web path, webcam frames are landmarked, normalized, classified, and debounced into sentence text, which the browser can inspect and edit or request to be spoken. Training augments and normalizes labeled landmarks before selecting and saving a classifier and labels. The README also describes dataset landmark collection, but its implementation is not established by the sampled files; that boundary is noted rather than inferred.

Main entry points: [`app.py`](https://github.com/p-yashavanth/asl-sr/blob/main/app.py) (Web interface), [`predicate.py`](https://github.com/p-yashavanth/asl-sr/blob/main/predicate.py) (Standalone recognition), [`train.py`](https://github.com/p-yashavanth/asl-sr/blob/main/train.py) (Classifier training), [`normalize_utils.py`](https://github.com/p-yashavanth/asl-sr/blob/main/normalize_utils.py) (Landmark normalization)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Recognition runtime"]
  node_webapp["Web interface<br/>[app.py]"]
  node_webcam["Webcam capture<br/>[app.py]"]
  node_handtracking["Hand tracking<br/>[app.py]"]
  node_webclassification["Gesture classification<br/>[app.py]"]
  node_websentence["Sentence composition<br/>[app.py]"]
  node_speech["Text-to-speech<br/>[app.py]"]
  node_standalone["Standalone recognition<br/>[predicate.py]"]
end

subgraph group_training["Model training"]
  node_dataset[("Labeled dataset")]
  node_augmentation["Landmark augmentation<br/>[train.py]"]
  node_trainer["Classifier training<br/>[train.py]"]
  node_model[("Saved classifier<br/>[gesture_model.zip]")]
  node_labels["Saved labels<br/>[labels.pkl]"]
end

subgraph group_shared["Shared components"]
  node_normalizer["Landmark normalization<br/>[normalize_utils.py]"]
end

node_user(("Web user"))
node_operator(("Training operator"))
node_mediapipe["MediaPipe"]
node_camera["Webcam"]
node_browser["Browser"]
node_ttsengine["Speech engine"]

node_user -->|"uses"| node_browser
node_browser -->|"requests routes"| node_webapp
node_webapp -->|"streams frames"| node_webcam
node_camera -->|"provides video"| node_webcam
node_webcam -->|"processes frames"| node_handtracking
node_handtracking -->|"detects landmarks"| node_mediapipe
node_webapp -->|"predicts gestures"| node_webclassification
node_webclassification -->|"normalizes landmarks"| node_normalizer
node_normalizer -->|"returns features"| node_webclassification
node_webclassification -->|"commits predictions"| node_websentence
node_websentence -->|"serves state"| node_webapp
node_webapp -->|"returns stream and state"| node_browser
node_webapp -->|"speaks request"| node_speech
node_speech -->|"uses engine"| node_ttsengine
node_operator -->|"runs training"| node_trainer
node_dataset -->|"supplies labeled rows"| node_trainer
node_trainer -->|"augments samples"| node_augmentation
node_trainer -->|"normalizes samples"| node_normalizer
node_trainer -->|"saves classifier"| node_model
node_trainer -->|"saves classes"| node_labels
node_standalone -->|"captures video"| node_camera
node_standalone -->|"tracks hands"| node_mediapipe
node_standalone -->|"normalizes landmarks"| node_normalizer
node_standalone -.->|"loads classifier"| node_model
node_standalone -.->|"loads labels"| node_labels
node_webapp -.->|"loads classifier"| node_model
node_webapp -.->|"loads labels"| node_labels
node_webapp -.->|"alternative interface"| node_standalone

click node_webapp "https://github.com/p-yashavanth/asl-sr/blob/main/app.py"
click node_webcam "https://github.com/p-yashavanth/asl-sr/blob/main/app.py"
click node_handtracking "https://github.com/p-yashavanth/asl-sr/blob/main/app.py"
click node_webclassification "https://github.com/p-yashavanth/asl-sr/blob/main/app.py"
click node_websentence "https://github.com/p-yashavanth/asl-sr/blob/main/app.py"
click node_speech "https://github.com/p-yashavanth/asl-sr/blob/main/app.py"
click node_standalone "https://github.com/p-yashavanth/asl-sr/blob/main/predicate.py"
click node_augmentation "https://github.com/p-yashavanth/asl-sr/blob/main/train.py"
click node_trainer "https://github.com/p-yashavanth/asl-sr/blob/main/train.py"
click node_model "https://github.com/p-yashavanth/asl-sr/blob/main/gesture_model.zip"
click node_labels "https://github.com/p-yashavanth/asl-sr/blob/main/labels.pkl"
click node_normalizer "https://github.com/p-yashavanth/asl-sr/blob/main/normalize_utils.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_webapp,node_webcam,node_handtracking,node_webclassification,node_websentence,node_speech,node_standalone,node_user,node_browser toneBlue
class node_dataset,node_augmentation,node_trainer,node_model,node_labels toneAmber
class node_normalizer,node_mediapipe toneMint
class node_operator,node_camera,node_ttsengine toneIndigo
```

## Components

### Recognition runtime

- [Web interface](https://github.com/p-yashavanth/asl-sr/blob/main/app.py): `app.py`
- [Webcam capture](https://github.com/p-yashavanth/asl-sr/blob/main/app.py): `app.py`
- [Hand tracking](https://github.com/p-yashavanth/asl-sr/blob/main/app.py): `app.py`
- [Gesture classification](https://github.com/p-yashavanth/asl-sr/blob/main/app.py): `app.py`
- [Sentence composition](https://github.com/p-yashavanth/asl-sr/blob/main/app.py): `app.py`
- [Text-to-speech](https://github.com/p-yashavanth/asl-sr/blob/main/app.py): `app.py`
- [Standalone recognition](https://github.com/p-yashavanth/asl-sr/blob/main/predicate.py): `predicate.py`

### Model training

- **Labeled dataset**
- [Landmark augmentation](https://github.com/p-yashavanth/asl-sr/blob/main/train.py): `train.py`
- [Classifier training](https://github.com/p-yashavanth/asl-sr/blob/main/train.py): `train.py`
- [Saved classifier](https://github.com/p-yashavanth/asl-sr/blob/main/gesture_model.zip): `gesture_model.zip`
- [Saved labels](https://github.com/p-yashavanth/asl-sr/blob/main/labels.pkl): `labels.pkl`

### Shared components

- [Landmark normalization](https://github.com/p-yashavanth/asl-sr/blob/main/normalize_utils.py): `normalize_utils.py`

### Other components

- **Web user**
- **Training operator**
- **MediaPipe**
- **Webcam**
- **Browser**
- **Speech engine**

## Connections

- Web user → Browser: uses (evidence: `README.md`)
- Browser → Web interface: requests routes (evidence: `app.py`)
- Web interface → Webcam capture: streams frames (evidence: `app.py`)
- Webcam → Webcam capture: provides video (evidence: `app.py`)
- Webcam capture → Hand tracking: processes frames (evidence: `app.py`)
- Hand tracking → MediaPipe: detects landmarks (evidence: `app.py`)
- Web interface → Gesture classification: predicts gestures (evidence: `app.py`)
- Gesture classification → Landmark normalization: normalizes landmarks (evidence: `app.py`)
- Landmark normalization → Gesture classification: returns features (evidence: `app.py`)
- Gesture classification → Sentence composition: commits predictions (evidence: `app.py`)
- Sentence composition → Web interface: serves state (evidence: `app.py`)
- Web interface → Browser: returns stream and state (evidence: `app.py`)
- Web interface → Text-to-speech: speaks request (evidence: `app.py`)
- Text-to-speech → Speech engine: uses engine (evidence: `app.py`)
- Training operator → Classifier training: runs training (evidence: `train.py`)
- Labeled dataset → Classifier training: supplies labeled rows (evidence: `train.py`)
- Classifier training → Landmark augmentation: augments samples (evidence: `train.py`)
- Classifier training → Landmark normalization: normalizes samples (evidence: `train.py`)
- Classifier training → Saved classifier: saves classifier (evidence: `train.py`)
- Classifier training → Saved labels: saves classes (evidence: `train.py`)
- Standalone recognition → Webcam: captures video (evidence: `predicate.py`)
- Standalone recognition → MediaPipe: tracks hands (evidence: `predicate.py`)
- Standalone recognition → Landmark normalization: normalizes landmarks (evidence: `predicate.py`)
- Standalone recognition → Saved classifier: loads classifier
- Standalone recognition → Saved labels: loads labels
- Web interface → Saved classifier: loads classifier
- Web interface → Saved labels: loads labels
- Web interface → Standalone recognition: alternative interface
