# prajwalm75/ai-potholes-detection architecture

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

- Interactive diagram: https://gitdiagram.com/prajwalm75/ai-potholes-detection
- Repository: https://github.com/prajwalm75/ai-potholes-detection

## Overview

RoadGuard is a reproducible pothole-screening prototype with two deliverables: a Jupyter computer-vision workflow and a browser demonstration. The notebook workflow prepares RDD2022 data, trains a one-class YOLO detector, evaluates it, and supports image, batch, video, and webcam inference. The browser demo is a separate static presentation with an animated, human-review-oriented result; the README says it has no application API or database. The notebook contents were not sampled, so its internal stages and connections are based on README documentation rather than inspected notebook code.

Main entry points: [`web_demo/public/index.html`](https://github.com/prajwalm75/ai-potholes-detection/blob/main/web_demo/public/index.html) (Demo page and interaction), [`notebooks/AI_Potholes_Detection.ipynb`](https://github.com/prajwalm75/ai-potholes-detection/blob/main/notebooks/AI_Potholes_Detection.ipynb) (YOLO training), [`scripts/prepare_rdd2022.py`](https://github.com/prajwalm75/ai-potholes-detection/blob/main/scripts/prepare_rdd2022.py) (Dataset downloader and converter), [`data`](https://github.com/prajwalm75/ai-potholes-detection/tree/main/data) (YOLO dataset)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_prep["Dataset preparation"]
  node_converter["Dataset downloader and converter<br/>[prepare_rdd2022.py]"]
  node_prepared["YOLO dataset"]
end

subgraph group_ml["Model workflow"]
  node_notebook["Experiment notebook"]
  node_training["YOLO training"]
  node_evaluation["Validation metrics"]
  node_inference["Image and video inference"]
end

subgraph group_web["Browser demonstration"]
  node_server["Static file server<br/>[server.js]"]
  node_page["Demo page and interaction<br/>[index.html]"]
  node_interaction["Scan animation and review result<br/>[app.js]"]
  node_styles["Responsive presentation<br/>[styles.css]"]
  node_media["Pothole scan video<br/>[pothole-loop.mp4]"]
  node_imageconfig["Demo image configuration<br/>[app.config.ts]"]
end

node_inspector(("Inspector / operator"))
node_rdd["RDD2022 archive"]

node_inspector -->|"prepares data"| node_converter
node_rdd -->|"downloads archive"| node_converter
node_converter -->|"converts annotations"| node_prepared
node_inspector -->|"runs workflow"| node_notebook
node_notebook -->|"invokes preparation"| node_converter
node_notebook -->|"trains detector"| node_training
node_prepared -->|"supplies dataset"| node_training
node_training -->|"validates model"| node_evaluation
node_training -->|"uses trained model"| node_inference
node_inspector -->|"opens demo"| node_server
node_server -->|"serves files"| node_page
node_page -->|"runs interaction"| node_interaction
node_page -->|"uses styling"| node_styles
node_page -->|"shows scan video"| node_media
node_page -.->|"configures image"| node_imageconfig
node_interaction -->|"presents review result"| node_inspector

click node_converter "https://github.com/prajwalm75/ai-potholes-detection/blob/main/scripts/prepare_rdd2022.py"
click node_prepared "https://github.com/prajwalm75/ai-potholes-detection/tree/main/data"
click node_notebook "https://github.com/prajwalm75/ai-potholes-detection/blob/main/notebooks/AI_Potholes_Detection.ipynb"
click node_training "https://github.com/prajwalm75/ai-potholes-detection/blob/main/notebooks/AI_Potholes_Detection.ipynb"
click node_evaluation "https://github.com/prajwalm75/ai-potholes-detection/blob/main/notebooks/AI_Potholes_Detection.ipynb"
click node_inference "https://github.com/prajwalm75/ai-potholes-detection/blob/main/notebooks/AI_Potholes_Detection.ipynb"
click node_server "https://github.com/prajwalm75/ai-potholes-detection/blob/main/web_demo/server.js"
click node_page "https://github.com/prajwalm75/ai-potholes-detection/blob/main/web_demo/public/index.html"
click node_interaction "https://github.com/prajwalm75/ai-potholes-detection/blob/main/web_demo/public/app.js"
click node_styles "https://github.com/prajwalm75/ai-potholes-detection/blob/main/web_demo/public/styles.css"
click node_media "https://github.com/prajwalm75/ai-potholes-detection/blob/main/web_demo/public/pothole-loop.mp4"
click node_imageconfig "https://github.com/prajwalm75/ai-potholes-detection/blob/main/web_demo/app.config.ts"

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_converter,node_prepared toneBlue
class node_notebook,node_training,node_evaluation,node_inference toneAmber
class node_server,node_page,node_interaction,node_styles,node_media,node_imageconfig toneMint
class node_inspector,node_rdd toneIndigo
```

## Components

### Dataset preparation

- [Dataset downloader and converter](https://github.com/prajwalm75/ai-potholes-detection/blob/main/scripts/prepare_rdd2022.py): `scripts/prepare_rdd2022.py`
- [YOLO dataset](https://github.com/prajwalm75/ai-potholes-detection/tree/main/data): `data`

### Model workflow

- [Experiment notebook](https://github.com/prajwalm75/ai-potholes-detection/blob/main/notebooks/AI_Potholes_Detection.ipynb): `notebooks/AI_Potholes_Detection.ipynb`
- [YOLO training](https://github.com/prajwalm75/ai-potholes-detection/blob/main/notebooks/AI_Potholes_Detection.ipynb): `notebooks/AI_Potholes_Detection.ipynb`
- [Validation metrics](https://github.com/prajwalm75/ai-potholes-detection/blob/main/notebooks/AI_Potholes_Detection.ipynb): `notebooks/AI_Potholes_Detection.ipynb`
- [Image and video inference](https://github.com/prajwalm75/ai-potholes-detection/blob/main/notebooks/AI_Potholes_Detection.ipynb): `notebooks/AI_Potholes_Detection.ipynb`

### Browser demonstration

- [Static file server](https://github.com/prajwalm75/ai-potholes-detection/blob/main/web_demo/server.js): `web_demo/server.js`
- [Demo page and interaction](https://github.com/prajwalm75/ai-potholes-detection/blob/main/web_demo/public/index.html): `web_demo/public/index.html`
- [Scan animation and review result](https://github.com/prajwalm75/ai-potholes-detection/blob/main/web_demo/public/app.js): `web_demo/public/app.js`
- [Responsive presentation](https://github.com/prajwalm75/ai-potholes-detection/blob/main/web_demo/public/styles.css): `web_demo/public/styles.css`
- [Pothole scan video](https://github.com/prajwalm75/ai-potholes-detection/blob/main/web_demo/public/pothole-loop.mp4): `web_demo/public/pothole-loop.mp4`
- [Demo image configuration](https://github.com/prajwalm75/ai-potholes-detection/blob/main/web_demo/app.config.ts): `web_demo/app.config.ts`

### Other components

- **Inspector / operator**
- **RDD2022 archive**

## Connections

- Inspector / operator → Dataset downloader and converter: prepares data (evidence: `README.md`)
- RDD2022 archive → Dataset downloader and converter: downloads archive (evidence: `README.md`)
- Dataset downloader and converter → YOLO dataset: converts annotations (evidence: `README.md`)
- Inspector / operator → Experiment notebook: runs workflow (evidence: `README.md`)
- Experiment notebook → Dataset downloader and converter: invokes preparation (evidence: `README.md`)
- Experiment notebook → YOLO training: trains detector (evidence: `README.md`)
- YOLO dataset → YOLO training: supplies dataset (evidence: `README.md`)
- YOLO training → Validation metrics: validates model (evidence: `README.md`)
- YOLO training → Image and video inference: uses trained model (evidence: `README.md`)
- Inspector / operator → Static file server: opens demo (evidence: `README.md`)
- Static file server → Demo page and interaction: serves files (evidence: `web_demo/server.js`)
- Demo page and interaction → Scan animation and review result: runs interaction (evidence: `README.md`)
- Demo page and interaction → Responsive presentation: uses styling (evidence: `README.md`)
- Demo page and interaction → Pothole scan video: shows scan video (evidence: `README.md`)
- Demo page and interaction → Demo image configuration: configures image
- Scan animation and review result → Inspector / operator: presents review result (evidence: `README.md`)
