# mwasifanwar/autocv architecture

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

- Interactive diagram: https://gitdiagram.com/mwasifanwar/autocv
- Repository: https://github.com/mwasifanwar/autocv

## Overview

AutoCV is a command-line computer-vision training tool. Its evidenced workflow accepts a dataset, detects and validates its task, dispatches to classification or YOLO training, and reports metrics; it also offers a separate prediction path. The README describes broader automated optimization, export, visualization, and deployment capabilities, but the supplied tree and excerpts do not show implementations for those features, so they are not represented as runtime components. Edges reflect visible calls; documented but unverified capability links are omitted.

Main entry points: [`main.py`](https://github.com/mwasifanwar/autocv/blob/main/main.py) (Training CLI), [`trainers/classifier_trainer.py`](https://github.com/mwasifanwar/autocv/blob/main/trainers/classifier_trainer.py) (Classifier trainer), [`trainers/yolo_trainer.py`](https://github.com/mwasifanwar/autocv/blob/main/trainers/yolo_trainer.py) (YOLO trainer), [`utils/data_loader.py`](https://github.com/mwasifanwar/autocv/blob/main/utils/data_loader.py) (Prediction dispatch)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Command interface"]
  node_cli["Training CLI<br/>[main.py]"]
end

subgraph group_data["Dataset analysis"]
  node_task_detect["Task detection<br/>[data_loader.py]"]
  node_dataset_validate["Dataset validation<br/>[data_loader.py]"]
end

subgraph group_classification["Classification"]
  node_classifier["Classifier trainer"]
  node_class_data["Class data prep"]
  node_class_model["ResNet training"]
  node_class_metrics["Accuracy validation"]
end

subgraph group_detection["Object detection"]
  node_yolo["YOLO trainer<br/>[yolo_trainer.py]"]
  node_yolo_config["Detection data config<br/>[yolo_trainer.py]"]
  node_yolo_train["YOLO training<br/>[yolo_trainer.py]"]
  node_yolo_metrics["Detection metrics<br/>[yolo_trainer.py]"]
end

subgraph group_prediction["Inference"]
  node_prediction_dispatch["Prediction dispatch<br/>[data_loader.py]"]
  node_yolo_infer["YOLO inference<br/>[data_loader.py]"]
  node_class_infer["Classifier inference<br/>[data_loader.py]"]
end

node_user(("Dataset user"))
node_ultralytics["Ultralytics YOLO"]
node_image_dataset[("Image dataset")]
node_model_artifact["Saved model"]

node_user -->|"supplies options"| node_cli
node_cli -->|"detects task"| node_task_detect
node_cli -->|"validates dataset"| node_dataset_validate
node_cli -->|"dispatches classification"| node_classifier
node_cli -->|"dispatches detection"| node_yolo
node_cli -->|"runs prediction"| node_prediction_dispatch
node_task_detect -->|"inspects structure"| node_image_dataset
node_dataset_validate -->|"checks files"| node_image_dataset
node_classifier -->|"prepares datasets"| node_class_data
node_classifier -->|"trains model"| node_class_model
node_classifier -->|"validates model"| node_class_metrics
node_class_model -->|"saves weights"| node_model_artifact
node_yolo -->|"builds data config"| node_yolo_config
node_yolo -->|"starts training"| node_yolo_train
node_yolo_train -->|"trains with"| node_ultralytics
node_yolo -->|"extracts metrics"| node_yolo_metrics
node_prediction_dispatch -->|"selects YOLO"| node_yolo_infer
node_prediction_dispatch -->|"selects classifier"| node_class_infer
node_yolo_infer -->|"loads and predicts"| node_ultralytics

click node_cli "https://github.com/mwasifanwar/autocv/blob/main/main.py"
click node_task_detect "https://github.com/mwasifanwar/autocv/blob/main/utils/data_loader.py"
click node_dataset_validate "https://github.com/mwasifanwar/autocv/blob/main/utils/data_loader.py"
click node_classifier "https://github.com/mwasifanwar/autocv/blob/main/trainers/classifier_trainer.py"
click node_class_data "https://github.com/mwasifanwar/autocv/blob/main/trainers/classifier_trainer.py"
click node_class_model "https://github.com/mwasifanwar/autocv/blob/main/trainers/classifier_trainer.py"
click node_class_metrics "https://github.com/mwasifanwar/autocv/blob/main/trainers/classifier_trainer.py"
click node_yolo "https://github.com/mwasifanwar/autocv/blob/main/trainers/yolo_trainer.py"
click node_yolo_config "https://github.com/mwasifanwar/autocv/blob/main/trainers/yolo_trainer.py"
click node_yolo_train "https://github.com/mwasifanwar/autocv/blob/main/trainers/yolo_trainer.py"
click node_yolo_metrics "https://github.com/mwasifanwar/autocv/blob/main/trainers/yolo_trainer.py"
click node_prediction_dispatch "https://github.com/mwasifanwar/autocv/blob/main/utils/data_loader.py"
click node_yolo_infer "https://github.com/mwasifanwar/autocv/blob/main/utils/data_loader.py"
click node_class_infer "https://github.com/mwasifanwar/autocv/blob/main/utils/data_loader.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_cli,node_user toneBlue
class node_task_detect,node_dataset_validate,node_image_dataset toneAmber
class node_classifier,node_class_data,node_class_model,node_class_metrics toneMint
class node_yolo,node_yolo_config,node_yolo_train,node_yolo_metrics toneRose
class node_prediction_dispatch,node_yolo_infer,node_class_infer,node_ultralytics,node_model_artifact toneIndigo
```

## Components

### Command interface

- [Training CLI](https://github.com/mwasifanwar/autocv/blob/main/main.py): `main.py`

### Dataset analysis

- [Task detection](https://github.com/mwasifanwar/autocv/blob/main/utils/data_loader.py): `utils/data_loader.py`
- [Dataset validation](https://github.com/mwasifanwar/autocv/blob/main/utils/data_loader.py): `utils/data_loader.py`

### Classification

- [Classifier trainer](https://github.com/mwasifanwar/autocv/blob/main/trainers/classifier_trainer.py): `trainers/classifier_trainer.py`
- [Class data prep](https://github.com/mwasifanwar/autocv/blob/main/trainers/classifier_trainer.py): `trainers/classifier_trainer.py`
- [ResNet training](https://github.com/mwasifanwar/autocv/blob/main/trainers/classifier_trainer.py): `trainers/classifier_trainer.py`
- [Accuracy validation](https://github.com/mwasifanwar/autocv/blob/main/trainers/classifier_trainer.py): `trainers/classifier_trainer.py`

### Object detection

- [YOLO trainer](https://github.com/mwasifanwar/autocv/blob/main/trainers/yolo_trainer.py): `trainers/yolo_trainer.py`
- [Detection data config](https://github.com/mwasifanwar/autocv/blob/main/trainers/yolo_trainer.py): `trainers/yolo_trainer.py`
- [YOLO training](https://github.com/mwasifanwar/autocv/blob/main/trainers/yolo_trainer.py): `trainers/yolo_trainer.py`
- [Detection metrics](https://github.com/mwasifanwar/autocv/blob/main/trainers/yolo_trainer.py): `trainers/yolo_trainer.py`

### Inference

- [Prediction dispatch](https://github.com/mwasifanwar/autocv/blob/main/utils/data_loader.py): `utils/data_loader.py`
- [YOLO inference](https://github.com/mwasifanwar/autocv/blob/main/utils/data_loader.py): `utils/data_loader.py`
- [Classifier inference](https://github.com/mwasifanwar/autocv/blob/main/utils/data_loader.py): `utils/data_loader.py`

### Other components

- **Dataset user**
- **Ultralytics YOLO**
- **Image dataset**
- **Saved model**

## Connections

- Dataset user → Training CLI: supplies options (evidence: `main.py`)
- Training CLI → Task detection: detects task (evidence: `main.py`)
- Training CLI → Dataset validation: validates dataset (evidence: `main.py`)
- Training CLI → Classifier trainer: dispatches classification (evidence: `main.py`)
- Training CLI → YOLO trainer: dispatches detection (evidence: `main.py`)
- Training CLI → Prediction dispatch: runs prediction (evidence: `main.py`)
- Task detection → Image dataset: inspects structure (evidence: `utils/data_loader.py`)
- Dataset validation → Image dataset: checks files (evidence: `utils/data_loader.py`)
- Classifier trainer → Class data prep: prepares datasets (evidence: `trainers/classifier_trainer.py`)
- Classifier trainer → ResNet training: trains model (evidence: `trainers/classifier_trainer.py`)
- Classifier trainer → Accuracy validation: validates model (evidence: `trainers/classifier_trainer.py`)
- ResNet training → Saved model: saves weights (evidence: `trainers/classifier_trainer.py`)
- YOLO trainer → Detection data config: builds data config (evidence: `trainers/yolo_trainer.py`)
- YOLO trainer → YOLO training: starts training (evidence: `trainers/yolo_trainer.py`)
- YOLO training → Ultralytics YOLO: trains with (evidence: `trainers/yolo_trainer.py`)
- YOLO trainer → Detection metrics: extracts metrics (evidence: `trainers/yolo_trainer.py`)
- Prediction dispatch → YOLO inference: selects YOLO (evidence: `utils/data_loader.py`)
- Prediction dispatch → Classifier inference: selects classifier (evidence: `utils/data_loader.py`)
- YOLO inference → Ultralytics YOLO: loads and predicts (evidence: `utils/data_loader.py`)
