# luvk1412/sign-language-to-text architecture

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

- Interactive diagram: https://gitdiagram.com/luvk1412/sign-language-to-text
- Repository: https://github.com/luvk1412/sign-language-to-text

## Overview

This repository is a webcam-based American Sign Language fingerspelling-to-text application, with accompanying data collection, image preparation, and CNN training scripts. The main user workflow captures hand images, preprocesses frames, predicts letters, assembles words and sentences, and offers Hunspell spelling suggestions through a Tkinter interface. Training and preprocessing are distinct supporting stages. Runtime interactions are based on the shown excerpts and README; the excerpts do not establish how collected data feeds preprocessing, and the README does not describe the additional specialized models.

Main entry points: [`app.py`](https://github.com/luvk1412/sign-language-to-text/blob/master/app.py) (Live application), [`preprocessing.py`](https://github.com/luvk1412/sign-language-to-text/blob/master/preprocessing.py) (Dataset preprocessor), [`collect-data.py`](https://github.com/luvk1412/sign-language-to-text/blob/master/collect-data.py) (Image collector), [`train.py`](https://github.com/luvk1412/sign-language-to-text/blob/master/train.py) (CNN trainer)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_data["Dataset preparation"]
  node_collector["Image collector<br/>[collect-data.py]"]
  node_rawdata[("Captured images")]
  node_preparer["Dataset preprocessor<br/>[preprocessing.py]"]
  node_imagefunc["Image thresholding"]
  node_traindata[("Training data")]
end

subgraph group_learning["Model training"]
  node_trainer["CNN trainer<br/>[train.py]"]
  node_models[("CNN model files<br/>[model-bw.h5]")]
end

subgraph group_runtime["Live translation"]
  node_application["Live application<br/>[app.py]"]
  node_frameprep["Frame preprocessing<br/>[app.py]"]
  node_classifier["Letter prediction<br/>[app.py]"]
  node_textbuild["Word and sentence<br/>[app.py]"]
  node_display["Translation display<br/>[app.py]"]
end

subgraph group_text["Text assistance"]
  node_spellcheck["Spelling suggestions<br/>[app.py]"]
end

node_user(("Signer"))
node_camera(("Webcam"))
node_hunspell[("Hunspell dictionary")]

node_user -->|"signs to"| node_camera
node_camera -->|"provides frames"| node_collector
node_collector -->|"saves images"| node_rawdata
node_rawdata -.->|"reads image folders"| node_preparer
node_preparer -->|"calls"| node_imagefunc
node_preparer -->|"writes images"| node_traindata
node_traindata -->|"loads directories"| node_trainer
node_trainer -->|"saves weights"| node_models
node_user -->|"uses"| node_application
node_camera -->|"captures frames"| node_application
node_application -->|"processes frames"| node_frameprep
node_frameprep -->|"passes threshold image"| node_classifier
node_models -->|"loads weights"| node_application
node_application -->|"calls prediction"| node_classifier
node_classifier -->|"updates letters"| node_textbuild
node_application -->|"requests suggestions"| node_spellcheck
node_spellcheck -->|"queries dictionary"| node_hunspell
node_application -->|"updates interface"| node_display
node_textbuild -->|"shows text"| node_display

click node_collector "https://github.com/luvk1412/sign-language-to-text/blob/master/collect-data.py"
click node_preparer "https://github.com/luvk1412/sign-language-to-text/blob/master/preprocessing.py"
click node_imagefunc "https://github.com/luvk1412/sign-language-to-text/blob/master/image_processing.py"
click node_trainer "https://github.com/luvk1412/sign-language-to-text/blob/master/train.py"
click node_models "https://github.com/luvk1412/sign-language-to-text/blob/master/model/model-bw.h5"
click node_application "https://github.com/luvk1412/sign-language-to-text/blob/master/app.py"
click node_frameprep "https://github.com/luvk1412/sign-language-to-text/blob/master/app.py"
click node_classifier "https://github.com/luvk1412/sign-language-to-text/blob/master/app.py"
click node_textbuild "https://github.com/luvk1412/sign-language-to-text/blob/master/app.py"
click node_spellcheck "https://github.com/luvk1412/sign-language-to-text/blob/master/app.py"
click node_display "https://github.com/luvk1412/sign-language-to-text/blob/master/app.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_rawdata,node_preparer,node_imagefunc,node_traindata toneBlue
class node_trainer,node_models,node_hunspell toneAmber
class node_application,node_frameprep,node_classifier,node_textbuild,node_display toneMint
class node_spellcheck toneRose
class node_user,node_camera toneIndigo
```

## Components

### Dataset preparation

- [Image collector](https://github.com/luvk1412/sign-language-to-text/blob/master/collect-data.py): `collect-data.py`
- **Captured images**
- [Dataset preprocessor](https://github.com/luvk1412/sign-language-to-text/blob/master/preprocessing.py): `preprocessing.py`
- [Image thresholding](https://github.com/luvk1412/sign-language-to-text/blob/master/image_processing.py): `image_processing.py`
- **Training data**

### Model training

- [CNN trainer](https://github.com/luvk1412/sign-language-to-text/blob/master/train.py): `train.py`
- [CNN model files](https://github.com/luvk1412/sign-language-to-text/blob/master/model/model-bw.h5): `model/model-bw.h5`

### Live translation

- [Live application](https://github.com/luvk1412/sign-language-to-text/blob/master/app.py): `app.py`
- [Frame preprocessing](https://github.com/luvk1412/sign-language-to-text/blob/master/app.py): `app.py`
- [Letter prediction](https://github.com/luvk1412/sign-language-to-text/blob/master/app.py): `app.py`
- [Word and sentence](https://github.com/luvk1412/sign-language-to-text/blob/master/app.py): `app.py`
- [Translation display](https://github.com/luvk1412/sign-language-to-text/blob/master/app.py): `app.py`

### Text assistance

- [Spelling suggestions](https://github.com/luvk1412/sign-language-to-text/blob/master/app.py): `app.py`

### Other components

- **Signer**
- **Webcam**
- **Hunspell dictionary**

## Connections

- Signer → Webcam: signs to (evidence: `README.md`)
- Webcam → Image collector: provides frames (evidence: `collect-data.py`)
- Image collector → Captured images: saves images (evidence: `collect-data.py`)
- Captured images → Dataset preprocessor: reads image folders
- Dataset preprocessor → Image thresholding: calls (evidence: `preprocessing.py`)
- Dataset preprocessor → Training data: writes images (evidence: `preprocessing.py`)
- Training data → CNN trainer: loads directories (evidence: `train.py`)
- CNN trainer → CNN model files: saves weights (evidence: `train.py`)
- Signer → Live application: uses (evidence: `README.md`)
- Webcam → Live application: captures frames (evidence: `app.py`)
- Live application → Frame preprocessing: processes frames (evidence: `app.py`)
- Frame preprocessing → Letter prediction: passes threshold image (evidence: `app.py`)
- CNN model files → Live application: loads weights (evidence: `app.py`)
- Live application → Letter prediction: calls prediction (evidence: `app.py`)
- Letter prediction → Word and sentence: updates letters (evidence: `app.py`)
- Live application → Spelling suggestions: requests suggestions (evidence: `app.py`)
- Spelling suggestions → Hunspell dictionary: queries dictionary (evidence: `app.py`)
- Live application → Translation display: updates interface (evidence: `app.py`)
- Word and sentence → Translation display: shows text (evidence: `app.py`)
