# faizan-nawaz/objectdetectionandtracking architecture

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

- Interactive diagram: https://gitdiagram.com/faizan-nawaz/objectdetectionandtracking
- Repository: https://github.com/faizan-nawaz/objectdetectionandtracking

## Overview

This is a small video object-detection and tracking script: it reads a video, tracks objects frame by frame, overlays annotations and statistics, then writes and displays the processed frames. The README is empty, so the map reflects only the sampled `main.py`; the model and OpenCV are external dependencies, not repository modules.

Main entry points: [`main.py`](https://github.com/faizan-nawaz/objectdetectionandtracking/blob/main/main.py) (Video processor), [`videos/test.mp4`](https://github.com/faizan-nawaz/objectdetectionandtracking/blob/main/videos/test.mp4) (Input video), [`outputs/tracked_output.mp4`](https://github.com/faizan-nawaz/objectdetectionandtracking/blob/main/outputs/tracked_output.mp4) (Tracked video)

## Diagram (Mermaid)

```mermaid
flowchart TD

node_user(("User"))
node_runner["Video processor<br/>[main.py]"]
node_input["Input video<br/>[test.mp4]"]
node_tracker["YOLO tracker"]
node_annotation["Frame annotation<br/>[main.py]"]
node_metrics["Processing statistics<br/>[main.py]"]
node_output["Tracked video<br/>[tracked_output.mp4]"]
node_display["Live preview<br/>[main.py]"]

node_runner -->|"reads frames"| node_input
node_runner -->|"tracks frames"| node_tracker
node_runner -->|"annotates frames"| node_annotation
node_runner -->|"calculates stats"| node_metrics
node_runner -->|"writes frames"| node_output
node_runner -->|"shows frames"| node_display
node_user -->|"stops processing"| node_runner

click node_runner "https://github.com/faizan-nawaz/objectdetectionandtracking/blob/main/main.py"
click node_input "https://github.com/faizan-nawaz/objectdetectionandtracking/blob/main/videos/test.mp4"
click node_annotation "https://github.com/faizan-nawaz/objectdetectionandtracking/blob/main/main.py"
click node_metrics "https://github.com/faizan-nawaz/objectdetectionandtracking/blob/main/main.py"
click node_output "https://github.com/faizan-nawaz/objectdetectionandtracking/blob/main/outputs/tracked_output.mp4"
click node_display "https://github.com/faizan-nawaz/objectdetectionandtracking/blob/main/main.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_user,node_display toneBlue
class node_runner,node_input,node_annotation,node_metrics,node_output toneTeal
class node_tracker toneIndigo
```

## Components

### Other components

- **User**
- [Video processor](https://github.com/faizan-nawaz/objectdetectionandtracking/blob/main/main.py): `main.py`
- [Input video](https://github.com/faizan-nawaz/objectdetectionandtracking/blob/main/videos/test.mp4): `videos/test.mp4`
- **YOLO tracker**
- [Frame annotation](https://github.com/faizan-nawaz/objectdetectionandtracking/blob/main/main.py): `main.py`
- [Processing statistics](https://github.com/faizan-nawaz/objectdetectionandtracking/blob/main/main.py): `main.py`
- [Tracked video](https://github.com/faizan-nawaz/objectdetectionandtracking/blob/main/outputs/tracked_output.mp4): `outputs/tracked_output.mp4`
- [Live preview](https://github.com/faizan-nawaz/objectdetectionandtracking/blob/main/main.py): `main.py`

## Connections

- Video processor → Input video: reads frames (evidence: `main.py`)
- Video processor → YOLO tracker: tracks frames (evidence: `main.py`)
- Video processor → Frame annotation: annotates frames (evidence: `main.py`)
- Video processor → Processing statistics: calculates stats (evidence: `main.py`)
- Video processor → Tracked video: writes frames (evidence: `main.py`)
- Video processor → Live preview: shows frames (evidence: `main.py`)
- User → Video processor: stops processing (evidence: `main.py`)
