# dangkhoitotheworld/automaticnumberplaterecognitiondemo architecture

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

- Interactive diagram: https://gitdiagram.com/dangkhoitotheworld/automaticnumberplaterecognitiondemo
- Repository: https://github.com/dangkhoitotheworld/automaticnumberplaterecognitiondemo

## Overview

This is a Vietnamese vehicle number-plate recognition demo. Its main workflow accepts images or video, detects plates, tracks plates across frames, reads and combines characters, then annotates and saves results. The README also documents a GUI, three recognition modes, RapidOCR fallback, and notebook-based model fine-tuning. The implementation is a single Python file; unsampled internals are represented only where the README describes their role.

Main entry points: [`bien_so_yolo.py`](https://github.com/dangkhoitotheworld/automaticnumberplaterecognitiondemo/blob/main/bien_so_yolo.py) (Character recognition), [`huan_luyen_yolov8_colab.ipynb`](https://github.com/dangkhoitotheworld/automaticnumberplaterecognitiondemo/blob/main/huan_luyen_yolov8_colab.ipynb) (Model fine-tuning), [`plate.pt`](https://github.com/dangkhoitotheworld/automaticnumberplaterecognitiondemo/blob/main/plate.pt) (Plate YOLO weights), [`char.pt`](https://github.com/dangkhoitotheworld/automaticnumberplaterecognitiondemo/blob/main/char.pt) (Character YOLO weights)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ingest["Input and interface"]
  node_cli["CLI entry point<br/>[bien_so_yolo.py]"]
  node_gui["Image/video/webcam GUI<br/>[bien_so_yolo.py]"]
  node_media["Image and video input<br/>[bien_so_yolo.py]"]
end

subgraph group_recognition["Plate recognition"]
  node_detect["Plate detection<br/>[bien_so_yolo.py]"]
  node_crop["Plate crop and warp<br/>[bien_so_yolo.py]"]
  node_char_read["Character recognition<br/>[bien_so_yolo.py]"]
  node_rapidocr["RapidOCR fallback<br/>[bien_so_yolo.py]"]
  node_combine["Character assembly<br/>[bien_so_yolo.py]"]
end

subgraph group_video["Video processing"]
  node_track["SORT tracking<br/>[bien_so_yolo.py]"]
  node_vote["Track result voting<br/>[bien_so_yolo.py]"]
  node_annotate["Result annotation<br/>[bien_so_yolo.py]"]
end

subgraph group_artifacts["Models and results"]
  node_plate_model["Plate YOLO weights<br/>[plate.pt]"]
  node_char_model["Character YOLO weights<br/>[char.pt]"]
  node_save["Save output<br/>[bien_so_yolo.py]"]
  node_results["Result artifacts<br/>[ket_qua.csv]"]
  node_training["Model fine-tuning"]
end

node_user(("User"))
node_roboflow[("Roboflow datasets")]

node_user -->|"runs"| node_cli
node_user -->|"opens"| node_gui
node_cli -->|"selects input"| node_media
node_gui -->|"opens input"| node_media
node_media -->|"supplies frames"| node_detect
node_detect -->|"uses weights"| node_plate_model
node_detect -->|"passes detections"| node_track
node_track -->|"tracks plates"| node_crop
node_crop -->|"supplies crops"| node_char_read
node_char_read -->|"uses weights"| node_char_model
node_char_read -.->|"falls back"| node_rapidocr
node_char_read -->|"returns characters"| node_combine
node_combine -->|"supplies plate text"| node_vote
node_vote -->|"provides final text"| node_annotate
node_annotate -->|"provides annotated media"| node_save
node_save -.->|"writes results"| node_results
node_roboflow -->|"provides data"| node_training
node_training -->|"fine-tunes"| node_plate_model
node_training -->|"fine-tunes"| node_char_model

click node_cli "https://github.com/dangkhoitotheworld/automaticnumberplaterecognitiondemo/blob/main/bien_so_yolo.py"
click node_gui "https://github.com/dangkhoitotheworld/automaticnumberplaterecognitiondemo/blob/main/bien_so_yolo.py"
click node_media "https://github.com/dangkhoitotheworld/automaticnumberplaterecognitiondemo/blob/main/bien_so_yolo.py"
click node_detect "https://github.com/dangkhoitotheworld/automaticnumberplaterecognitiondemo/blob/main/bien_so_yolo.py"
click node_plate_model "https://github.com/dangkhoitotheworld/automaticnumberplaterecognitiondemo/blob/main/plate.pt"
click node_track "https://github.com/dangkhoitotheworld/automaticnumberplaterecognitiondemo/blob/main/bien_so_yolo.py"
click node_crop "https://github.com/dangkhoitotheworld/automaticnumberplaterecognitiondemo/blob/main/bien_so_yolo.py"
click node_char_read "https://github.com/dangkhoitotheworld/automaticnumberplaterecognitiondemo/blob/main/bien_so_yolo.py"
click node_char_model "https://github.com/dangkhoitotheworld/automaticnumberplaterecognitiondemo/blob/main/char.pt"
click node_rapidocr "https://github.com/dangkhoitotheworld/automaticnumberplaterecognitiondemo/blob/main/bien_so_yolo.py"
click node_combine "https://github.com/dangkhoitotheworld/automaticnumberplaterecognitiondemo/blob/main/bien_so_yolo.py"
click node_vote "https://github.com/dangkhoitotheworld/automaticnumberplaterecognitiondemo/blob/main/bien_so_yolo.py"
click node_annotate "https://github.com/dangkhoitotheworld/automaticnumberplaterecognitiondemo/blob/main/bien_so_yolo.py"
click node_save "https://github.com/dangkhoitotheworld/automaticnumberplaterecognitiondemo/blob/main/bien_so_yolo.py"
click node_results "https://github.com/dangkhoitotheworld/automaticnumberplaterecognitiondemo/blob/main/ket_qua/ket_qua.csv"
click node_training "https://github.com/dangkhoitotheworld/automaticnumberplaterecognitiondemo/blob/main/huan_luyen_yolov8_colab.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_cli,node_gui,node_media,node_user toneBlue
class node_detect,node_crop,node_char_read,node_rapidocr,node_combine,node_roboflow toneAmber
class node_track,node_vote,node_annotate toneMint
class node_plate_model,node_char_model,node_save,node_results,node_training toneRose
```

## Components

### Input and interface

- [CLI entry point](https://github.com/dangkhoitotheworld/automaticnumberplaterecognitiondemo/blob/main/bien_so_yolo.py): `bien_so_yolo.py`
- [Image/video/webcam GUI](https://github.com/dangkhoitotheworld/automaticnumberplaterecognitiondemo/blob/main/bien_so_yolo.py): `bien_so_yolo.py`
- [Image and video input](https://github.com/dangkhoitotheworld/automaticnumberplaterecognitiondemo/blob/main/bien_so_yolo.py): `bien_so_yolo.py`

### Plate recognition

- [Plate detection](https://github.com/dangkhoitotheworld/automaticnumberplaterecognitiondemo/blob/main/bien_so_yolo.py): `bien_so_yolo.py`
- [Plate crop and warp](https://github.com/dangkhoitotheworld/automaticnumberplaterecognitiondemo/blob/main/bien_so_yolo.py): `bien_so_yolo.py`
- [Character recognition](https://github.com/dangkhoitotheworld/automaticnumberplaterecognitiondemo/blob/main/bien_so_yolo.py): `bien_so_yolo.py`
- [RapidOCR fallback](https://github.com/dangkhoitotheworld/automaticnumberplaterecognitiondemo/blob/main/bien_so_yolo.py): `bien_so_yolo.py`
- [Character assembly](https://github.com/dangkhoitotheworld/automaticnumberplaterecognitiondemo/blob/main/bien_so_yolo.py): `bien_so_yolo.py`

### Video processing

- [SORT tracking](https://github.com/dangkhoitotheworld/automaticnumberplaterecognitiondemo/blob/main/bien_so_yolo.py): `bien_so_yolo.py`
- [Track result voting](https://github.com/dangkhoitotheworld/automaticnumberplaterecognitiondemo/blob/main/bien_so_yolo.py): `bien_so_yolo.py`
- [Result annotation](https://github.com/dangkhoitotheworld/automaticnumberplaterecognitiondemo/blob/main/bien_so_yolo.py): `bien_so_yolo.py`

### Models and results

- [Plate YOLO weights](https://github.com/dangkhoitotheworld/automaticnumberplaterecognitiondemo/blob/main/plate.pt): `plate.pt`
- [Character YOLO weights](https://github.com/dangkhoitotheworld/automaticnumberplaterecognitiondemo/blob/main/char.pt): `char.pt`
- [Save output](https://github.com/dangkhoitotheworld/automaticnumberplaterecognitiondemo/blob/main/bien_so_yolo.py): `bien_so_yolo.py`
- [Result artifacts](https://github.com/dangkhoitotheworld/automaticnumberplaterecognitiondemo/blob/main/ket_qua/ket_qua.csv): `ket_qua/ket_qua.csv`
- [Model fine-tuning](https://github.com/dangkhoitotheworld/automaticnumberplaterecognitiondemo/blob/main/huan_luyen_yolov8_colab.ipynb): `huan_luyen_yolov8_colab.ipynb`

### Other components

- **User**
- **Roboflow datasets**

## Connections

- User → CLI entry point: runs (evidence: `README.md`)
- User → Image/video/webcam GUI: opens (evidence: `README.md`)
- CLI entry point → Image and video input: selects input (evidence: `README.md`)
- Image/video/webcam GUI → Image and video input: opens input (evidence: `README.md`)
- Image and video input → Plate detection: supplies frames (evidence: `README.md`)
- Plate detection → Plate YOLO weights: uses weights (evidence: `README.md`)
- Plate detection → SORT tracking: passes detections (evidence: `README.md`)
- SORT tracking → Plate crop and warp: tracks plates (evidence: `README.md`)
- Plate crop and warp → Character recognition: supplies crops (evidence: `README.md`)
- Character recognition → Character YOLO weights: uses weights (evidence: `README.md`)
- Character recognition → RapidOCR fallback: falls back (evidence: `README.md`)
- Character recognition → Character assembly: returns characters (evidence: `README.md`)
- Character assembly → Track result voting: supplies plate text (evidence: `README.md`)
- Track result voting → Result annotation: provides final text (evidence: `README.md`)
- Result annotation → Save output: provides annotated media (evidence: `README.md`)
- Save output → Result artifacts: writes results (evidence: `README.md`)
- Roboflow datasets → Model fine-tuning: provides data (evidence: `README.md`)
- Model fine-tuning → Plate YOLO weights: fine-tunes (evidence: `README.md`)
- Model fine-tuning → Character YOLO weights: fine-tunes (evidence: `README.md`)
