# anukavb/intelligent-parking architecture

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

- Interactive diagram: https://gitdiagram.com/anukavb/intelligent-parking
- Repository: https://github.com/anukavb/intelligent-parking

## Overview

This repository turns parking-lot video into annotated occupancy footage and provides a browser-based occupancy website. The documented workflow extracts a reference frame, defines parking zones, detects cars and writes annotated video; the website has a separate data-extraction and routing branch. The sampled Python shows the detector’s processing calls and zone persistence. Website implementation details and several connections are documented or visible only from filenames, so those links are marked unverified where appropriate.

Main entry points: [`Project Files/detector.py`](https://github.com/anukavb/intelligent-parking/blob/main/Project%20Files/detector.py) (Video detector), [`Project Files/parking_core.py`](https://github.com/anukavb/intelligent-parking/blob/main/Project%20Files/parking_core.py) (Occupancy analysis), [`Project Files/frame_extractor.py`](https://github.com/anukavb/intelligent-parking/blob/main/Project%20Files/frame_extractor.py) (Reference frame extraction), [`docs/index.html`](https://github.com/anukavb/intelligent-parking/blob/main/docs/index.html) (Occupancy website)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_setup["Zone setup"]
  node_frame_extraction["Reference frame extraction<br/>[frame_extractor.py]"]
  node_reference_frame["Reference image"]
  node_zone_gui["Zone selection GUI<br/>[parking_core.py]"]
  node_zone_launcher["Zone selector launcher<br/>[zone_selector.py]"]
  node_zone_data[("Zone definitions")]
end

subgraph group_monitor["Occupancy monitoring"]
  node_detector["Video detector<br/>[detector.py]"]
  node_occupancy_engine["Occupancy analysis<br/>[parking_core.py]"]
  node_yolo["YOLO detection"]
  node_annotated_video["Annotated video<br/>[output.mp4]"]
end

subgraph group_site["Website"]
  node_site_extractor["Occupancy data extraction"]
  node_site_data[("Website occupancy data<br/>[occupancy.json]")]
  node_site_zones[("Website zone data")]
  node_site_routing["Lot routing<br/>[routing.js]"]
  node_website["Occupancy website<br/>[index.html]"]
  node_site_builder["Website builder<br/>[build.py]"]
end

node_operator(("Operator"))
node_lot_video["Lot video"]

node_operator -->|"extracts frame"| node_frame_extraction
node_lot_video -->|"reads video"| node_frame_extraction
node_frame_extraction -->|"saves image"| node_reference_frame
node_operator -->|"launches"| node_zone_launcher
node_zone_launcher -->|"starts"| node_zone_gui
node_zone_gui -->|"saves zones"| node_zone_data
node_reference_frame -.->|"defines zones on"| node_zone_gui
node_operator -->|"runs"| node_detector
node_lot_video -->|"reads frames"| node_detector
node_detector -->|"processes frames"| node_occupancy_engine
node_occupancy_engine -->|"loads zones"| node_zone_data
node_occupancy_engine -.->|"detects cars"| node_yolo
node_detector -->|"writes frames"| node_annotated_video
node_operator -->|"extracts website data"| node_site_extractor
node_site_extractor -.->|"writes occupancy"| node_site_data
node_site_zones -.->|"informs routing"| node_site_routing
node_site_data -.->|"supplies occupancy"| node_website
node_site_routing -.->|"provides routing"| node_website
node_operator -->|"builds website"| node_site_builder
node_site_builder -.->|"generates"| node_website

click node_frame_extraction "https://github.com/anukavb/intelligent-parking/blob/main/Project%20Files/frame_extractor.py"
click node_zone_gui "https://github.com/anukavb/intelligent-parking/blob/main/Project%20Files/parking_core.py"
click node_zone_launcher "https://github.com/anukavb/intelligent-parking/blob/main/Project%20Files/zone_selector.py"
click node_zone_data "https://github.com/anukavb/intelligent-parking/blob/main/Project%20Files/bounding_boxes.json"
click node_detector "https://github.com/anukavb/intelligent-parking/blob/main/Project%20Files/detector.py"
click node_occupancy_engine "https://github.com/anukavb/intelligent-parking/blob/main/Project%20Files/parking_core.py"
click node_annotated_video "https://github.com/anukavb/intelligent-parking/blob/main/Project%20Files/output.mp4"
click node_site_extractor "https://github.com/anukavb/intelligent-parking/blob/main/docs/source/extract_occupancy.py"
click node_site_data "https://github.com/anukavb/intelligent-parking/blob/main/docs/source/data/occupancy.json"
click node_site_zones "https://github.com/anukavb/intelligent-parking/blob/main/docs/source/data/bounding_boxes.json"
click node_site_routing "https://github.com/anukavb/intelligent-parking/blob/main/docs/source/routing.js"
click node_website "https://github.com/anukavb/intelligent-parking/blob/main/docs/index.html"
click node_site_builder "https://github.com/anukavb/intelligent-parking/blob/main/docs/source/build.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_frame_extraction,node_reference_frame,node_zone_gui,node_zone_launcher,node_zone_data toneBlue
class node_detector,node_occupancy_engine,node_yolo,node_annotated_video toneAmber
class node_site_extractor,node_site_data,node_site_zones,node_site_routing,node_website,node_site_builder toneMint
class node_operator,node_lot_video toneIndigo
```

## Components

### Zone setup

- [Reference frame extraction](https://github.com/anukavb/intelligent-parking/blob/main/Project%20Files/frame_extractor.py): `Project Files/frame_extractor.py`
- **Reference image**
- [Zone selection GUI](https://github.com/anukavb/intelligent-parking/blob/main/Project%20Files/parking_core.py): `Project Files/parking_core.py`
- [Zone selector launcher](https://github.com/anukavb/intelligent-parking/blob/main/Project%20Files/zone_selector.py): `Project Files/zone_selector.py`
- [Zone definitions](https://github.com/anukavb/intelligent-parking/blob/main/Project%20Files/bounding_boxes.json): `Project Files/bounding_boxes.json`

### Occupancy monitoring

- [Video detector](https://github.com/anukavb/intelligent-parking/blob/main/Project%20Files/detector.py): `Project Files/detector.py`
- [Occupancy analysis](https://github.com/anukavb/intelligent-parking/blob/main/Project%20Files/parking_core.py): `Project Files/parking_core.py`
- **YOLO detection**
- [Annotated video](https://github.com/anukavb/intelligent-parking/blob/main/Project%20Files/output.mp4): `Project Files/output.mp4`

### Website

- [Occupancy data extraction](https://github.com/anukavb/intelligent-parking/blob/main/docs/source/extract_occupancy.py): `docs/source/extract_occupancy.py`
- [Website occupancy data](https://github.com/anukavb/intelligent-parking/blob/main/docs/source/data/occupancy.json): `docs/source/data/occupancy.json`
- [Website zone data](https://github.com/anukavb/intelligent-parking/blob/main/docs/source/data/bounding_boxes.json): `docs/source/data/bounding_boxes.json`
- [Lot routing](https://github.com/anukavb/intelligent-parking/blob/main/docs/source/routing.js): `docs/source/routing.js`
- [Occupancy website](https://github.com/anukavb/intelligent-parking/blob/main/docs/index.html): `docs/index.html`
- [Website builder](https://github.com/anukavb/intelligent-parking/blob/main/docs/source/build.py): `docs/source/build.py`

### Other components

- **Operator**
- **Lot video**

## Connections

- Operator → Reference frame extraction: extracts frame (evidence: `Project Files/frame_extractor.py`)
- Lot video → Reference frame extraction: reads video (evidence: `Project Files/frame_extractor.py`)
- Reference frame extraction → Reference image: saves image (evidence: `Project Files/frame_extractor.py`)
- Operator → Zone selector launcher: launches (evidence: `Project Files/zone_selector.py`)
- Zone selector launcher → Zone selection GUI: starts (evidence: `Project Files/zone_selector.py`)
- Zone selection GUI → Zone definitions: saves zones (evidence: `Project Files/parking_core.py`)
- Reference image → Zone selection GUI: defines zones on
- Operator → Video detector: runs (evidence: `Project Files/detector.py`)
- Lot video → Video detector: reads frames (evidence: `Project Files/detector.py`)
- Video detector → Occupancy analysis: processes frames (evidence: `Project Files/detector.py`)
- Occupancy analysis → Zone definitions: loads zones (evidence: `Project Files/parking_core.py`)
- Occupancy analysis → YOLO detection: detects cars
- Video detector → Annotated video: writes frames (evidence: `Project Files/detector.py`)
- Operator → Occupancy data extraction: extracts website data
- Occupancy data extraction → Website occupancy data: writes occupancy
- Website zone data → Lot routing: informs routing
- Website occupancy data → Occupancy website: supplies occupancy
- Lot routing → Occupancy website: provides routing
- Operator → Website builder: builds website
- Website builder → Occupancy website: generates
