# Update YOLO Model

**Task**: AZ-166_refactor_yolo_model
**Name**: Update YOLO model to 26m variant (supports both from-scratch and pretrained)
**Description**: Update model references from YOLO11m to YOLO26m; support both training from scratch (`.yaml`) and from pretrained weights (`.pt`)
**Complexity**: 2 points
**Dependencies**: None
**Component**: Training Pipeline
**Tracker**: AZ-166
**Epic**: AZ-164

## Problem

Current `TrainingConfig.model` is set to `yolo11m.yaml` which defines a YOLO11 architecture. YOLO26m is the latest model variant. The system should support both training modes:
1. **From scratch** — using `yolo26m.yaml` (architecture definition, trains from random weights)
2. **From pretrained** — using `yolo26m.pt` (pretrained weights, faster convergence)

## Outcome

- `TrainingConfig` default model updated to `yolo26m.pt` (pretrained, recommended default)
- `config.yaml` updated to `yolo26m.pt`
- Both `yolo26m.pt` and `yolo26m.yaml` work when set in `config.yaml`
- `train_dataset()` and `resume_training()` work with either model reference

## Scope

### Included
- Update `TrainingConfig.model` default from `yolo11m.yaml` to `yolo26m.pt`
- Update `config.yaml` training.model from `yolo11m.yaml` to `yolo26m.pt`
- Verify `train_dataset()` works with both `.pt` and `.yaml` model values

### Excluded
- Changing training hyperparameters (epochs, batch, imgsz)
- Updating ultralytics library version

## Acceptance Criteria

**AC-1: Default model config updated**
Given the training configuration
When reading `TrainingConfig.model`
Then the default value is `yolo26m.pt`

**AC-2: config.yaml updated**
Given the root `config.yaml`
When reading `training.model`
Then the value is `yolo26m.pt`

**AC-3: From-scratch training supported**
Given `config.yaml` sets `training.model: yolo26m.yaml`
When `YOLO(constants.config.training.model)` is called
Then a YOLO26m model is built from the architecture definition

**AC-4: Pretrained training supported**
Given `config.yaml` sets `training.model: yolo26m.pt`
When `YOLO(constants.config.training.model)` is called
Then a YOLO26m model is loaded from pretrained weights
