# arjundeokhile/smart-parking-space-management architecture

> Architecture diagram of the GitHub repository arjundeokhile/smart-parking-space-management, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-11). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/arjundeokhile/smart-parking-space-management
- Repository: https://github.com/arjundeokhile/smart-parking-space-management

## Overview

This is a video-based smart-parking detector: the application reads frames, tracks vehicles with YOLO, tests vehicle centers against saved parking polygons, and reports slot occupancy. The same runtime loop updates a Flask dashboard and performance graphs; the dashboard also serves its HTML view and exposes statistics. Logging is configured centrally. The main loop and dashboard relationships are supported by excerpts; additional documented capabilities are included where their implementation was not sampled.

Main entry points: [`main.py`](https://github.com/arjundeokhile/smart-parking-space-management/blob/main/main.py) (Slot statistics), [`dashboard.py`](https://github.com/arjundeokhile/smart-parking-space-management/blob/main/dashboard.py) (Dashboard server), [`polygons.json`](https://github.com/arjundeokhile/smart-parking-space-management/blob/main/polygons.json) (Parking layout), [`Input.mp4`](https://github.com/arjundeokhile/smart-parking-space-management/blob/main/Input.mp4) (Video input)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_detection["Detection and occupancy"]
  node_video["Video input<br/>[Input.mp4]"]
  node_model["YOLO model<br/>[best.pt]"]
  node_capture["Frame capture<br/>[main.py]"]
  node_vehicle_detection["Vehicle tracking<br/>[main.py]"]
  node_center_calculation["Vehicle centers<br/>[main.py]"]
  node_polygon_test["Polygon testing<br/>[main.py]"]
  node_occupancy["Slot statistics<br/>[main.py]"]
  node_video_display["Detection display<br/>[main.py]"]
end

subgraph group_monitoring["Dashboard and monitoring"]
  node_dashboard_runtime["Dashboard server<br/>[dashboard.py]"]
  node_dashboard_data["Live statistics<br/>[dashboard.py]"]
  node_dashboard_page["Dashboard page<br/>[index.html]"]
  node_performance_graphs["Performance graphs<br/>[performance.py]"]
  node_logger["Central logging<br/>[loggerConfig.py]"]
end

subgraph group_configuration["Parking configuration"]
  node_polygons["Parking layout<br/>[polygons.json]"]
  node_layout_editor["Layout editor<br/>[main.py]"]
end

node_operator(("Parking operator"))

node_video -->|"provides frames"| node_capture
node_capture -->|"supplies frames"| node_vehicle_detection
node_model -->|"tracks vehicles"| node_vehicle_detection
node_vehicle_detection -->|"provides boxes"| node_center_calculation
node_center_calculation -->|"tests centers"| node_polygon_test
node_polygons -->|"defines regions"| node_polygon_test
node_polygon_test -->|"counts occupied"| node_occupancy
node_occupancy -->|"draws status"| node_video_display
node_occupancy -->|"updates statistics"| node_dashboard_data
node_occupancy -->|"updates graphs"| node_performance_graphs
node_layout_editor -->|"saves layout"| node_polygons
node_polygons -->|"loads layout"| node_layout_editor
node_dashboard_runtime -->|"serves statistics"| node_dashboard_data
node_dashboard_runtime -->|"renders page"| node_dashboard_page
node_dashboard_runtime -->|"logs access"| node_logger
node_operator -.->|"views dashboard"| node_dashboard_runtime
node_operator -.->|"defines slots"| node_layout_editor

click node_video "https://github.com/arjundeokhile/smart-parking-space-management/blob/main/Input.mp4"
click node_model "https://github.com/arjundeokhile/smart-parking-space-management/blob/main/best.pt"
click node_capture "https://github.com/arjundeokhile/smart-parking-space-management/blob/main/main.py"
click node_vehicle_detection "https://github.com/arjundeokhile/smart-parking-space-management/blob/main/main.py"
click node_center_calculation "https://github.com/arjundeokhile/smart-parking-space-management/blob/main/main.py"
click node_polygon_test "https://github.com/arjundeokhile/smart-parking-space-management/blob/main/main.py"
click node_occupancy "https://github.com/arjundeokhile/smart-parking-space-management/blob/main/main.py"
click node_video_display "https://github.com/arjundeokhile/smart-parking-space-management/blob/main/main.py"
click node_polygons "https://github.com/arjundeokhile/smart-parking-space-management/blob/main/polygons.json"
click node_layout_editor "https://github.com/arjundeokhile/smart-parking-space-management/blob/main/main.py"
click node_dashboard_runtime "https://github.com/arjundeokhile/smart-parking-space-management/blob/main/dashboard.py"
click node_dashboard_data "https://github.com/arjundeokhile/smart-parking-space-management/blob/main/dashboard.py"
click node_dashboard_page "https://github.com/arjundeokhile/smart-parking-space-management/blob/main/templates/index.html"
click node_performance_graphs "https://github.com/arjundeokhile/smart-parking-space-management/blob/main/performance.py"
click node_logger "https://github.com/arjundeokhile/smart-parking-space-management/blob/main/loggerConfig.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_video,node_model,node_capture,node_vehicle_detection,node_center_calculation,node_polygon_test,node_occupancy,node_video_display toneBlue
class node_dashboard_runtime,node_dashboard_data,node_dashboard_page,node_performance_graphs,node_logger toneAmber
class node_polygons,node_layout_editor toneMint
class node_operator toneIndigo
```

## Components

### Detection and occupancy

- [Video input](https://github.com/arjundeokhile/smart-parking-space-management/blob/main/Input.mp4): `Input.mp4`
- [YOLO model](https://github.com/arjundeokhile/smart-parking-space-management/blob/main/best.pt): `best.pt`
- [Frame capture](https://github.com/arjundeokhile/smart-parking-space-management/blob/main/main.py): `main.py`
- [Vehicle tracking](https://github.com/arjundeokhile/smart-parking-space-management/blob/main/main.py): `main.py`
- [Vehicle centers](https://github.com/arjundeokhile/smart-parking-space-management/blob/main/main.py): `main.py`
- [Polygon testing](https://github.com/arjundeokhile/smart-parking-space-management/blob/main/main.py): `main.py`
- [Slot statistics](https://github.com/arjundeokhile/smart-parking-space-management/blob/main/main.py): `main.py`
- [Detection display](https://github.com/arjundeokhile/smart-parking-space-management/blob/main/main.py): `main.py`

### Dashboard and monitoring

- [Dashboard server](https://github.com/arjundeokhile/smart-parking-space-management/blob/main/dashboard.py): `dashboard.py`
- [Live statistics](https://github.com/arjundeokhile/smart-parking-space-management/blob/main/dashboard.py): `dashboard.py`
- [Dashboard page](https://github.com/arjundeokhile/smart-parking-space-management/blob/main/templates/index.html): `templates/index.html`
- [Performance graphs](https://github.com/arjundeokhile/smart-parking-space-management/blob/main/performance.py): `performance.py`
- [Central logging](https://github.com/arjundeokhile/smart-parking-space-management/blob/main/loggerConfig.py): `loggerConfig.py`

### Parking configuration

- [Parking layout](https://github.com/arjundeokhile/smart-parking-space-management/blob/main/polygons.json): `polygons.json`
- [Layout editor](https://github.com/arjundeokhile/smart-parking-space-management/blob/main/main.py): `main.py`

### Other components

- **Parking operator**

## Connections

- Video input → Frame capture: provides frames (evidence: `main.py`)
- Frame capture → Vehicle tracking: supplies frames (evidence: `main.py`)
- YOLO model → Vehicle tracking: tracks vehicles (evidence: `main.py`)
- Vehicle tracking → Vehicle centers: provides boxes (evidence: `main.py`)
- Vehicle centers → Polygon testing: tests centers (evidence: `main.py`)
- Parking layout → Polygon testing: defines regions (evidence: `main.py`)
- Polygon testing → Slot statistics: counts occupied (evidence: `main.py`)
- Slot statistics → Detection display: draws status (evidence: `main.py`)
- Slot statistics → Live statistics: updates statistics (evidence: `main.py`)
- Slot statistics → Performance graphs: updates graphs (evidence: `main.py`)
- Layout editor → Parking layout: saves layout (evidence: `main.py`)
- Parking layout → Layout editor: loads layout (evidence: `main.py`)
- Dashboard server → Live statistics: serves statistics (evidence: `dashboard.py`)
- Dashboard server → Dashboard page: renders page (evidence: `dashboard.py`)
- Dashboard server → Central logging: logs access (evidence: `dashboard.py`)
- Parking operator → Dashboard server: views dashboard (evidence: `readme.md`)
- Parking operator → Layout editor: defines slots (evidence: `readme.md`)
