# august0362/wheat-detection-kaggle- architecture

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

- Interactive diagram: https://gitdiagram.com/august0362/wheat-detection-kaggle-
- Repository: https://github.com/august0362/wheat-detection-kaggle-

## Overview

This repository is a YOLOv8 wheat-head detection pipeline. Its main path prepares and splits annotated images into YOLO format, trains the model with custom augmentation and competition-score evaluation, and produces a Kaggle submission from trained weights. Training also emits metric and visualization outputs. The README documents an offline Kaggle packaging capability, represented as a separate branch. Source excerpts establish the principal training calls; less-visible inference-to-model details are grounded in README workflow documentation.

Main entry points: [`src/train.py`](https://github.com/august0362/wheat-detection-kaggle-/blob/main/src/train.py) (YOLO training), [`src/data_prep.py`](https://github.com/august0362/wheat-detection-kaggle-/blob/main/src/data_prep.py) (YOLO dataset builder), [`src/infer.py`](https://github.com/august0362/wheat-detection-kaggle-/blob/main/src/infer.py) (Test inference), [`configs`](https://github.com/august0362/wheat-detection-kaggle-/tree/main/configs) (Run configuration)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_data["Data preparation"]
  node_data_prep["YOLO dataset builder<br/>[data_prep.py]"]
  node_shared_utils["Config and box utilities<br/>[utils.py]"]
  node_yolo_dataset[("YOLO images and labels")]
end

subgraph group_training["Model training"]
  node_augmentations["Custom augmentation<br/>[augmentations.py]"]
  node_trainer["YOLO training<br/>[train.py]"]
  node_yolo_model["Ultralytics YOLO"]
  node_checkpoint["Model weights"]
end

subgraph group_results["Evaluation and outputs"]
  node_metric_eval["Competition metric<br/>[evaluator.py]"]
  node_metric_history["Metric history"]
  node_visualization["Training visualizations<br/>[visualize.py]"]
  node_training_artifacts["Training plots"]
end

subgraph group_submission["Inference and delivery"]
  node_inference["Test inference<br/>[infer.py]"]
  node_submission_csv["Kaggle submission"]
  node_deploy_packager["Offline bundle packager<br/>[deploy_kaggle.py]"]
  node_offline_bundle["Offline Kaggle bundle"]
end

node_user(("Pipeline operator"))
node_competition_data[("Competition data")]
node_configs["Run configuration"]
node_test_images[("Test images")]
node_kaggle(("Kaggle Notebook"))

node_user -->|"selects settings"| node_configs
node_competition_data -->|"provides annotations"| node_data_prep
node_configs -->|"configures"| node_data_prep
node_data_prep -->|"converts boxes"| node_shared_utils
node_data_prep -->|"writes dataset"| node_yolo_dataset
node_user -->|"starts training"| node_trainer
node_trainer -->|"loads settings"| node_configs
node_trainer -->|"builds dataset"| node_data_prep
node_yolo_dataset -->|"supplies training data"| node_trainer
node_trainer -->|"patches augmentation"| node_augmentations
node_trainer -->|"trains model"| node_yolo_model
node_yolo_model -->|"saves weights"| node_checkpoint
node_trainer -->|"evaluates predictions"| node_metric_eval
node_trainer -->|"records scores"| node_metric_history
node_trainer -->|"generates plots"| node_visualization
node_visualization -->|"writes plots"| node_training_artifacts
node_user -->|"runs inference"| node_inference
node_configs -->|"configures"| node_inference
node_checkpoint -->|"loads weights"| node_inference
node_test_images -->|"provides images"| node_inference
node_inference -->|"writes submission"| node_submission_csv
node_user -->|"packages release"| node_deploy_packager
node_checkpoint -->|"includes weights"| node_deploy_packager
node_deploy_packager -->|"builds bundle"| node_offline_bundle
node_offline_bundle -->|"provides offline input"| node_kaggle

click node_configs "https://github.com/august0362/wheat-detection-kaggle-/tree/main/configs"
click node_data_prep "https://github.com/august0362/wheat-detection-kaggle-/blob/main/src/data_prep.py"
click node_shared_utils "https://github.com/august0362/wheat-detection-kaggle-/blob/main/src/utils.py"
click node_augmentations "https://github.com/august0362/wheat-detection-kaggle-/blob/main/src/augmentations.py"
click node_trainer "https://github.com/august0362/wheat-detection-kaggle-/blob/main/src/train.py"
click node_metric_eval "https://github.com/august0362/wheat-detection-kaggle-/blob/main/src/metrics/evaluator.py"
click node_visualization "https://github.com/august0362/wheat-detection-kaggle-/blob/main/src/visualize.py"
click node_inference "https://github.com/august0362/wheat-detection-kaggle-/blob/main/src/infer.py"
click node_deploy_packager "https://github.com/august0362/wheat-detection-kaggle-/blob/main/scripts/deploy_kaggle.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_data_prep,node_shared_utils,node_yolo_dataset toneBlue
class node_augmentations,node_trainer,node_yolo_model,node_checkpoint,node_competition_data,node_test_images toneAmber
class node_metric_eval,node_metric_history,node_visualization,node_training_artifacts toneMint
class node_inference,node_submission_csv,node_deploy_packager,node_offline_bundle toneRose
class node_user,node_kaggle toneIndigo
class node_configs toneTeal
```

## Components

### Data preparation

- [YOLO dataset builder](https://github.com/august0362/wheat-detection-kaggle-/blob/main/src/data_prep.py): `src/data_prep.py`
- [Config and box utilities](https://github.com/august0362/wheat-detection-kaggle-/blob/main/src/utils.py): `src/utils.py`
- **YOLO images and labels**

### Model training

- [Custom augmentation](https://github.com/august0362/wheat-detection-kaggle-/blob/main/src/augmentations.py): `src/augmentations.py`
- [YOLO training](https://github.com/august0362/wheat-detection-kaggle-/blob/main/src/train.py): `src/train.py`
- **Ultralytics YOLO**
- **Model weights**

### Evaluation and outputs

- [Competition metric](https://github.com/august0362/wheat-detection-kaggle-/blob/main/src/metrics/evaluator.py): `src/metrics/evaluator.py`
- **Metric history**
- [Training visualizations](https://github.com/august0362/wheat-detection-kaggle-/blob/main/src/visualize.py): `src/visualize.py`
- **Training plots**

### Inference and delivery

- [Test inference](https://github.com/august0362/wheat-detection-kaggle-/blob/main/src/infer.py): `src/infer.py`
- **Kaggle submission**
- [Offline bundle packager](https://github.com/august0362/wheat-detection-kaggle-/blob/main/scripts/deploy_kaggle.py): `scripts/deploy_kaggle.py`
- **Offline Kaggle bundle**

### Other components

- **Pipeline operator**
- **Competition data**
- [Run configuration](https://github.com/august0362/wheat-detection-kaggle-/tree/main/configs): `configs`
- **Test images**
- **Kaggle Notebook**

## Connections

- Pipeline operator → Run configuration: selects settings (evidence: `README.md`)
- Competition data → YOLO dataset builder: provides annotations (evidence: `README.md`)
- Run configuration → YOLO dataset builder: configures (evidence: `src/data_prep.py`)
- YOLO dataset builder → Config and box utilities: converts boxes (evidence: `src/data_prep.py`)
- YOLO dataset builder → YOLO images and labels: writes dataset (evidence: `src/data_prep.py`)
- Pipeline operator → YOLO training: starts training (evidence: `README.md`)
- YOLO training → Run configuration: loads settings (evidence: `src/train.py`)
- YOLO training → YOLO dataset builder: builds dataset (evidence: `README.md`)
- YOLO images and labels → YOLO training: supplies training data (evidence: `README.md`)
- YOLO training → Custom augmentation: patches augmentation (evidence: `src/train.py`)
- YOLO training → Ultralytics YOLO: trains model (evidence: `src/train.py`)
- Ultralytics YOLO → Model weights: saves weights (evidence: `README.md`)
- YOLO training → Competition metric: evaluates predictions (evidence: `src/train.py`)
- YOLO training → Metric history: records scores (evidence: `README.md`)
- YOLO training → Training visualizations: generates plots (evidence: `src/train.py`)
- Training visualizations → Training plots: writes plots (evidence: `README.md`)
- Pipeline operator → Test inference: runs inference (evidence: `README.md`)
- Run configuration → Test inference: configures (evidence: `src/infer.py`)
- Model weights → Test inference: loads weights (evidence: `README.md`)
- Test images → Test inference: provides images (evidence: `README.md`)
- Test inference → Kaggle submission: writes submission (evidence: `src/infer.py`)
- Pipeline operator → Offline bundle packager: packages release (evidence: `README.md`)
- Model weights → Offline bundle packager: includes weights (evidence: `scripts/deploy_kaggle.py`)
- Offline bundle packager → Offline Kaggle bundle: builds bundle (evidence: `scripts/deploy_kaggle.py`)
- Offline Kaggle bundle → Kaggle Notebook: provides offline input (evidence: `README.md`)
