# nguyenngocthanh-collab/license-plate-recognition-system-alpr- architecture

> Architecture diagram of the GitHub repository nguyenngocthanh-collab/license-plate-recognition-system-alpr-, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-12-04). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/nguyenngocthanh-collab/license-plate-recognition-system-alpr-
- Repository: https://github.com/nguyenngocthanh-collab/license-plate-recognition-system-alpr-

## Overview

ALPR is a still-image license plate recognition application. A user uploads a JPG/JPEG/PNG in the Streamlit interface; the app converts it to BGR and, on request, invokes RecognitionService. The service coordinates detection, plate cropping and preprocessing, then OCR, returning per-plate text or errors for display with confidence and bounding boxes. The graph follows the documented pipeline and shown calls. Dataset-label filtering is a separate data-preparation utility, not part of runtime recognition; no persistence is implemented.

Main entry points: [`ALPR/src/services/recognition_service.py`](https://github.com/nguyenngocthanh-collab/license-plate-recognition-system-alpr-/blob/main/ALPR/src/services/recognition_service.py) (Recognition service), [`ALPR/src/core/detector.py`](https://github.com/nguyenngocthanh-collab/license-plate-recognition-system-alpr-/blob/main/ALPR/src/core/detector.py) (Plate detector), [`ALPR/src/models/schemas.py`](https://github.com/nguyenngocthanh-collab/license-plate-recognition-system-alpr-/blob/main/ALPR/src/models/schemas.py) (Recognition schemas), [`ALPR/app.py`](https://github.com/nguyenngocthanh-collab/license-plate-recognition-system-alpr-/blob/main/ALPR/app.py) (Streamlit app)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_presentation["Image interface"]
  node_app["Streamlit app<br/>[app.py]"]
end

subgraph group_recognition["Recognition pipeline"]
  node_service["Recognition service"]
  node_detector["Plate detector<br/>[detector.py]"]
  node_weights[("YOLO weights")]
  node_processor["Image processor<br/>[image_processor.py]"]
  node_ocr["EasyOCR reader<br/>[ocr.py]"]
  node_schemas["Recognition schemas<br/>[schemas.py]"]
end

node_user(("Image uploader"))

node_user -->|"uploads image"| node_app
node_app -->|"requests recognition"| node_service
node_service -->|"detects plates"| node_detector
node_detector -->|"loads weights"| node_weights
node_service -->|"crops and preprocesses"| node_processor
node_service -->|"reads processed crop"| node_ocr
node_detector -->|"creates detections"| node_schemas
node_processor -->|"accepts detection"| node_schemas
node_service -->|"returns results"| node_schemas

click node_app "https://github.com/nguyenngocthanh-collab/license-plate-recognition-system-alpr-/blob/main/ALPR/app.py"
click node_service "https://github.com/nguyenngocthanh-collab/license-plate-recognition-system-alpr-/blob/main/ALPR/src/services/recognition_service.py"
click node_detector "https://github.com/nguyenngocthanh-collab/license-plate-recognition-system-alpr-/blob/main/ALPR/src/core/detector.py"
click node_weights "https://github.com/nguyenngocthanh-collab/license-plate-recognition-system-alpr-/blob/main/ALPR/models/license_plate_detector.pt"
click node_processor "https://github.com/nguyenngocthanh-collab/license-plate-recognition-system-alpr-/blob/main/ALPR/src/core/image_processor.py"
click node_ocr "https://github.com/nguyenngocthanh-collab/license-plate-recognition-system-alpr-/blob/main/ALPR/src/core/ocr.py"
click node_schemas "https://github.com/nguyenngocthanh-collab/license-plate-recognition-system-alpr-/blob/main/ALPR/src/models/schemas.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_app toneBlue
class node_service,node_detector,node_weights,node_processor,node_ocr,node_schemas toneAmber
class node_user toneIndigo
```

## Components

### Image interface

- [Streamlit app](https://github.com/nguyenngocthanh-collab/license-plate-recognition-system-alpr-/blob/main/ALPR/app.py): `ALPR/app.py`

### Recognition pipeline

- [Recognition service](https://github.com/nguyenngocthanh-collab/license-plate-recognition-system-alpr-/blob/main/ALPR/src/services/recognition_service.py): `ALPR/src/services/recognition_service.py`
- [Plate detector](https://github.com/nguyenngocthanh-collab/license-plate-recognition-system-alpr-/blob/main/ALPR/src/core/detector.py): `ALPR/src/core/detector.py`
- [YOLO weights](https://github.com/nguyenngocthanh-collab/license-plate-recognition-system-alpr-/blob/main/ALPR/models/license_plate_detector.pt): `ALPR/models/license_plate_detector.pt`
- [Image processor](https://github.com/nguyenngocthanh-collab/license-plate-recognition-system-alpr-/blob/main/ALPR/src/core/image_processor.py): `ALPR/src/core/image_processor.py`
- [EasyOCR reader](https://github.com/nguyenngocthanh-collab/license-plate-recognition-system-alpr-/blob/main/ALPR/src/core/ocr.py): `ALPR/src/core/ocr.py`
- [Recognition schemas](https://github.com/nguyenngocthanh-collab/license-plate-recognition-system-alpr-/blob/main/ALPR/src/models/schemas.py): `ALPR/src/models/schemas.py`

### Other components

- **Image uploader**

## Connections

- Image uploader → Streamlit app: uploads image (evidence: `ALPR/app.py`)
- Streamlit app → Recognition service: requests recognition (evidence: `ALPR/app.py`)
- Recognition service → Plate detector: detects plates (evidence: `ALPR/src/services/recognition_service.py`)
- Plate detector → YOLO weights: loads weights (evidence: `ALPR/src/core/detector.py`)
- Recognition service → Image processor: crops and preprocesses (evidence: `ALPR/src/services/recognition_service.py`)
- Recognition service → EasyOCR reader: reads processed crop (evidence: `ALPR/src/services/recognition_service.py`)
- Plate detector → Recognition schemas: creates detections (evidence: `ALPR/src/core/detector.py`)
- Image processor → Recognition schemas: accepts detection (evidence: `ALPR/src/core/image_processor.py`)
- Recognition service → Recognition schemas: returns results (evidence: `ALPR/src/services/recognition_service.py`)
