# adii11001/ppe-detection architecture

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

- Interactive diagram: https://gitdiagram.com/adii11001/ppe-detection
- Repository: https://github.com/adii11001/ppe-detection

## Overview

PPE-Detection is a Python computer-vision project for training and running an SSD Lite MobileNet V3 object detector on PPE-labeled images. Its visible workflow prepares YOLO-format image/box samples, batches them for model training, and runs inference to produce detections. The model module also provides validation, ONNX export, and performance-metric utilities; bounding-box visualization and IoU calculation are supporting capabilities. README documentation is minimal, so this map reflects the sampled source and listed files, not an assumed deployed application.

Main entry points: [`services/model/src/models/mobilenet_v3/mobilenet_v3.py`](https://github.com/adii11001/ppe-detection/blob/main/services/model/src/models/mobilenet_v3/mobilenet_v3.py) (SSD Lite model), [`services/model/src/datasets/yoloDataset.py`](https://github.com/adii11001/ppe-detection/blob/main/services/model/src/datasets/yoloDataset.py) (YOLO dataset), [`services/model/src/dataloaders/dataloader.py`](https://github.com/adii11001/ppe-detection/blob/main/services/model/src/dataloaders/dataloader.py) (Batch loader), [`services/model/src/visualization/bbox.py`](https://github.com/adii11001/ppe-detection/blob/main/services/model/src/visualization/bbox.py) (Box visualization)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_data["Data preparation"]
  node_dataset["YOLO dataset<br/>[yoloDataset.py]"]
  node_loader["Batch loader<br/>[dataloader.py]"]
end

subgraph group_model["Detection model"]
  node_detector["SSD Lite model<br/>[mobilenet_v3.py]"]
  node_onnx["ONNX model"]
  node_metrics["Model metrics<br/>[metrics.txt]"]
end

subgraph group_support["Inspection utilities"]
  node_bbox["Box visualization<br/>[bbox.py]"]
  node_iou["IoU utility<br/>[utils.py]"]
end

node_operator(("Model user"))

node_operator -->|"runs entry point"| node_detector
node_detector -->|"exports model"| node_onnx
node_detector -->|"writes metrics"| node_metrics
node_loader -->|"loads samples"| node_dataset
node_bbox -->|"reads sample"| node_dataset

click node_dataset "https://github.com/adii11001/ppe-detection/blob/main/services/model/src/datasets/yoloDataset.py"
click node_loader "https://github.com/adii11001/ppe-detection/blob/main/services/model/src/dataloaders/dataloader.py"
click node_detector "https://github.com/adii11001/ppe-detection/blob/main/services/model/src/models/mobilenet_v3/mobilenet_v3.py"
click node_onnx "https://github.com/adii11001/ppe-detection/blob/main/services/model/src/models/mobilenet_v3/ssdlite320_mobilenet_v3.onnx"
click node_metrics "https://github.com/adii11001/ppe-detection/blob/main/services/model/src/models/mobilenet_v3/metrics.txt"
click node_bbox "https://github.com/adii11001/ppe-detection/blob/main/services/model/src/visualization/bbox.py"
click node_iou "https://github.com/adii11001/ppe-detection/blob/main/services/model/src/utils.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_dataset,node_loader,node_operator toneBlue
class node_detector,node_onnx,node_metrics toneAmber
class node_bbox,node_iou toneMint
```

## Components

### Data preparation

- [YOLO dataset](https://github.com/adii11001/ppe-detection/blob/main/services/model/src/datasets/yoloDataset.py): `services/model/src/datasets/yoloDataset.py`
- [Batch loader](https://github.com/adii11001/ppe-detection/blob/main/services/model/src/dataloaders/dataloader.py): `services/model/src/dataloaders/dataloader.py`

### Detection model

- [SSD Lite model](https://github.com/adii11001/ppe-detection/blob/main/services/model/src/models/mobilenet_v3/mobilenet_v3.py): `services/model/src/models/mobilenet_v3/mobilenet_v3.py`
- [ONNX model](https://github.com/adii11001/ppe-detection/blob/main/services/model/src/models/mobilenet_v3/ssdlite320_mobilenet_v3.onnx): `services/model/src/models/mobilenet_v3/ssdlite320_mobilenet_v3.onnx`
- [Model metrics](https://github.com/adii11001/ppe-detection/blob/main/services/model/src/models/mobilenet_v3/metrics.txt): `services/model/src/models/mobilenet_v3/metrics.txt`

### Inspection utilities

- [Box visualization](https://github.com/adii11001/ppe-detection/blob/main/services/model/src/visualization/bbox.py): `services/model/src/visualization/bbox.py`
- [IoU utility](https://github.com/adii11001/ppe-detection/blob/main/services/model/src/utils.py): `services/model/src/utils.py`

### Other components

- **Model user**

## Connections

- Model user → SSD Lite model: runs entry point (evidence: `services/model/src/models/mobilenet_v3/mobilenet_v3.py`)
- SSD Lite model → ONNX model: exports model (evidence: `services/model/src/models/mobilenet_v3/mobilenet_v3.py`)
- SSD Lite model → Model metrics: writes metrics (evidence: `services/model/src/models/mobilenet_v3/mobilenet_v3.py`)
- Batch loader → YOLO dataset: loads samples (evidence: `services/model/src/dataloaders/dataloader.py`)
- Box visualization → YOLO dataset: reads sample (evidence: `services/model/src/visualization/bbox.py`)
