# vishnu190806/sign-language-translate architecture

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

- Interactive diagram: https://gitdiagram.com/vishnu190806/sign-language-translate
- Repository: https://github.com/vishnu190806/sign-language-translate

## Overview

This is a local, webcam-based Indian Sign Language recognizer for isolated signs, with English sentence assembly and offline speech. Its principal runtime path captures frames, extracts and smooths landmarks, buffers a temporal sequence, recognizes signs, gates stable words, assembles and polishes a sentence, then synthesizes and plays speech. Training and dataset preparation form a separate supporting branch. The README documents the end-to-end path; sampled source and the index confirm several implementations and calls, but not every runtime detail.

Main entry points: [`src/models/htma.py`](https://github.com/vishnu190806/sign-language-translate/blob/main/src/models/htma.py) (HTMA classifier), [`src/text/polish.py`](https://github.com/vishnu190806/sign-language-translate/blob/main/src/text/polish.py) (Sentence polish), [`src/tts/factory.py`](https://github.com/vishnu190806/sign-language-translate/blob/main/src/tts/factory.py) (Speech engine factory), [`src/tts/playback.py`](https://github.com/vishnu190806/sign-language-translate/blob/main/src/tts/playback.py) (Audio playback queue)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_capture["Capture and features"]
  node_camera["Threaded camera<br/>[camera.py]"]
  node_extractor["Landmark extractor<br/>[extractor.py]"]
  node_smooth["Feature smoothing<br/>[smooth.py]"]
end

subgraph group_recognition["Recognition"]
  node_buffer[("Frame buffer<br/>[buffer.py]")]
  node_model["HTMA classifier<br/>[htma.py]"]
  node_builder["Model builder<br/>[builder.py]"]
  node_routing["Multi-source routing<br/>[routing.py]"]
  node_gate["Stability gate<br/>[gate.py]"]
end

subgraph group_language["Sentence and speech"]
  node_sentence["Sentence assembler<br/>[sentence.py]"]
  node_polish["Sentence polish<br/>[polish.py]"]
  node_rules["Gloss rendering rules<br/>[rules.py]"]
  node_tts_factory["Speech engine factory<br/>[factory.py]"]
  node_kokoro["Kokoro engine<br/>[kokoro_engine.py]"]
  node_piper["Piper engine<br/>[piper_engine.py]"]
  node_playback["Audio playback queue<br/>[playback.py]"]
end

subgraph group_training["Training and data"]
  node_dataset[("Landmark dataset<br/>[dataset.py]")]
  node_registry["Dataset registry<br/>[registry.py]"]
  node_augmentation["Augmentation pipeline"]
  node_trainer["Model trainer<br/>[trainer.py]"]
end

node_webcam(("Webcam"))
node_user(("User"))

node_webcam -->|"supplies frames"| node_camera
node_camera -->|"provides frames"| node_extractor
node_extractor -->|"builds features"| node_smooth
node_smooth -->|"smooths features"| node_buffer
node_buffer -->|"buffers sequences"| node_model
node_builder -->|"constructs"| node_model
node_model -->|"predicts signs"| node_gate
node_gate -->|"emits words"| node_sentence
node_sentence -->|"polishes draft"| node_polish
node_polish -->|"uses rules"| node_rules
node_polish -.->|"provides text"| node_tts_factory
node_tts_factory -->|"creates engine"| node_kokoro
node_tts_factory -->|"creates engine"| node_piper
node_kokoro -.->|"provides audio"| node_playback
node_piper -.->|"provides audio"| node_playback
node_playback -->|"plays speech"| node_user
node_dataset -->|"augments samples"| node_augmentation
node_trainer -->|"loads batches"| node_dataset
node_trainer -->|"builds model"| node_builder
node_model -.->|"supports source prediction"| node_routing

click node_camera "https://github.com/vishnu190806/sign-language-translate/blob/main/src/app/camera.py"
click node_extractor "https://github.com/vishnu190806/sign-language-translate/blob/main/src/features/extractor.py"
click node_smooth "https://github.com/vishnu190806/sign-language-translate/blob/main/src/features/smooth.py"
click node_buffer "https://github.com/vishnu190806/sign-language-translate/blob/main/src/infer/buffer.py"
click node_model "https://github.com/vishnu190806/sign-language-translate/blob/main/src/models/htma.py"
click node_builder "https://github.com/vishnu190806/sign-language-translate/blob/main/src/models/builder.py"
click node_routing "https://github.com/vishnu190806/sign-language-translate/blob/main/src/infer/routing.py"
click node_gate "https://github.com/vishnu190806/sign-language-translate/blob/main/src/infer/gate.py"
click node_sentence "https://github.com/vishnu190806/sign-language-translate/blob/main/src/infer/sentence.py"
click node_polish "https://github.com/vishnu190806/sign-language-translate/blob/main/src/text/polish.py"
click node_rules "https://github.com/vishnu190806/sign-language-translate/blob/main/src/text/rules.py"
click node_tts_factory "https://github.com/vishnu190806/sign-language-translate/blob/main/src/tts/factory.py"
click node_kokoro "https://github.com/vishnu190806/sign-language-translate/blob/main/src/tts/kokoro_engine.py"
click node_piper "https://github.com/vishnu190806/sign-language-translate/blob/main/src/tts/piper_engine.py"
click node_playback "https://github.com/vishnu190806/sign-language-translate/blob/main/src/tts/playback.py"
click node_dataset "https://github.com/vishnu190806/sign-language-translate/blob/main/src/data/dataset.py"
click node_registry "https://github.com/vishnu190806/sign-language-translate/blob/main/src/data/registry.py"
click node_augmentation "https://github.com/vishnu190806/sign-language-translate/blob/main/src/features/augment_pipeline.py"
click node_trainer "https://github.com/vishnu190806/sign-language-translate/blob/main/src/train/trainer.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_camera,node_extractor,node_smooth,node_user toneBlue
class node_buffer,node_model,node_builder,node_routing,node_gate toneAmber
class node_sentence,node_polish,node_rules,node_tts_factory,node_kokoro,node_piper,node_playback toneMint
class node_dataset,node_registry,node_augmentation,node_trainer toneRose
class node_webcam toneIndigo
```

## Components

### Capture and features

- [Threaded camera](https://github.com/vishnu190806/sign-language-translate/blob/main/src/app/camera.py): `src/app/camera.py`
- [Landmark extractor](https://github.com/vishnu190806/sign-language-translate/blob/main/src/features/extractor.py): `src/features/extractor.py`
- [Feature smoothing](https://github.com/vishnu190806/sign-language-translate/blob/main/src/features/smooth.py): `src/features/smooth.py`

### Recognition

- [Frame buffer](https://github.com/vishnu190806/sign-language-translate/blob/main/src/infer/buffer.py): `src/infer/buffer.py`
- [HTMA classifier](https://github.com/vishnu190806/sign-language-translate/blob/main/src/models/htma.py): `src/models/htma.py`
- [Model builder](https://github.com/vishnu190806/sign-language-translate/blob/main/src/models/builder.py): `src/models/builder.py`
- [Multi-source routing](https://github.com/vishnu190806/sign-language-translate/blob/main/src/infer/routing.py): `src/infer/routing.py`
- [Stability gate](https://github.com/vishnu190806/sign-language-translate/blob/main/src/infer/gate.py): `src/infer/gate.py`

### Sentence and speech

- [Sentence assembler](https://github.com/vishnu190806/sign-language-translate/blob/main/src/infer/sentence.py): `src/infer/sentence.py`
- [Sentence polish](https://github.com/vishnu190806/sign-language-translate/blob/main/src/text/polish.py): `src/text/polish.py`
- [Gloss rendering rules](https://github.com/vishnu190806/sign-language-translate/blob/main/src/text/rules.py): `src/text/rules.py`
- [Speech engine factory](https://github.com/vishnu190806/sign-language-translate/blob/main/src/tts/factory.py): `src/tts/factory.py`
- [Kokoro engine](https://github.com/vishnu190806/sign-language-translate/blob/main/src/tts/kokoro_engine.py): `src/tts/kokoro_engine.py`
- [Piper engine](https://github.com/vishnu190806/sign-language-translate/blob/main/src/tts/piper_engine.py): `src/tts/piper_engine.py`
- [Audio playback queue](https://github.com/vishnu190806/sign-language-translate/blob/main/src/tts/playback.py): `src/tts/playback.py`

### Training and data

- [Landmark dataset](https://github.com/vishnu190806/sign-language-translate/blob/main/src/data/dataset.py): `src/data/dataset.py`
- [Dataset registry](https://github.com/vishnu190806/sign-language-translate/blob/main/src/data/registry.py): `src/data/registry.py`
- [Augmentation pipeline](https://github.com/vishnu190806/sign-language-translate/blob/main/src/features/augment_pipeline.py): `src/features/augment_pipeline.py`
- [Model trainer](https://github.com/vishnu190806/sign-language-translate/blob/main/src/train/trainer.py): `src/train/trainer.py`

### Other components

- **Webcam**
- **User**

## Connections

- Webcam → Threaded camera: supplies frames
- Threaded camera → Landmark extractor: provides frames
- Landmark extractor → Feature smoothing: builds features
- Feature smoothing → Frame buffer: smooths features
- Frame buffer → HTMA classifier: buffers sequences
- Model builder → HTMA classifier: constructs (evidence: `src/models/builder.py`)
- HTMA classifier → Stability gate: predicts signs
- Stability gate → Sentence assembler: emits words
- Sentence assembler → Sentence polish: polishes draft
- Sentence polish → Gloss rendering rules: uses rules (evidence: `src/text/polish.py`)
- Sentence polish → Speech engine factory: provides text
- Speech engine factory → Kokoro engine: creates engine (evidence: `src/tts/factory.py`)
- Speech engine factory → Piper engine: creates engine (evidence: `src/tts/factory.py`)
- Kokoro engine → Audio playback queue: provides audio
- Piper engine → Audio playback queue: provides audio
- Audio playback queue → User: plays speech
- Landmark dataset → Augmentation pipeline: augments samples (evidence: `src/data/dataset.py`)
- Model trainer → Landmark dataset: loads batches (evidence: `src/train/trainer.py`)
- Model trainer → Model builder: builds model (evidence: `src/train/trainer.py`)
- HTMA classifier → Multi-source routing: supports source prediction
