# tuananhsr/vra architecture

> Architecture diagram of the GitHub repository tuananhsr/vra, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-25). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/tuananhsr/vra
- Repository: https://github.com/tuananhsr/vra

## Overview

SemiETS is a Vietnamese scene-text spotting system, with a browser demo for image inference and a training/evaluation codebase. The user workflow is to submit an image or select a sample, run the configured spotter, and inspect polygon detections and recognized text. Its model jointly handles text localization and recognition; its training path includes semi-supervised data preparation, optimization, checkpointing, and text evaluation. The tree and excerpts support these major stages, but README content and most wiring are unavailable; uncertain links are omitted.

Main entry points: [`semiets_vintext/adet/modeling/text_spotter.py`](https://github.com/tuananhsr/vra/blob/main/semiets_vintext/adet/modeling/text_spotter.py) (Text Spotter), [`semiets_vintext/tools/train_semi.py`](https://github.com/tuananhsr/vra/blob/main/semiets_vintext/tools/train_semi.py) (Semi Trainer), [`semiets_demo/static/js/app.js`](https://github.com/tuananhsr/vra/blob/main/semiets_demo/static/js/app.js) (Demo Client), [`semiets_demo/app.py`](https://github.com/tuananhsr/vra/blob/main/semiets_demo/app.py) (Demo Server)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_demo["Inference Demo"]
  node_browser["Demo Client<br/>[app.js]"]
  node_demo_api["Demo Server<br/>[app.py]"]
  node_predictor["Inference Adapter<br/>[predictor.py]"]
end

subgraph group_data_training["Data And Training"]
  node_train_input["Annotated Data"]
  node_text_datasets["Text Dataset Loading<br/>[text.py]"]
  node_semi_mapper["Semi-Supervised Mapping<br/>[dataset_mapper.py]"]
  node_semi_build["Semi Data Builder<br/>[semi_build.py]"]
  node_trainer["Semi Trainer<br/>[train_semi.py]"]
  node_checkpoint["Checkpoint Handling<br/>[adet_checkpoint.py]"]
end

subgraph group_spotting_model["Spotting Model"]
  node_spotter["Text Spotter<br/>[text_spotter.py]"]
  node_semi_spotter["Semi Spotter"]
  node_transformer["Deformable Transformer"]
  node_losses["Spotting Losses<br/>[losses.py]"]
end

subgraph group_evaluation["Evaluation"]
  node_evaluator["Text Evaluator"]
  node_eval_data["Evaluation Ground Truth"]
end

node_visitor(("Image User"))

node_visitor -->|"submits image"| node_browser
node_browser -->|"requests prediction"| node_demo_api
node_demo_api -->|"invokes inference"| node_predictor
node_predictor -->|"runs model"| node_spotter
node_spotter -->|"returns detections"| node_predictor
node_demo_api -->|"returns response"| node_browser
node_browser -->|"shows results"| node_visitor
node_train_input -->|"provides annotations"| node_text_datasets
node_text_datasets -->|"loads records"| node_semi_build
node_semi_build -->|"builds data pipeline"| node_semi_mapper
node_trainer -->|"requests data"| node_semi_build
node_trainer -->|"trains model"| node_semi_spotter
node_semi_spotter -->|"uses spotting model"| node_spotter
node_spotter -->|"computes features"| node_transformer
node_spotter -->|"computes training loss"| node_losses
node_trainer -->|"saves and loads"| node_checkpoint
node_trainer -->|"runs evaluation"| node_evaluator
node_evaluator -->|"reads ground truth"| node_eval_data

click node_browser "https://github.com/tuananhsr/vra/blob/main/semiets_demo/static/js/app.js"
click node_demo_api "https://github.com/tuananhsr/vra/blob/main/semiets_demo/app.py"
click node_predictor "https://github.com/tuananhsr/vra/blob/main/semiets_demo/predictor.py"
click node_text_datasets "https://github.com/tuananhsr/vra/blob/main/semiets_vintext/adet/data/datasets/text.py"
click node_semi_mapper "https://github.com/tuananhsr/vra/blob/main/semiets_vintext/adet/data/dataset_mapper.py"
click node_semi_build "https://github.com/tuananhsr/vra/blob/main/semiets_vintext/adet/data/semi_build.py"
click node_trainer "https://github.com/tuananhsr/vra/blob/main/semiets_vintext/tools/train_semi.py"
click node_checkpoint "https://github.com/tuananhsr/vra/blob/main/semiets_vintext/adet/checkpoint/adet_checkpoint.py"
click node_spotter "https://github.com/tuananhsr/vra/blob/main/semiets_vintext/adet/modeling/text_spotter.py"
click node_semi_spotter "https://github.com/tuananhsr/vra/blob/main/semiets_vintext/adet/modeling/semi_text_spotter.py"
click node_transformer "https://github.com/tuananhsr/vra/blob/main/semiets_vintext/adet/layers/deformable_transformer.py"
click node_losses "https://github.com/tuananhsr/vra/blob/main/semiets_vintext/adet/modeling/model/losses.py"
click node_evaluator "https://github.com/tuananhsr/vra/blob/main/semiets_vintext/adet/evaluation/text_evaluation_all.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_browser,node_demo_api,node_predictor,node_visitor toneBlue
class node_train_input,node_text_datasets,node_semi_mapper,node_semi_build,node_trainer,node_checkpoint toneAmber
class node_spotter,node_semi_spotter,node_transformer,node_losses toneMint
class node_evaluator,node_eval_data toneRose
```

## Components

### Inference Demo

- [Demo Client](https://github.com/tuananhsr/vra/blob/main/semiets_demo/static/js/app.js): `semiets_demo/static/js/app.js`
- [Demo Server](https://github.com/tuananhsr/vra/blob/main/semiets_demo/app.py): `semiets_demo/app.py`
- [Inference Adapter](https://github.com/tuananhsr/vra/blob/main/semiets_demo/predictor.py): `semiets_demo/predictor.py`

### Data And Training

- **Annotated Data**
- [Text Dataset Loading](https://github.com/tuananhsr/vra/blob/main/semiets_vintext/adet/data/datasets/text.py): `semiets_vintext/adet/data/datasets/text.py`
- [Semi-Supervised Mapping](https://github.com/tuananhsr/vra/blob/main/semiets_vintext/adet/data/dataset_mapper.py): `semiets_vintext/adet/data/dataset_mapper.py`
- [Semi Data Builder](https://github.com/tuananhsr/vra/blob/main/semiets_vintext/adet/data/semi_build.py): `semiets_vintext/adet/data/semi_build.py`
- [Semi Trainer](https://github.com/tuananhsr/vra/blob/main/semiets_vintext/tools/train_semi.py): `semiets_vintext/tools/train_semi.py`
- [Checkpoint Handling](https://github.com/tuananhsr/vra/blob/main/semiets_vintext/adet/checkpoint/adet_checkpoint.py): `semiets_vintext/adet/checkpoint/adet_checkpoint.py`

### Spotting Model

- [Text Spotter](https://github.com/tuananhsr/vra/blob/main/semiets_vintext/adet/modeling/text_spotter.py): `semiets_vintext/adet/modeling/text_spotter.py`
- [Semi Spotter](https://github.com/tuananhsr/vra/blob/main/semiets_vintext/adet/modeling/semi_text_spotter.py): `semiets_vintext/adet/modeling/semi_text_spotter.py`
- [Deformable Transformer](https://github.com/tuananhsr/vra/blob/main/semiets_vintext/adet/layers/deformable_transformer.py): `semiets_vintext/adet/layers/deformable_transformer.py`
- [Spotting Losses](https://github.com/tuananhsr/vra/blob/main/semiets_vintext/adet/modeling/model/losses.py): `semiets_vintext/adet/modeling/model/losses.py`

### Evaluation

- [Text Evaluator](https://github.com/tuananhsr/vra/blob/main/semiets_vintext/adet/evaluation/text_evaluation_all.py): `semiets_vintext/adet/evaluation/text_evaluation_all.py`
- **Evaluation Ground Truth**

### Other components

- **Image User**

## Connections

- Image User → Demo Client: submits image
- Demo Client → Demo Server: requests prediction
- Demo Server → Inference Adapter: invokes inference
- Inference Adapter → Text Spotter: runs model
- Text Spotter → Inference Adapter: returns detections
- Demo Server → Demo Client: returns response
- Demo Client → Image User: shows results
- Annotated Data → Text Dataset Loading: provides annotations
- Text Dataset Loading → Semi Data Builder: loads records
- Semi Data Builder → Semi-Supervised Mapping: builds data pipeline
- Semi Trainer → Semi Data Builder: requests data
- Semi Trainer → Semi Spotter: trains model
- Semi Spotter → Text Spotter: uses spotting model
- Text Spotter → Deformable Transformer: computes features
- Text Spotter → Spotting Losses: computes training loss
- Semi Trainer → Checkpoint Handling: saves and loads
- Semi Trainer → Text Evaluator: runs evaluation
- Text Evaluator → Evaluation Ground Truth: reads ground truth
