# shohruh72/yolov11 architecture

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

- Interactive diagram: https://gitdiagram.com/shohruh72/yolov11
- Repository: https://github.com/shohruh72/yolov11

## Overview

This repository is a PyTorch YOLOv11 object-detection application. Its principal workflow is training: the command-line entry point builds a dataset and augmentation pipeline, runs the detector and detection loss, then validates and reports metrics. The same entry point also exposes standalone validation and video inference, including detection visualization. The excerpts show the dataset, model, and utility implementations; other documented behavior is represented where supported, without assuming unseen wiring.

Main entry points: [`main.py`](https://github.com/shohruh72/yolov11/blob/master/main.py) (Video inference), [`utils/dataset.py`](https://github.com/shohruh72/yolov11/blob/master/utils/dataset.py) (Dataset loading), [`nets/nn.py`](https://github.com/shohruh72/yolov11/blob/master/nets/nn.py) (YOLO architectures), [`utils/util.py`](https://github.com/shohruh72/yolov11/blob/master/utils/util.py) (NMS and metrics)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Application flows"]
  node_entry["CLI entry<br/>[main.py]"]
  node_training["Training loop<br/>[main.py]"]
  node_validation["Validation<br/>[main.py]"]
  node_inference["Video inference<br/>[main.py]"]
  node_config["Runtime parameters<br/>[args.yaml]"]
end

subgraph group_data["Data preparation"]
  node_dataset["Dataset loading<br/>[dataset.py]"]
  node_augment["Augmentations<br/>[augment.py]"]
end

subgraph group_model["Detection model"]
  node_architecture["YOLO architectures<br/>[nn.py]"]
  node_checkpoint["Pretrained weights<br/>[v11_n.pt]"]
end

subgraph group_support["Training and evaluation"]
  node_loss["Detection loss<br/>[util.py]"]
  node_ema["EMA updates<br/>[util.py]"]
  node_postprocess["NMS and metrics<br/>[util.py]"]
  node_visualization["Detection drawing<br/>[util.py]"]
end

node_user(("User"))
node_coco["COCO dataset"]
node_video(("Video source"))
node_video_output["Rendered video"]

node_user -->|"selects mode"| node_entry
node_entry -->|"loads settings"| node_config
node_entry -->|"dispatches training"| node_training
node_entry -->|"dispatches validation"| node_validation
node_entry -->|"dispatches inference"| node_inference
node_training -->|"creates dataset"| node_dataset
node_validation -->|"uses validation data"| node_dataset
node_dataset -->|"reads images and labels"| node_coco
node_dataset -->|"builds transforms"| node_augment
node_training -->|"trains model"| node_architecture
node_training -->|"computes loss"| node_loss
node_training -->|"updates weights"| node_ema
node_training -->|"validates epochs"| node_validation
node_validation -->|"computes metrics"| node_postprocess
node_inference -->|"reads frames"| node_video
node_inference -->|"runs detector"| node_architecture
node_inference -->|"suppresses detections"| node_postprocess
node_inference -->|"draws boxes"| node_visualization
node_inference -->|"writes frames"| node_video_output
node_inference -.->|"loads pretrained weights"| node_checkpoint

click node_entry "https://github.com/shohruh72/yolov11/blob/master/main.py"
click node_training "https://github.com/shohruh72/yolov11/blob/master/main.py"
click node_validation "https://github.com/shohruh72/yolov11/blob/master/main.py"
click node_inference "https://github.com/shohruh72/yolov11/blob/master/main.py"
click node_dataset "https://github.com/shohruh72/yolov11/blob/master/utils/dataset.py"
click node_augment "https://github.com/shohruh72/yolov11/blob/master/utils/augment.py"
click node_architecture "https://github.com/shohruh72/yolov11/blob/master/nets/nn.py"
click node_checkpoint "https://github.com/shohruh72/yolov11/blob/master/weights/v11_n.pt"
click node_loss "https://github.com/shohruh72/yolov11/blob/master/utils/util.py"
click node_ema "https://github.com/shohruh72/yolov11/blob/master/utils/util.py"
click node_postprocess "https://github.com/shohruh72/yolov11/blob/master/utils/util.py"
click node_visualization "https://github.com/shohruh72/yolov11/blob/master/utils/util.py"
click node_config "https://github.com/shohruh72/yolov11/blob/master/utils/args.yaml"

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_entry,node_training,node_validation,node_inference,node_config,node_user toneBlue
class node_dataset,node_augment toneAmber
class node_architecture,node_checkpoint toneMint
class node_loss,node_ema,node_postprocess,node_visualization toneRose
class node_coco,node_video,node_video_output toneIndigo
```

## Components

### Application flows

- [CLI entry](https://github.com/shohruh72/yolov11/blob/master/main.py): `main.py`
- [Training loop](https://github.com/shohruh72/yolov11/blob/master/main.py): `main.py`
- [Validation](https://github.com/shohruh72/yolov11/blob/master/main.py): `main.py`
- [Video inference](https://github.com/shohruh72/yolov11/blob/master/main.py): `main.py`
- [Runtime parameters](https://github.com/shohruh72/yolov11/blob/master/utils/args.yaml): `utils/args.yaml`

### Data preparation

- [Dataset loading](https://github.com/shohruh72/yolov11/blob/master/utils/dataset.py): `utils/dataset.py`
- [Augmentations](https://github.com/shohruh72/yolov11/blob/master/utils/augment.py): `utils/augment.py`

### Detection model

- [YOLO architectures](https://github.com/shohruh72/yolov11/blob/master/nets/nn.py): `nets/nn.py`
- [Pretrained weights](https://github.com/shohruh72/yolov11/blob/master/weights/v11_n.pt): `weights/v11_n.pt`

### Training and evaluation

- [Detection loss](https://github.com/shohruh72/yolov11/blob/master/utils/util.py): `utils/util.py`
- [EMA updates](https://github.com/shohruh72/yolov11/blob/master/utils/util.py): `utils/util.py`
- [NMS and metrics](https://github.com/shohruh72/yolov11/blob/master/utils/util.py): `utils/util.py`
- [Detection drawing](https://github.com/shohruh72/yolov11/blob/master/utils/util.py): `utils/util.py`

### Other components

- **User**
- **COCO dataset**
- **Video source**
- **Rendered video**

## Connections

- User → CLI entry: selects mode (evidence: `README.md`)
- CLI entry → Runtime parameters: loads settings (evidence: `main.py`)
- CLI entry → Training loop: dispatches training (evidence: `main.py`)
- CLI entry → Validation: dispatches validation (evidence: `main.py`)
- CLI entry → Video inference: dispatches inference (evidence: `main.py`)
- Training loop → Dataset loading: creates dataset (evidence: `main.py`)
- Validation → Dataset loading: uses validation data (evidence: `main.py`)
- Dataset loading → COCO dataset: reads images and labels (evidence: `utils/dataset.py`)
- Dataset loading → Augmentations: builds transforms (evidence: `utils/dataset.py`)
- Training loop → YOLO architectures: trains model (evidence: `main.py`)
- Training loop → Detection loss: computes loss (evidence: `main.py`)
- Training loop → EMA updates: updates weights (evidence: `main.py`)
- Training loop → Validation: validates epochs (evidence: `main.py`)
- Validation → NMS and metrics: computes metrics (evidence: `main.py`)
- Video inference → Video source: reads frames (evidence: `main.py`)
- Video inference → YOLO architectures: runs detector (evidence: `main.py`)
- Video inference → NMS and metrics: suppresses detections (evidence: `main.py`)
- Video inference → Detection drawing: draws boxes (evidence: `main.py`)
- Video inference → Rendered video: writes frames (evidence: `main.py`)
- Video inference → Pretrained weights: loads pretrained weights
