# Training Pipeline

## Files
- `src/train.py` (178 LOC)
- `src/augmentation.py` (152 LOC)
- `src/constants.py` (118 LOC)

## Current Flow

```mermaid
graph TD
    A[augmentation.py] -->|reads from| B[data_dir]
    A -->|writes to| C[processed_dir]
    D[train.py::form_dataset] -->|reads from| C
    D -->|shutil.copy to| E[datasets_dir/today/train,valid,test]
    F[train.py::train_dataset] -->|YOLO.train| E
```

## Issues
- External augmentation (albumentations) runs as separate step, writing to `processed_dir`
- `form_dataset()` copies files from `processed_dir` to dataset splits using `shutil.copy`
- YOLO has built-in augmentation that runs during training (mosaic, mixup, flips, etc.)
- Using built-in aug eliminates need for `processed_dir` and the full `augmentation.py` pipeline
- `copy_annotations()` uses `shutil.copy` — wasteful for large datasets
- Global mutable `total_files_copied` variable in `copy_annotations`
- Model config `yolo11m.yaml` trains from scratch; likely should use pretrained weights or updated variant
