# harsh3338m/anvaya architecture

> Architecture diagram of the GitHub repository harsh3338m/anvaya, 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/harsh3338m/anvaya
- Repository: https://github.com/harsh3338m/anvaya

## Overview

Anvaya is a browser-based, offline-capable sign-recognition app, supported by an offline data-collection and model-training workflow. The main user path is webcam input through hand tracking and sequence inference to recognized text, session history, and optional speech. Runtime details are shown in sampled source; the page structure and training handoffs are supported by the README. Some subsystem links are documented rather than verified in unsampled page files.

Main entry points: [`web_app/app.js`](https://github.com/harsh3338m/anvaya/blob/main/web_app/app.js) (Inference and debounce), [`data_collection/capture_sequences.py`](https://github.com/harsh3338m/anvaya/blob/main/data_collection/capture_sequences.py) (Sequence capture), [`web_app/index.html`](https://github.com/harsh3338m/anvaya/blob/main/web_app/index.html) (Landing page), [`web_app/studio.html`](https://github.com/harsh3338m/anvaya/blob/main/web_app/studio.html) (Gesture Studio)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_pages["Studio pages"]
  node_landing["Landing page<br/>[index.html]"]
  node_studio["Gesture Studio<br/>[studio.html]"]
end

subgraph group_runtime["Browser recognition"]
  node_camera["Camera capture<br/>[app.js]"]
  node_tracking["Hand tracking<br/>[app.js]"]
  node_features["Frame vectors<br/>[app.js]"]
  node_recognition["Inference and debounce<br/>[app.js]"]
  node_model["Browser model"]
  node_translation["Translation text<br/>[app.js]"]
  node_history[("Session history<br/>[session-log.js]")]
  node_controls["Speech and controls<br/>[control.js]"]
end

subgraph group_training["Offline model workflow"]
  node_preprocess["Dataset preprocessing<br/>[preprocess.py]"]
  node_train["CNN training<br/>[train_cnn.py]"]
  node_export["TensorFlow.js export<br/>[convert_tfjs.py]"]
end

subgraph group_collection["Data collection"]
  node_capture["Sequence capture"]
  node_normalizer["Training normalization<br/>[normalizer.py]"]
end

node_user(("Signer"))
node_speech["Web Speech API"]

node_user -->|"opens"| node_landing
node_landing -->|"launches"| node_studio
node_user -->|"signs to"| node_camera
node_studio -->|"hosts controls"| node_camera
node_camera -->|"sends frames"| node_tracking
node_tracking -->|"provides landmarks"| node_features
node_features -->|"builds sequences"| node_recognition
node_recognition -->|"runs inference"| node_model
node_recognition -->|"emits confirmed signs"| node_translation
node_recognition -->|"records signs"| node_history
node_recognition -->|"requests speech"| node_controls
node_controls -->|"speaks with"| node_speech
node_user -->|"records examples"| node_capture
node_capture -->|"calls"| node_normalizer
node_capture -->|"saves sequences for"| node_preprocess
node_preprocess -->|"writes training arrays for"| node_train
node_train -->|"saves model for"| node_export
node_export -->|"exports browser files to"| node_model

click node_landing "https://github.com/harsh3338m/anvaya/blob/main/web_app/index.html"
click node_studio "https://github.com/harsh3338m/anvaya/blob/main/web_app/studio.html"
click node_camera "https://github.com/harsh3338m/anvaya/blob/main/web_app/app.js"
click node_tracking "https://github.com/harsh3338m/anvaya/blob/main/web_app/app.js"
click node_features "https://github.com/harsh3338m/anvaya/blob/main/web_app/app.js"
click node_recognition "https://github.com/harsh3338m/anvaya/blob/main/web_app/app.js"
click node_model "https://github.com/harsh3338m/anvaya/tree/main/web_app/model"
click node_translation "https://github.com/harsh3338m/anvaya/blob/main/web_app/app.js"
click node_history "https://github.com/harsh3338m/anvaya/blob/main/web_app/session-log.js"
click node_controls "https://github.com/harsh3338m/anvaya/blob/main/web_app/control.js"
click node_capture "https://github.com/harsh3338m/anvaya/blob/main/data_collection/capture_sequences.py"
click node_normalizer "https://github.com/harsh3338m/anvaya/blob/main/data_collection/normalizer.py"
click node_preprocess "https://github.com/harsh3338m/anvaya/blob/main/model_training/preprocess.py"
click node_train "https://github.com/harsh3338m/anvaya/blob/main/model_training/train_cnn.py"
click node_export "https://github.com/harsh3338m/anvaya/blob/main/model_training/convert_tfjs.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_landing,node_studio toneBlue
class node_camera,node_tracking,node_features,node_recognition,node_model,node_translation,node_history,node_controls toneAmber
class node_preprocess,node_train,node_export,node_speech toneMint
class node_capture,node_normalizer toneRose
class node_user toneIndigo
```

## Components

### Studio pages

- [Landing page](https://github.com/harsh3338m/anvaya/blob/main/web_app/index.html): `web_app/index.html`
- [Gesture Studio](https://github.com/harsh3338m/anvaya/blob/main/web_app/studio.html): `web_app/studio.html`

### Browser recognition

- [Camera capture](https://github.com/harsh3338m/anvaya/blob/main/web_app/app.js): `web_app/app.js`
- [Hand tracking](https://github.com/harsh3338m/anvaya/blob/main/web_app/app.js): `web_app/app.js`
- [Frame vectors](https://github.com/harsh3338m/anvaya/blob/main/web_app/app.js): `web_app/app.js`
- [Inference and debounce](https://github.com/harsh3338m/anvaya/blob/main/web_app/app.js): `web_app/app.js`
- [Browser model](https://github.com/harsh3338m/anvaya/tree/main/web_app/model): `web_app/model`
- [Translation text](https://github.com/harsh3338m/anvaya/blob/main/web_app/app.js): `web_app/app.js`
- [Session history](https://github.com/harsh3338m/anvaya/blob/main/web_app/session-log.js): `web_app/session-log.js`
- [Speech and controls](https://github.com/harsh3338m/anvaya/blob/main/web_app/control.js): `web_app/control.js`

### Offline model workflow

- [Dataset preprocessing](https://github.com/harsh3338m/anvaya/blob/main/model_training/preprocess.py): `model_training/preprocess.py`
- [CNN training](https://github.com/harsh3338m/anvaya/blob/main/model_training/train_cnn.py): `model_training/train_cnn.py`
- [TensorFlow.js export](https://github.com/harsh3338m/anvaya/blob/main/model_training/convert_tfjs.py): `model_training/convert_tfjs.py`

### Data collection

- [Sequence capture](https://github.com/harsh3338m/anvaya/blob/main/data_collection/capture_sequences.py): `data_collection/capture_sequences.py`
- [Training normalization](https://github.com/harsh3338m/anvaya/blob/main/data_collection/normalizer.py): `data_collection/normalizer.py`

### Other components

- **Signer**
- **Web Speech API**

## Connections

- Signer → Landing page: opens (evidence: `README.md`)
- Landing page → Gesture Studio: launches (evidence: `README.md`)
- Signer → Camera capture: signs to (evidence: `README.md`)
- Gesture Studio → Camera capture: hosts controls (evidence: `README.md`)
- Camera capture → Hand tracking: sends frames (evidence: `web_app/app.js`)
- Hand tracking → Frame vectors: provides landmarks (evidence: `web_app/app.js`)
- Frame vectors → Inference and debounce: builds sequences (evidence: `web_app/app.js`)
- Inference and debounce → Browser model: runs inference (evidence: `web_app/app.js`)
- Inference and debounce → Translation text: emits confirmed signs (evidence: `web_app/app.js`)
- Inference and debounce → Session history: records signs (evidence: `web_app/app.js`)
- Inference and debounce → Speech and controls: requests speech (evidence: `web_app/app.js`)
- Speech and controls → Web Speech API: speaks with (evidence: `web_app/control.js`)
- Signer → Sequence capture: records examples (evidence: `README.md`)
- Sequence capture → Training normalization: calls (evidence: `data_collection/capture_sequences.py`)
- Sequence capture → Dataset preprocessing: saves sequences for (evidence: `README.md`)
- Dataset preprocessing → CNN training: writes training arrays for (evidence: `model_training/preprocess.py`)
- CNN training → TensorFlow.js export: saves model for (evidence: `model_training/train_cnn.py`)
- TensorFlow.js export → Browser model: exports browser files to (evidence: `model_training/convert_tfjs.py`)
