# kavya98772/intelligent-parking architecture

> Architecture diagram of the GitHub repository kavya98772/intelligent-parking, 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/kavya98772/intelligent-parking
- Repository: https://github.com/kavya98772/intelligent-parking

## Overview

This repository combines a parking-lot occupancy analysis workflow with a browser-based parking view. The main workflow extracts a reference frame, lets an operator mark parking zones, processes video to detect occupied zones, and provides occupancy data and routing-related website assets. The sampled Python sources establish the frame, zone, and detector relationships; the README documents the website rebuild and video-update workflow. Website source behavior is not sampled, so its internal interactions are omitted.

Main entry points: [`Project Files/parking_core.py`](https://github.com/kavya98772/intelligent-parking/blob/main/Project%20Files/parking_core.py) (Occupancy analysis), [`Project Files/detector.py`](https://github.com/kavya98772/intelligent-parking/blob/main/Project%20Files/detector.py) (Video detector), [`Project Files/output.mp4`](https://github.com/kavya98772/intelligent-parking/blob/main/Project%20Files/output.mp4) (Annotated video), [`docs/source/extract_occupancy.py`](https://github.com/kavya98772/intelligent-parking/blob/main/docs/source/extract_occupancy.py) (Occupancy data extraction)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_setup["Lot setup"]
  node_frame["Reference frame extraction<br/>[frame_extractor.py]"]
  node_selector["Zone selection UI<br/>[parking_core.py]"]
  node_zones["Zone polygons"]
end

subgraph group_analysis["Video analysis"]
  node_detector["Video detector<br/>[detector.py]"]
  node_manager["Occupancy analysis<br/>[parking_core.py]"]
  node_annotated["Annotated video<br/>[output.mp4]"]
end

subgraph group_site["Parking website"]
  node_extractor["Occupancy data extraction"]
  node_occupancy["Occupancy data<br/>[occupancy.json]"]
  node_routing["Lot routing<br/>[routing.js]"]
end

node_operator(("Operator"))
node_video["Parking video"]
node_yolo["YOLO detection"]
node_browser(("Website visitor"))

node_operator -->|"extracts frame"| node_frame
node_video -->|"reads"| node_frame
node_operator -->|"marks zones"| node_selector
node_selector -->|"saves polygons"| node_zones
node_video -->|"provides frames"| node_detector
node_detector -->|"processes frames"| node_manager
node_manager -->|"loads polygons"| node_zones
node_manager -.->|"runs detection"| node_yolo
node_manager -->|"returns annotations"| node_annotated
node_detector -->|"writes video"| node_annotated
node_operator -->|"extracts occupancy"| node_extractor
node_annotated -->|"reads video"| node_extractor
node_extractor -->|"produces data"| node_occupancy
node_browser -.->|"uses routing"| node_routing

click node_frame "https://github.com/kavya98772/intelligent-parking/blob/main/Project%20Files/frame_extractor.py"
click node_selector "https://github.com/kavya98772/intelligent-parking/blob/main/Project%20Files/parking_core.py"
click node_zones "https://github.com/kavya98772/intelligent-parking/blob/main/Project%20Files/bounding_boxes.json"
click node_detector "https://github.com/kavya98772/intelligent-parking/blob/main/Project%20Files/detector.py"
click node_manager "https://github.com/kavya98772/intelligent-parking/blob/main/Project%20Files/parking_core.py"
click node_annotated "https://github.com/kavya98772/intelligent-parking/blob/main/Project%20Files/output.mp4"
click node_extractor "https://github.com/kavya98772/intelligent-parking/blob/main/docs/source/extract_occupancy.py"
click node_occupancy "https://github.com/kavya98772/intelligent-parking/blob/main/docs/source/data/occupancy.json"
click node_routing "https://github.com/kavya98772/intelligent-parking/blob/main/docs/source/routing.js"

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,node_selector,node_zones toneBlue
class node_detector,node_manager,node_annotated toneAmber
class node_extractor,node_occupancy,node_routing toneMint
class node_operator,node_video,node_yolo,node_browser toneIndigo
```

## Components

### Lot setup

- [Reference frame extraction](https://github.com/kavya98772/intelligent-parking/blob/main/Project%20Files/frame_extractor.py): `Project Files/frame_extractor.py`
- [Zone selection UI](https://github.com/kavya98772/intelligent-parking/blob/main/Project%20Files/parking_core.py): `Project Files/parking_core.py`
- [Zone polygons](https://github.com/kavya98772/intelligent-parking/blob/main/Project%20Files/bounding_boxes.json): `Project Files/bounding_boxes.json`

### Video analysis

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

### Parking website

- [Occupancy data extraction](https://github.com/kavya98772/intelligent-parking/blob/main/docs/source/extract_occupancy.py): `docs/source/extract_occupancy.py`
- [Occupancy data](https://github.com/kavya98772/intelligent-parking/blob/main/docs/source/data/occupancy.json): `docs/source/data/occupancy.json`
- [Lot routing](https://github.com/kavya98772/intelligent-parking/blob/main/docs/source/routing.js): `docs/source/routing.js`

### Other components

- **Operator**
- **Parking video**
- **YOLO detection**
- **Website visitor**

## Connections

- Operator → Reference frame extraction: extracts frame (evidence: `Project Files/frame_extractor.py`)
- Parking video → Reference frame extraction: reads (evidence: `Project Files/frame_extractor.py`)
- Operator → Zone selection UI: marks zones
- Zone selection UI → Zone polygons: saves polygons (evidence: `Project Files/parking_core.py`)
- Parking video → Video detector: provides frames (evidence: `Project Files/detector.py`)
- Video detector → Occupancy analysis: processes frames (evidence: `Project Files/detector.py`)
- Occupancy analysis → Zone polygons: loads polygons (evidence: `Project Files/parking_core.py`)
- Occupancy analysis → YOLO detection: runs detection
- Occupancy analysis → Annotated video: returns annotations
- Video detector → Annotated video: writes video (evidence: `Project Files/detector.py`)
- Operator → Occupancy data extraction: extracts occupancy
- Annotated video → Occupancy data extraction: reads video
- Occupancy data extraction → Occupancy data: produces data
- Website visitor → Lot routing: uses routing
