# Replace External Augmentation with YOLO Built-in

**Task**: AZ-167_refactor_builtin_augmentation
**Name**: Replace external augmentation with YOLO built-in
**Description**: Remove albumentations pipeline and use YOLO model.train() built-in augmentation parameters
**Complexity**: 3 points
**Dependencies**: AZ-166_refactor_yolo_model
**Component**: Training Pipeline
**Tracker**: AZ-167
**Epic**: AZ-164

## Problem

`augmentation.py` uses the `albumentations` library to augment images into a `processed_dir` before training. This creates a separate processing step, uses extra disk space (8x original), and adds complexity. YOLO's built-in augmentation applies on-the-fly during training.

## Outcome

- `train_dataset()` passes augmentation parameters directly to `model.train()`
- Each augmentation parameter is on its own line with a descriptive comment
- The external augmentation step is removed from the training pipeline
- `augmentation.py` is no longer called during training

## Scope

### Included
- Add YOLO built-in augmentation parameters to `model.train()` call in `train_dataset()`
- Parameters to add: hsv_h, hsv_s, hsv_v, degrees, translate, scale, shear, fliplr, mosaic (each with comment)
- Remove call to augmentation from training flow

### Excluded
- Deleting `augmentation.py` file (may still be useful standalone)
- Changing training hyperparameters unrelated to augmentation

## Acceptance Criteria

**AC-1: Built-in augmentation parameters with comments**
Given the `train_dataset()` function
When `model.train()` is called
Then every parameter (including augmentation: hsv_h, hsv_s, hsv_v, degrees, scale, shear, fliplr, mosaic, and training: data, epochs, batch, imgsz, etc.) is on its own line with an inline comment explaining what the parameter controls

**AC-2: No external augmentation in training flow**
Given the training pipeline
When `train_dataset()` runs
Then it does not call `augment_annotations()` or any albumentations-based augmentation

## Constraints

- Every parameter row in the `model.train()` call MUST have an inline comment describing what it does (e.g. `hsv_h=0.015,  # hue shift fraction of the color wheel`)
- This applies to ALL parameters, not just augmentation — training params (data, epochs, batch, imgsz, save_period, workers) also need comments
- Augmentation parameter values should approximate the current albumentations settings:
  - fliplr=0.6 (was HorizontalFlip p=0.6)
  - degrees=35.0 (was Affine rotate=(-35,35))
  - shear=10.0 (was Affine shear=(-10,10))
  - hsv_h=0.015, hsv_s=0.7, hsv_v=0.4 (approximate HSV shifts)
  - mosaic=1.0 (new YOLO built-in, recommended default)
