# iamafrar/ai-based-sinhala-sign-language-translator architecture

> Architecture diagram of the GitHub repository iamafrar/ai-based-sinhala-sign-language-translator, 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/iamafrar/ai-based-sinhala-sign-language-translator
- Repository: https://github.com/iamafrar/ai-based-sinhala-sign-language-translator

## Overview

SSLR is a real-time Sinhala Sign Language recognizer: the user starts a webcam, the frontend sends frames to FastAPI, and the backend accumulates a sequence, extracts pose landmarks, scales the features, predicts a word, and returns it for display. The README also documents a separate dataset-preparation, model-training, and evaluation workflow in the notebook. Those notebook stages are included as documented capabilities; their internal implementation and connections to deployed assets were not inspected.

Main entry points: [`backend_fastapi.py`](https://github.com/iamafrar/ai-based-sinhala-sign-language-translator/blob/main/backend_fastapi.py) (FastAPI endpoints), [`frontend/app.js`](https://github.com/iamafrar/ai-based-sinhala-sign-language-translator/blob/main/frontend/app.js) (Camera capture), [`frontend/index.html`](https://github.com/iamafrar/ai-based-sinhala-sign-language-translator/blob/main/frontend/index.html) (Web interface), [`SSL_WORD_LEVEL_80_PLUS.ipynb`](https://github.com/iamafrar/ai-based-sinhala-sign-language-translator/blob/main/SSL_WORD_LEVEL_80_PLUS.ipynb) (Model training)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web client"]
  node_page["Web interface<br/>[index.html]"]
  node_camera["Camera capture<br/>[app.js]"]
  node_display["Prediction display<br/>[app.js]"]
end

subgraph group_serving["Prediction service"]
  node_api["FastAPI endpoints<br/>[backend_fastapi.py]"]
  node_decode["Frame decoding<br/>[backend_fastapi.py]"]
  node_landmarks["Pose landmarks<br/>[backend_fastapi.py]"]
  node_sequence["Sequence buffer<br/>[backend_fastapi.py]"]
  node_scaler["Feature scaling<br/>[backend_fastapi.py]"]
  node_model["BiLSTM attention<br/>[backend_fastapi.py]"]
  node_labels["Word decoding<br/>[backend_fastapi.py]"]
end

subgraph group_ml["Model development"]
  node_preprocess["Data preparation"]
  node_training["Model training"]
  node_evaluation["Model evaluation"]
end

node_user(("User"))
node_webcam["Webcam"]

node_user -->|"uses"| node_page
node_webcam -->|"provides frames"| node_camera
node_page -->|"hosts"| node_camera
node_camera -->|"posts frames"| node_api
node_camera -->|"resets sequence"| node_api
node_api -->|"decodes upload"| node_decode
node_decode -->|"extracts pose"| node_landmarks
node_api -->|"buffers features"| node_sequence
node_api -->|"scales sequence"| node_scaler
node_api -->|"predicts"| node_model
node_api -->|"decodes classes"| node_labels
node_api -->|"returns prediction"| node_display
node_preprocess -.->|"prepares data"| node_training
node_training -.->|"evaluates model"| node_evaluation

click node_page "https://github.com/iamafrar/ai-based-sinhala-sign-language-translator/blob/main/frontend/index.html"
click node_camera "https://github.com/iamafrar/ai-based-sinhala-sign-language-translator/blob/main/frontend/app.js"
click node_display "https://github.com/iamafrar/ai-based-sinhala-sign-language-translator/blob/main/frontend/app.js"
click node_api "https://github.com/iamafrar/ai-based-sinhala-sign-language-translator/blob/main/backend_fastapi.py"
click node_decode "https://github.com/iamafrar/ai-based-sinhala-sign-language-translator/blob/main/backend_fastapi.py"
click node_landmarks "https://github.com/iamafrar/ai-based-sinhala-sign-language-translator/blob/main/backend_fastapi.py"
click node_sequence "https://github.com/iamafrar/ai-based-sinhala-sign-language-translator/blob/main/backend_fastapi.py"
click node_scaler "https://github.com/iamafrar/ai-based-sinhala-sign-language-translator/blob/main/backend_fastapi.py"
click node_model "https://github.com/iamafrar/ai-based-sinhala-sign-language-translator/blob/main/backend_fastapi.py"
click node_labels "https://github.com/iamafrar/ai-based-sinhala-sign-language-translator/blob/main/backend_fastapi.py"
click node_preprocess "https://github.com/iamafrar/ai-based-sinhala-sign-language-translator/blob/main/SSL_WORD_LEVEL_80_PLUS.ipynb"
click node_training "https://github.com/iamafrar/ai-based-sinhala-sign-language-translator/blob/main/SSL_WORD_LEVEL_80_PLUS.ipynb"
click node_evaluation "https://github.com/iamafrar/ai-based-sinhala-sign-language-translator/blob/main/SSL_WORD_LEVEL_80_PLUS.ipynb"

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_page,node_camera,node_display,node_user toneBlue
class node_api,node_decode,node_landmarks,node_sequence,node_scaler,node_model,node_labels toneAmber
class node_preprocess,node_training,node_evaluation toneMint
class node_webcam toneIndigo
```

## Components

### Web client

- [Web interface](https://github.com/iamafrar/ai-based-sinhala-sign-language-translator/blob/main/frontend/index.html): `frontend/index.html`
- [Camera capture](https://github.com/iamafrar/ai-based-sinhala-sign-language-translator/blob/main/frontend/app.js): `frontend/app.js`
- [Prediction display](https://github.com/iamafrar/ai-based-sinhala-sign-language-translator/blob/main/frontend/app.js): `frontend/app.js`

### Prediction service

- [FastAPI endpoints](https://github.com/iamafrar/ai-based-sinhala-sign-language-translator/blob/main/backend_fastapi.py): `backend_fastapi.py`
- [Frame decoding](https://github.com/iamafrar/ai-based-sinhala-sign-language-translator/blob/main/backend_fastapi.py): `backend_fastapi.py`
- [Pose landmarks](https://github.com/iamafrar/ai-based-sinhala-sign-language-translator/blob/main/backend_fastapi.py): `backend_fastapi.py`
- [Sequence buffer](https://github.com/iamafrar/ai-based-sinhala-sign-language-translator/blob/main/backend_fastapi.py): `backend_fastapi.py`
- [Feature scaling](https://github.com/iamafrar/ai-based-sinhala-sign-language-translator/blob/main/backend_fastapi.py): `backend_fastapi.py`
- [BiLSTM attention](https://github.com/iamafrar/ai-based-sinhala-sign-language-translator/blob/main/backend_fastapi.py): `backend_fastapi.py`
- [Word decoding](https://github.com/iamafrar/ai-based-sinhala-sign-language-translator/blob/main/backend_fastapi.py): `backend_fastapi.py`

### Model development

- [Data preparation](https://github.com/iamafrar/ai-based-sinhala-sign-language-translator/blob/main/SSL_WORD_LEVEL_80_PLUS.ipynb): `SSL_WORD_LEVEL_80_PLUS.ipynb`
- [Model training](https://github.com/iamafrar/ai-based-sinhala-sign-language-translator/blob/main/SSL_WORD_LEVEL_80_PLUS.ipynb): `SSL_WORD_LEVEL_80_PLUS.ipynb`
- [Model evaluation](https://github.com/iamafrar/ai-based-sinhala-sign-language-translator/blob/main/SSL_WORD_LEVEL_80_PLUS.ipynb): `SSL_WORD_LEVEL_80_PLUS.ipynb`

### Other components

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

## Connections

- User → Web interface: uses (evidence: `README.md`)
- Webcam → Camera capture: provides frames (evidence: `README.md`)
- Web interface → Camera capture: hosts (evidence: `README.md`)
- Camera capture → FastAPI endpoints: posts frames (evidence: `frontend/app.js`)
- Camera capture → FastAPI endpoints: resets sequence (evidence: `frontend/app.js`)
- FastAPI endpoints → Frame decoding: decodes upload (evidence: `backend_fastapi.py`)
- Frame decoding → Pose landmarks: extracts pose (evidence: `backend_fastapi.py`)
- FastAPI endpoints → Sequence buffer: buffers features (evidence: `backend_fastapi.py`)
- FastAPI endpoints → Feature scaling: scales sequence (evidence: `backend_fastapi.py`)
- FastAPI endpoints → BiLSTM attention: predicts (evidence: `backend_fastapi.py`)
- FastAPI endpoints → Word decoding: decodes classes (evidence: `backend_fastapi.py`)
- FastAPI endpoints → Prediction display: returns prediction (evidence: `frontend/app.js`)
- Data preparation → Model training: prepares data (evidence: `README.md`)
- Model training → Model evaluation: evaluates model (evidence: `README.md`)
