# surya2324/object-detection architecture

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

- Interactive diagram: https://gitdiagram.com/surya2324/object-detection
- Repository: https://github.com/surya2324/object-detection

## Overview

This is a small real-time object-detection application. The workflow starts in `model_data/main.py`, which validates the configured inputs and creates a detector; `model_data/Detector.py` loads the model and class labels, captures frames, detects and filters objects, annotates the frames, and displays them. The entry point uses camera index 0; the sample videos are present in the tree but are not wired into the shown workflow. OpenCV behavior is inferred from the inspected calls.

Main entry points: [`model_data/Detector.py`](https://github.com/surya2324/object-detection/blob/main/model_data/Detector.py) (Video detector), [`model_data/main.py`](https://github.com/surya2324/object-detection/blob/main/model_data/main.py) (Application entry), [`model_data/frozen_inference_graph.pb`](https://github.com/surya2324/object-detection/blob/main/model_data/frozen_inference_graph.pb) (Detection model), [`model_data/ssd_mobilenet_v3_large_coco_2020_01_14.pbtxt`](https://github.com/surya2324/object-detection/blob/main/model_data/ssd_mobilenet_v3_large_coco_2020_01_14.pbtxt) (Model config)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Application entry"]
  node_main["Application entry<br/>[main.py]"]
end

subgraph group_detection["Detection runtime"]
  node_detector["Video detector<br/>[Detector.py]"]
  node_opencv["OpenCV"]
end

subgraph group_assets["Detection assets"]
  node_model["Detection model"]
  node_config["Model config"]
  node_labels["Class labels<br/>[coco.names]"]
end

node_user(("User"))
node_video(("Camera input"))
node_display["Result window"]

node_user -->|"starts"| node_main
node_main -->|"validates path"| node_model
node_main -->|"validates path"| node_config
node_main -->|"validates path"| node_labels
node_main -->|"creates"| node_detector
node_detector -->|"initializes DNN"| node_opencv
node_detector -->|"loads weights"| node_model
node_detector -->|"loads config"| node_config
node_detector -->|"reads labels"| node_labels
node_detector -->|"captures frames"| node_opencv
node_video -->|"provides frames"| node_opencv
node_detector -->|"detects and filters"| node_opencv
node_detector -->|"annotates frames"| node_opencv
node_detector -->|"shows frames"| node_display

click node_main "https://github.com/surya2324/object-detection/blob/main/model_data/main.py"
click node_detector "https://github.com/surya2324/object-detection/blob/main/model_data/Detector.py"
click node_model "https://github.com/surya2324/object-detection/blob/main/model_data/frozen_inference_graph.pb"
click node_config "https://github.com/surya2324/object-detection/blob/main/model_data/ssd_mobilenet_v3_large_coco_2020_01_14.pbtxt"
click node_labels "https://github.com/surya2324/object-detection/blob/main/model_data/coco.names"

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_main,node_user toneBlue
class node_detector,node_opencv toneAmber
class node_model,node_config,node_labels toneMint
class node_video,node_display toneIndigo
```

## Components

### Application entry

- [Application entry](https://github.com/surya2324/object-detection/blob/main/model_data/main.py): `model_data/main.py`

### Detection runtime

- [Video detector](https://github.com/surya2324/object-detection/blob/main/model_data/Detector.py): `model_data/Detector.py`
- **OpenCV**

### Detection assets

- [Detection model](https://github.com/surya2324/object-detection/blob/main/model_data/frozen_inference_graph.pb): `model_data/frozen_inference_graph.pb`
- [Model config](https://github.com/surya2324/object-detection/blob/main/model_data/ssd_mobilenet_v3_large_coco_2020_01_14.pbtxt): `model_data/ssd_mobilenet_v3_large_coco_2020_01_14.pbtxt`
- [Class labels](https://github.com/surya2324/object-detection/blob/main/model_data/coco.names): `model_data/coco.names`

### Other components

- **User**
- **Camera input**
- **Result window**

## Connections

- User → Application entry: starts
- Application entry → Detection model: validates path
- Application entry → Model config: validates path
- Application entry → Class labels: validates path
- Application entry → Video detector: creates
- Video detector → OpenCV: initializes DNN
- Video detector → Detection model: loads weights
- Video detector → Model config: loads config
- Video detector → Class labels: reads labels
- Video detector → OpenCV: captures frames
- Camera input → OpenCV: provides frames
- Video detector → OpenCV: detects and filters
- Video detector → OpenCV: annotates frames
- Video detector → Result window: shows frames
