# kaviyarasu24/smart-vehicle-detection-security-system architecture

> Architecture diagram of the GitHub repository kaviyarasu24/smart-vehicle-detection-security-system, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-20). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/kaviyarasu24/smart-vehicle-detection-security-system
- Repository: https://github.com/kaviyarasu24/smart-vehicle-detection-security-system

## Overview

This is a lightweight vehicle-entry monitoring system. Its main workflow reads video frames, detects and tracks vehicles, identifies entry/exit crossings, and records vehicle and plate details with snapshots and daily reports. It also produces an annotated video and a live preview. The README documents CSV/Excel report generation; the excerpt shows the daily-report call, but does not show the final call to the general report generator, so that link is left unverified.

Main entry points: [`main.py`](https://github.com/kaviyarasu24/smart-vehicle-detection-security-system/blob/main/main.py) (Frame processing), [`tracker.py`](https://github.com/kaviyarasu24/smart-vehicle-detection-security-system/blob/main/tracker.py) (Line crossing), [`detector.py`](https://github.com/kaviyarasu24/smart-vehicle-detection-security-system/blob/main/detector.py) (Vehicle detection), [`plate_detector.py`](https://github.com/kaviyarasu24/smart-vehicle-detection-security-system/blob/main/plate_detector.py) (Plate detection)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_processing["Video processing"]
  node_main["Frame processing<br/>[main.py]"]
  node_line_counter["Line crossing<br/>[tracker.py]"]
  node_entry_capture["Entry capture<br/>[main.py]"]
end

subgraph group_recognition["Vehicle recognition"]
  node_vehicle_detector["Vehicle detection<br/>[detector.py]"]
  node_plate_detector["Plate detection<br/>[plate_detector.py]"]
  node_plate_reader["Plate OCR<br/>[plate_reader.py]"]
end

subgraph group_records["Events and reports"]
  node_duplicate_guard["Duplicate guard<br/>[main.py]"]
  node_vehicle_records["Vehicle records<br/>[main.py]"]
  node_daily_report["Daily Excel report"]
  node_general_reports["CSV/Excel reports"]
end

subgraph group_presentation["Outputs"]
  node_snapshots["Vehicle snapshots<br/>[main.py]"]
  node_annotated_video["Annotated video"]
  node_live_preview["Live preview<br/>[main.py]"]
end

node_source(("Video source"))

node_source -->|"provides frames"| node_main
node_main -->|"tracks vehicles"| node_vehicle_detector
node_main -->|"checks crossings"| node_line_counter
node_main -->|"handles entry"| node_entry_capture
node_main -->|"detects plates"| node_plate_detector
node_main -->|"reads plate"| node_plate_reader
node_main -->|"checks duplicates"| node_duplicate_guard
node_main -->|"updates records"| node_vehicle_records
node_main -->|"appends entry"| node_daily_report
node_main -->|"saves crops"| node_snapshots
node_main -->|"writes video"| node_annotated_video
node_main -->|"shows frames"| node_live_preview
node_main -.->|"generates reports"| node_general_reports

click node_main "https://github.com/kaviyarasu24/smart-vehicle-detection-security-system/blob/main/main.py"
click node_vehicle_detector "https://github.com/kaviyarasu24/smart-vehicle-detection-security-system/blob/main/detector.py"
click node_line_counter "https://github.com/kaviyarasu24/smart-vehicle-detection-security-system/blob/main/tracker.py"
click node_entry_capture "https://github.com/kaviyarasu24/smart-vehicle-detection-security-system/blob/main/main.py"
click node_plate_detector "https://github.com/kaviyarasu24/smart-vehicle-detection-security-system/blob/main/plate_detector.py"
click node_plate_reader "https://github.com/kaviyarasu24/smart-vehicle-detection-security-system/blob/main/plate_reader.py"
click node_duplicate_guard "https://github.com/kaviyarasu24/smart-vehicle-detection-security-system/blob/main/main.py"
click node_vehicle_records "https://github.com/kaviyarasu24/smart-vehicle-detection-security-system/blob/main/main.py"
click node_daily_report "https://github.com/kaviyarasu24/smart-vehicle-detection-security-system/blob/main/report_generator.py"
click node_general_reports "https://github.com/kaviyarasu24/smart-vehicle-detection-security-system/blob/main/report_generator.py"
click node_snapshots "https://github.com/kaviyarasu24/smart-vehicle-detection-security-system/blob/main/main.py"
click node_annotated_video "https://github.com/kaviyarasu24/smart-vehicle-detection-security-system/blob/main/outputs/output_detected.mp4"
click node_live_preview "https://github.com/kaviyarasu24/smart-vehicle-detection-security-system/blob/main/main.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_main,node_line_counter,node_entry_capture toneBlue
class node_vehicle_detector,node_plate_detector,node_plate_reader toneAmber
class node_duplicate_guard,node_vehicle_records,node_daily_report,node_general_reports toneMint
class node_snapshots,node_annotated_video,node_live_preview toneRose
class node_source toneIndigo
```

## Components

### Video processing

- [Frame processing](https://github.com/kaviyarasu24/smart-vehicle-detection-security-system/blob/main/main.py): `main.py`
- [Line crossing](https://github.com/kaviyarasu24/smart-vehicle-detection-security-system/blob/main/tracker.py): `tracker.py`
- [Entry capture](https://github.com/kaviyarasu24/smart-vehicle-detection-security-system/blob/main/main.py): `main.py`

### Vehicle recognition

- [Vehicle detection](https://github.com/kaviyarasu24/smart-vehicle-detection-security-system/blob/main/detector.py): `detector.py`
- [Plate detection](https://github.com/kaviyarasu24/smart-vehicle-detection-security-system/blob/main/plate_detector.py): `plate_detector.py`
- [Plate OCR](https://github.com/kaviyarasu24/smart-vehicle-detection-security-system/blob/main/plate_reader.py): `plate_reader.py`

### Events and reports

- [Duplicate guard](https://github.com/kaviyarasu24/smart-vehicle-detection-security-system/blob/main/main.py): `main.py`
- [Vehicle records](https://github.com/kaviyarasu24/smart-vehicle-detection-security-system/blob/main/main.py): `main.py`
- [Daily Excel report](https://github.com/kaviyarasu24/smart-vehicle-detection-security-system/blob/main/report_generator.py): `report_generator.py`
- [CSV/Excel reports](https://github.com/kaviyarasu24/smart-vehicle-detection-security-system/blob/main/report_generator.py): `report_generator.py`

### Outputs

- [Vehicle snapshots](https://github.com/kaviyarasu24/smart-vehicle-detection-security-system/blob/main/main.py): `main.py`
- [Annotated video](https://github.com/kaviyarasu24/smart-vehicle-detection-security-system/blob/main/outputs/output_detected.mp4): `outputs/output_detected.mp4`
- [Live preview](https://github.com/kaviyarasu24/smart-vehicle-detection-security-system/blob/main/main.py): `main.py`

### Other components

- **Video source**

## Connections

- Video source → Frame processing: provides frames (evidence: `README.md`)
- Frame processing → Vehicle detection: tracks vehicles (evidence: `main.py`)
- Frame processing → Line crossing: checks crossings (evidence: `main.py`)
- Frame processing → Entry capture: handles entry (evidence: `main.py`)
- Frame processing → Plate detection: detects plates (evidence: `main.py`)
- Frame processing → Plate OCR: reads plate (evidence: `main.py`)
- Frame processing → Duplicate guard: checks duplicates (evidence: `main.py`)
- Frame processing → Vehicle records: updates records (evidence: `main.py`)
- Frame processing → Daily Excel report: appends entry (evidence: `main.py`)
- Frame processing → Vehicle snapshots: saves crops (evidence: `README.md`)
- Frame processing → Annotated video: writes video (evidence: `main.py`)
- Frame processing → Live preview: shows frames (evidence: `main.py`)
- Frame processing → CSV/Excel reports: generates reports (evidence: `main.py`)
