# jagadish-2003/smart-vehicle-number-plate-recognition-vehicle-management-system architecture

> Architecture diagram of the GitHub repository jagadish-2003/smart-vehicle-number-plate-recognition-vehicle-management-system, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-13). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/jagadish-2003/smart-vehicle-number-plate-recognition-vehicle-management-system
- Repository: https://github.com/jagadish-2003/smart-vehicle-number-plate-recognition-vehicle-management-system

## Overview

This is a Streamlit ANPR and vehicle-management application. A user submits an image, browser-camera frame, or video; the detection service recognizes and validates plates, suppresses duplicate saves, and records detections. Detection results can be enriched with vehicle, challan, blacklist, and authorization details. The app also provides vehicle administration, history, analytics, and settings. The README documents the page capabilities and startup responsibilities; several page-to-service and reporting links are shown as documented behavior because their source was not excerpted.

Main entry points: [`services/detection_service.py`](https://github.com/jagadish-2003/smart-vehicle-number-plate-recognition-vehicle-management-system/blob/main/services/detection_service.py) (Detection pipeline), [`services/vehicle_service.py`](https://github.com/jagadish-2003/smart-vehicle-number-plate-recognition-vehicle-management-system/blob/main/services/vehicle_service.py) (Vehicle lookup), [`app.py`](https://github.com/jagadish-2003/smart-vehicle-number-plate-recognition-vehicle-management-system/blob/main/app.py) (App bootstrap), [`database/database.py`](https://github.com/jagadish-2003/smart-vehicle-number-plate-recognition-vehicle-management-system/blob/main/database/database.py) (SQLite database)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ui["Streamlit interface"]
  node_app["App bootstrap<br/>[app.py]"]
  node_image["Image detection<br/>[image_detection.py]"]
  node_camera["Live camera<br/>[live_camera.py]"]
  node_video["Video detection<br/>[video_detection.py]"]
  node_vehicle_page["Vehicle manager<br/>[vehicle_manager.py]"]
  node_history_page["Detection history<br/>[history.py]"]
  node_analytics_page["Analytics dashboard<br/>[analytics.py]"]
  node_dashboard["Dashboard<br/>[dashboard.py]"]
  node_settings_page["Settings page<br/>[settings.py]"]
  node_vehicle_card["Vehicle report card<br/>[vehicle_card.py]"]
end

subgraph group_recognition["Plate recognition"]
  node_detection["Detection pipeline"]
  node_detector["YOLO plate detector"]
  node_ocr["Best-of-two OCR<br/>[ocr_engine.py]"]
  node_preprocess["Plate preprocessing<br/>[preprocessing.py]"]
  node_video_processor["Video processor<br/>[video_processor.py]"]
  node_model_loader["Model loader<br/>[model_loader.py]"]
end

subgraph group_domain["Vehicle services"]
  node_vehicle_service["Vehicle lookup<br/>[vehicle_service.py]"]
  node_history_service["History service<br/>[history_service.py]"]
  node_analytics_service["Analytics service"]
  node_settings_service["Settings service"]
end

subgraph group_persistence["Data and configuration"]
  node_sqlite[("SQLite database<br/>[database.py]")]
  node_analytics_queries["Analytics queries<br/>[analytics.py]"]
  node_config_manager["Config manager<br/>[config_manager.py]"]
  node_config_settings["Config settings<br/>[settings.py]"]
end

subgraph group_operations["Application support"]
  node_validation["Plate validation<br/>[validation.py]"]
  node_duplicate_cache["Duplicate cache<br/>[cache.py]"]
  node_logger["Application logger<br/>[logger.py]"]
end

node_user(("User"))

node_user -->|"opens app"| node_app
node_app -->|"loads config"| node_config_manager
node_app -->|"loads model"| node_model_loader
node_app -->|"initializes database"| node_sqlite
node_app -->|"initializes cache"| node_duplicate_cache
node_user -->|"uploads image"| node_image
node_user -->|"captures frame"| node_camera
node_user -->|"uploads video"| node_video
node_image -->|"processes image"| node_detection
node_camera -->|"processes frames"| node_detection
node_video -->|"processes video"| node_video_processor
node_video_processor -.->|"processes frames"| node_detection
node_detection -->|"detects plates"| node_detector
node_detection -->|"reads crops"| node_ocr
node_ocr -->|"preprocesses crop"| node_preprocess
node_detection -->|"validates text"| node_validation
node_detection -->|"checks duplicates"| node_duplicate_cache
node_detection -->|"saves detections"| node_sqlite
node_image -->|"looks up vehicle"| node_vehicle_service
node_camera -->|"looks up vehicle"| node_vehicle_service
node_video -->|"looks up vehicle"| node_vehicle_service
node_vehicle_service -->|"reads vehicle records"| node_sqlite
node_image -->|"shows report"| node_vehicle_card
node_camera -->|"shows report"| node_vehicle_card
node_video -->|"shows report"| node_vehicle_card
node_vehicle_page -->|"manages records"| node_vehicle_service
node_vehicle_card -->|"quick-adds vehicle"| node_vehicle_service
node_history_page -->|"manages history"| node_history_service
node_history_service -->|"queries detections"| node_sqlite
node_analytics_page -->|"requests analytics"| node_analytics_service
node_analytics_service -.->|"queries trends"| node_analytics_queries
node_dashboard -.->|"shows KPIs"| node_analytics_service
node_settings_page -->|"manages settings"| node_settings_service
node_settings_service -->|"updates config"| node_config_manager
node_settings_service -->|"clears cache"| node_duplicate_cache
node_settings_service -->|"clears detections"| node_sqlite
node_config_manager -->|"gets config path"| node_config_settings
node_detector -->|"logs inference"| node_logger
node_ocr -->|"logs OCR choice"| node_logger

click node_app "https://github.com/jagadish-2003/smart-vehicle-number-plate-recognition-vehicle-management-system/blob/main/app.py"
click node_image "https://github.com/jagadish-2003/smart-vehicle-number-plate-recognition-vehicle-management-system/blob/main/app_pages/image_detection.py"
click node_camera "https://github.com/jagadish-2003/smart-vehicle-number-plate-recognition-vehicle-management-system/blob/main/app_pages/live_camera.py"
click node_video "https://github.com/jagadish-2003/smart-vehicle-number-plate-recognition-vehicle-management-system/blob/main/app_pages/video_detection.py"
click node_vehicle_page "https://github.com/jagadish-2003/smart-vehicle-number-plate-recognition-vehicle-management-system/blob/main/app_pages/vehicle_manager.py"
click node_history_page "https://github.com/jagadish-2003/smart-vehicle-number-plate-recognition-vehicle-management-system/blob/main/app_pages/history.py"
click node_analytics_page "https://github.com/jagadish-2003/smart-vehicle-number-plate-recognition-vehicle-management-system/blob/main/app_pages/analytics.py"
click node_dashboard "https://github.com/jagadish-2003/smart-vehicle-number-plate-recognition-vehicle-management-system/blob/main/app_pages/dashboard.py"
click node_settings_page "https://github.com/jagadish-2003/smart-vehicle-number-plate-recognition-vehicle-management-system/blob/main/app_pages/settings.py"
click node_detection "https://github.com/jagadish-2003/smart-vehicle-number-plate-recognition-vehicle-management-system/blob/main/services/detection_service.py"
click node_detector "https://github.com/jagadish-2003/smart-vehicle-number-plate-recognition-vehicle-management-system/blob/main/ai/vehicle_plate_detector.py"
click node_ocr "https://github.com/jagadish-2003/smart-vehicle-number-plate-recognition-vehicle-management-system/blob/main/ai/ocr_engine.py"
click node_preprocess "https://github.com/jagadish-2003/smart-vehicle-number-plate-recognition-vehicle-management-system/blob/main/ai/preprocessing.py"
click node_video_processor "https://github.com/jagadish-2003/smart-vehicle-number-plate-recognition-vehicle-management-system/blob/main/ai/video_processor.py"
click node_validation "https://github.com/jagadish-2003/smart-vehicle-number-plate-recognition-vehicle-management-system/blob/main/utils/validation.py"
click node_duplicate_cache "https://github.com/jagadish-2003/smart-vehicle-number-plate-recognition-vehicle-management-system/blob/main/utils/cache.py"
click node_vehicle_service "https://github.com/jagadish-2003/smart-vehicle-number-plate-recognition-vehicle-management-system/blob/main/services/vehicle_service.py"
click node_vehicle_card "https://github.com/jagadish-2003/smart-vehicle-number-plate-recognition-vehicle-management-system/blob/main/components/vehicle_card.py"
click node_history_service "https://github.com/jagadish-2003/smart-vehicle-number-plate-recognition-vehicle-management-system/blob/main/services/history_service.py"
click node_analytics_service "https://github.com/jagadish-2003/smart-vehicle-number-plate-recognition-vehicle-management-system/blob/main/services/analytics_service.py"
click node_settings_service "https://github.com/jagadish-2003/smart-vehicle-number-plate-recognition-vehicle-management-system/blob/main/services/settings_service.py"
click node_sqlite "https://github.com/jagadish-2003/smart-vehicle-number-plate-recognition-vehicle-management-system/blob/main/database/database.py"
click node_analytics_queries "https://github.com/jagadish-2003/smart-vehicle-number-plate-recognition-vehicle-management-system/blob/main/database/analytics.py"
click node_config_manager "https://github.com/jagadish-2003/smart-vehicle-number-plate-recognition-vehicle-management-system/blob/main/config/config_manager.py"
click node_config_settings "https://github.com/jagadish-2003/smart-vehicle-number-plate-recognition-vehicle-management-system/blob/main/config/settings.py"
click node_model_loader "https://github.com/jagadish-2003/smart-vehicle-number-plate-recognition-vehicle-management-system/blob/main/ai/model_loader.py"
click node_logger "https://github.com/jagadish-2003/smart-vehicle-number-plate-recognition-vehicle-management-system/blob/main/utils/logger.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,node_image,node_camera,node_video,node_vehicle_page,node_history_page,node_analytics_page,node_dashboard,node_settings_page,node_vehicle_card,node_user toneBlue
class node_detection,node_detector,node_ocr,node_preprocess,node_video_processor,node_model_loader toneAmber
class node_vehicle_service,node_history_service,node_analytics_service,node_settings_service toneMint
class node_sqlite,node_analytics_queries,node_config_manager,node_config_settings toneRose
class node_validation,node_duplicate_cache,node_logger toneIndigo
```

## Components

### Streamlit interface

- [App bootstrap](https://github.com/jagadish-2003/smart-vehicle-number-plate-recognition-vehicle-management-system/blob/main/app.py): `app.py`
- [Image detection](https://github.com/jagadish-2003/smart-vehicle-number-plate-recognition-vehicle-management-system/blob/main/app_pages/image_detection.py): `app_pages/image_detection.py`
- [Live camera](https://github.com/jagadish-2003/smart-vehicle-number-plate-recognition-vehicle-management-system/blob/main/app_pages/live_camera.py): `app_pages/live_camera.py`
- [Video detection](https://github.com/jagadish-2003/smart-vehicle-number-plate-recognition-vehicle-management-system/blob/main/app_pages/video_detection.py): `app_pages/video_detection.py`
- [Vehicle manager](https://github.com/jagadish-2003/smart-vehicle-number-plate-recognition-vehicle-management-system/blob/main/app_pages/vehicle_manager.py): `app_pages/vehicle_manager.py`
- [Detection history](https://github.com/jagadish-2003/smart-vehicle-number-plate-recognition-vehicle-management-system/blob/main/app_pages/history.py): `app_pages/history.py`
- [Analytics dashboard](https://github.com/jagadish-2003/smart-vehicle-number-plate-recognition-vehicle-management-system/blob/main/app_pages/analytics.py): `app_pages/analytics.py`
- [Dashboard](https://github.com/jagadish-2003/smart-vehicle-number-plate-recognition-vehicle-management-system/blob/main/app_pages/dashboard.py): `app_pages/dashboard.py`
- [Settings page](https://github.com/jagadish-2003/smart-vehicle-number-plate-recognition-vehicle-management-system/blob/main/app_pages/settings.py): `app_pages/settings.py`
- [Vehicle report card](https://github.com/jagadish-2003/smart-vehicle-number-plate-recognition-vehicle-management-system/blob/main/components/vehicle_card.py): `components/vehicle_card.py`

### Plate recognition

- [Detection pipeline](https://github.com/jagadish-2003/smart-vehicle-number-plate-recognition-vehicle-management-system/blob/main/services/detection_service.py): `services/detection_service.py`
- [YOLO plate detector](https://github.com/jagadish-2003/smart-vehicle-number-plate-recognition-vehicle-management-system/blob/main/ai/vehicle_plate_detector.py): `ai/vehicle_plate_detector.py`
- [Best-of-two OCR](https://github.com/jagadish-2003/smart-vehicle-number-plate-recognition-vehicle-management-system/blob/main/ai/ocr_engine.py): `ai/ocr_engine.py`
- [Plate preprocessing](https://github.com/jagadish-2003/smart-vehicle-number-plate-recognition-vehicle-management-system/blob/main/ai/preprocessing.py): `ai/preprocessing.py`
- [Video processor](https://github.com/jagadish-2003/smart-vehicle-number-plate-recognition-vehicle-management-system/blob/main/ai/video_processor.py): `ai/video_processor.py`
- [Model loader](https://github.com/jagadish-2003/smart-vehicle-number-plate-recognition-vehicle-management-system/blob/main/ai/model_loader.py): `ai/model_loader.py`

### Vehicle services

- [Vehicle lookup](https://github.com/jagadish-2003/smart-vehicle-number-plate-recognition-vehicle-management-system/blob/main/services/vehicle_service.py): `services/vehicle_service.py`
- [History service](https://github.com/jagadish-2003/smart-vehicle-number-plate-recognition-vehicle-management-system/blob/main/services/history_service.py): `services/history_service.py`
- [Analytics service](https://github.com/jagadish-2003/smart-vehicle-number-plate-recognition-vehicle-management-system/blob/main/services/analytics_service.py): `services/analytics_service.py`
- [Settings service](https://github.com/jagadish-2003/smart-vehicle-number-plate-recognition-vehicle-management-system/blob/main/services/settings_service.py): `services/settings_service.py`

### Data and configuration

- [SQLite database](https://github.com/jagadish-2003/smart-vehicle-number-plate-recognition-vehicle-management-system/blob/main/database/database.py): `database/database.py`
- [Analytics queries](https://github.com/jagadish-2003/smart-vehicle-number-plate-recognition-vehicle-management-system/blob/main/database/analytics.py): `database/analytics.py`
- [Config manager](https://github.com/jagadish-2003/smart-vehicle-number-plate-recognition-vehicle-management-system/blob/main/config/config_manager.py): `config/config_manager.py`
- [Config settings](https://github.com/jagadish-2003/smart-vehicle-number-plate-recognition-vehicle-management-system/blob/main/config/settings.py): `config/settings.py`

### Application support

- [Plate validation](https://github.com/jagadish-2003/smart-vehicle-number-plate-recognition-vehicle-management-system/blob/main/utils/validation.py): `utils/validation.py`
- [Duplicate cache](https://github.com/jagadish-2003/smart-vehicle-number-plate-recognition-vehicle-management-system/blob/main/utils/cache.py): `utils/cache.py`
- [Application logger](https://github.com/jagadish-2003/smart-vehicle-number-plate-recognition-vehicle-management-system/blob/main/utils/logger.py): `utils/logger.py`

### Other components

- **User**

## Connections

- User → App bootstrap: opens app (evidence: `README.md`)
- App bootstrap → Config manager: loads config (evidence: `README.md`)
- App bootstrap → Model loader: loads model (evidence: `README.md`)
- App bootstrap → SQLite database: initializes database (evidence: `README.md`)
- App bootstrap → Duplicate cache: initializes cache (evidence: `README.md`)
- User → Image detection: uploads image (evidence: `README.md`)
- User → Live camera: captures frame (evidence: `README.md`)
- User → Video detection: uploads video (evidence: `README.md`)
- Image detection → Detection pipeline: processes image (evidence: `README.md`)
- Live camera → Detection pipeline: processes frames (evidence: `README.md`)
- Video detection → Video processor: processes video (evidence: `README.md`)
- Video processor → Detection pipeline: processes frames
- Detection pipeline → YOLO plate detector: detects plates (evidence: `services/detection_service.py`)
- Detection pipeline → Best-of-two OCR: reads crops (evidence: `services/detection_service.py`)
- Best-of-two OCR → Plate preprocessing: preprocesses crop (evidence: `ai/ocr_engine.py`)
- Detection pipeline → Plate validation: validates text (evidence: `services/detection_service.py`)
- Detection pipeline → Duplicate cache: checks duplicates (evidence: `services/detection_service.py`)
- Detection pipeline → SQLite database: saves detections (evidence: `services/detection_service.py`)
- Image detection → Vehicle lookup: looks up vehicle (evidence: `README.md`)
- Live camera → Vehicle lookup: looks up vehicle (evidence: `README.md`)
- Video detection → Vehicle lookup: looks up vehicle (evidence: `README.md`)
- Vehicle lookup → SQLite database: reads vehicle records (evidence: `services/vehicle_service.py`)
- Image detection → Vehicle report card: shows report (evidence: `README.md`)
- Live camera → Vehicle report card: shows report (evidence: `README.md`)
- Video detection → Vehicle report card: shows report (evidence: `README.md`)
- Vehicle manager → Vehicle lookup: manages records (evidence: `README.md`)
- Vehicle report card → Vehicle lookup: quick-adds vehicle (evidence: `components/vehicle_card.py`)
- Detection history → History service: manages history (evidence: `README.md`)
- History service → SQLite database: queries detections (evidence: `services/history_service.py`)
- Analytics dashboard → Analytics service: requests analytics (evidence: `README.md`)
- Analytics service → Analytics queries: queries trends
- Dashboard → Analytics service: shows KPIs
- Settings page → Settings service: manages settings (evidence: `README.md`)
- Settings service → Config manager: updates config (evidence: `services/settings_service.py`)
- Settings service → Duplicate cache: clears cache (evidence: `services/settings_service.py`)
- Settings service → SQLite database: clears detections (evidence: `services/settings_service.py`)
- Config manager → Config settings: gets config path (evidence: `config/config_manager.py`)
- YOLO plate detector → Application logger: logs inference (evidence: `ai/vehicle_plate_detector.py`)
- Best-of-two OCR → Application logger: logs OCR choice (evidence: `ai/ocr_engine.py`)
