# petuuu/sign-language-recognizer architecture

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

- Interactive diagram: https://gitdiagram.com/petuuu/sign-language-recognizer
- Repository: https://github.com/petuuu/sign-language-recognizer

## Overview

This is a Finnish/ASL static sign-letter recognition project. Its user-facing entry point selects image-to-landmark export, annotated image detection, or live video detection; a separate model-training script reads exported landmarks and trains an MLP. The README describes recognition, but the sampled interactive path does not connect detected landmarks to model inference, and the model code shows training rather than an end-user prediction flow. The graph reflects those evidenced paths and omits unshown runtime links.

Main entry points: [`src/image_pipeline.py`](https://github.com/petuuu/sign-language-recognizer/blob/main/src/image_pipeline.py) (CSV export), [`src/model/train.py`](https://github.com/petuuu/sign-language-recognizer/blob/main/src/model/train.py) (Training loop), [`src/main.py`](https://github.com/petuuu/sign-language-recognizer/blob/main/src/main.py) (Mode selection), [`src/model/helpers.py`](https://github.com/petuuu/sign-language-recognizer/blob/main/src/model/helpers.py) (Dataset split)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interaction["Detection workflows"]
  node_entry["Mode selection<br/>[main.py]"]
  node_export["CSV export<br/>[image_pipeline.py]"]
  node_image["Image detection<br/>[image_pipeline.py]"]
  node_video["Video detection<br/>[image_pipeline.py]"]
end

subgraph group_features["Landmark processing"]
  node_hand_detector["Hand detector"]
  node_normalize["Landmark normalization<br/>[image_pipeline.py]"]
  node_annotate["Landmark annotation<br/>[image_pipeline.py]"]
end

subgraph group_learning["Model training"]
  node_csv["Landmark CSV"]
  node_dataset["Dataset split<br/>[helpers.py]"]
  node_trainer["Training loop<br/>[train.py]"]
  node_mlp["MLP architecture<br/>[architecture.py]"]
  node_math["Model helpers<br/>[helpers.py]"]
  node_plots["Training plots<br/>[train.py]"]
end

node_user(("User"))
node_image_source["Image files"]
node_camera["Camera"]

node_user -->|"chooses mode"| node_entry
node_entry -->|"runs export"| node_export
node_entry -->|"runs detection"| node_image
node_entry -->|"runs detection"| node_video
node_export -->|"reads images"| node_image_source
node_image -->|"reads images"| node_image_source
node_video -->|"captures frames"| node_camera
node_export -->|"detects hands"| node_hand_detector
node_image -->|"detects hands"| node_hand_detector
node_video -->|"detects hands"| node_hand_detector
node_export -->|"normalizes points"| node_normalize
node_export -->|"writes landmarks"| node_csv
node_image -->|"draws landmarks"| node_annotate
node_video -->|"draws landmarks"| node_annotate
node_trainer -->|"loads and splits"| node_dataset
node_dataset -->|"reads rows"| node_csv
node_trainer -->|"trains model"| node_mlp
node_trainer -->|"uses loss and metrics"| node_math
node_mlp -->|"uses activations"| node_math
node_trainer -->|"saves metrics"| node_plots

click node_entry "https://github.com/petuuu/sign-language-recognizer/blob/main/src/main.py"
click node_export "https://github.com/petuuu/sign-language-recognizer/blob/main/src/image_pipeline.py"
click node_image "https://github.com/petuuu/sign-language-recognizer/blob/main/src/image_pipeline.py"
click node_video "https://github.com/petuuu/sign-language-recognizer/blob/main/src/image_pipeline.py"
click node_normalize "https://github.com/petuuu/sign-language-recognizer/blob/main/src/image_pipeline.py"
click node_annotate "https://github.com/petuuu/sign-language-recognizer/blob/main/src/image_pipeline.py"
click node_dataset "https://github.com/petuuu/sign-language-recognizer/blob/main/src/model/helpers.py"
click node_trainer "https://github.com/petuuu/sign-language-recognizer/blob/main/src/model/train.py"
click node_mlp "https://github.com/petuuu/sign-language-recognizer/blob/main/src/model/architecture.py"
click node_math "https://github.com/petuuu/sign-language-recognizer/blob/main/src/model/helpers.py"
click node_plots "https://github.com/petuuu/sign-language-recognizer/blob/main/src/model/train.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_entry,node_export,node_image,node_video,node_user toneBlue
class node_hand_detector,node_normalize,node_annotate toneAmber
class node_csv,node_dataset,node_trainer,node_mlp,node_math,node_plots toneMint
class node_image_source,node_camera toneIndigo
```

## Components

### Detection workflows

- [Mode selection](https://github.com/petuuu/sign-language-recognizer/blob/main/src/main.py): `src/main.py`
- [CSV export](https://github.com/petuuu/sign-language-recognizer/blob/main/src/image_pipeline.py): `src/image_pipeline.py`
- [Image detection](https://github.com/petuuu/sign-language-recognizer/blob/main/src/image_pipeline.py): `src/image_pipeline.py`
- [Video detection](https://github.com/petuuu/sign-language-recognizer/blob/main/src/image_pipeline.py): `src/image_pipeline.py`

### Landmark processing

- **Hand detector**
- [Landmark normalization](https://github.com/petuuu/sign-language-recognizer/blob/main/src/image_pipeline.py): `src/image_pipeline.py`
- [Landmark annotation](https://github.com/petuuu/sign-language-recognizer/blob/main/src/image_pipeline.py): `src/image_pipeline.py`

### Model training

- **Landmark CSV**
- [Dataset split](https://github.com/petuuu/sign-language-recognizer/blob/main/src/model/helpers.py): `src/model/helpers.py`
- [Training loop](https://github.com/petuuu/sign-language-recognizer/blob/main/src/model/train.py): `src/model/train.py`
- [MLP architecture](https://github.com/petuuu/sign-language-recognizer/blob/main/src/model/architecture.py): `src/model/architecture.py`
- [Model helpers](https://github.com/petuuu/sign-language-recognizer/blob/main/src/model/helpers.py): `src/model/helpers.py`
- [Training plots](https://github.com/petuuu/sign-language-recognizer/blob/main/src/model/train.py): `src/model/train.py`

### Other components

- **User**
- **Image files**
- **Camera**

## Connections

- User → Mode selection: chooses mode (evidence: `src/main.py`)
- Mode selection → CSV export: runs export (evidence: `src/main.py`)
- Mode selection → Image detection: runs detection (evidence: `src/main.py`)
- Mode selection → Video detection: runs detection (evidence: `src/main.py`)
- CSV export → Image files: reads images (evidence: `src/image_pipeline.py`)
- Image detection → Image files: reads images (evidence: `src/image_pipeline.py`)
- Video detection → Camera: captures frames (evidence: `src/image_pipeline.py`)
- CSV export → Hand detector: detects hands (evidence: `src/image_pipeline.py`)
- Image detection → Hand detector: detects hands (evidence: `src/image_pipeline.py`)
- Video detection → Hand detector: detects hands (evidence: `src/image_pipeline.py`)
- CSV export → Landmark normalization: normalizes points (evidence: `src/image_pipeline.py`)
- CSV export → Landmark CSV: writes landmarks (evidence: `src/image_pipeline.py`)
- Image detection → Landmark annotation: draws landmarks (evidence: `src/image_pipeline.py`)
- Video detection → Landmark annotation: draws landmarks (evidence: `src/image_pipeline.py`)
- Training loop → Dataset split: loads and splits (evidence: `src/model/train.py`)
- Dataset split → Landmark CSV: reads rows (evidence: `src/model/helpers.py`)
- Training loop → MLP architecture: trains model (evidence: `src/model/train.py`)
- Training loop → Model helpers: uses loss and metrics (evidence: `src/model/train.py`)
- MLP architecture → Model helpers: uses activations (evidence: `src/model/architecture.py`)
- Training loop → Training plots: saves metrics (evidence: `src/model/train.py`)
