# Baseline Metrics

**Run**: 01-code-improvements
**Date**: 2026-03-28
**Mode**: Guided
**Source**: `_docs/02_document/refactoring_notes.md`

## Goals

Apply 5 improvements identified during documentation:
1. Update YOLO to v26m version
2. Replace external augmentation with YOLO built-in augmentation
3. Remove processed folder — use data dir directly
4. Use hard symlinks instead of file copies for dataset formation
5. Unify constants directories — remove `src/annotation-queue/config.yaml`

## Code Metrics

| Metric | Value |
|--------|-------|
| Source files (src/) | 24 Python files |
| Source LOC | 2,945 |
| Test files | 21 Python files |
| Test LOC | 1,646 |
| Total tests | 83 (77 blackbox/unit + 6 performance) |
| Test execution time | ~130s (120s unit + 10s perf) |
| Python version | 3.10.8 |
| Ultralytics version | 8.4.30 |
| Pip packages | ~76 |

## Files Affected by Refactoring

| File | LOC | Refactoring Items |
|------|-----|-------------------|
| `src/constants.py` | 118 | #3 (remove processed_dir), #5 (unify config) |
| `src/train.py` | 178 | #1 (YOLO version), #2 (built-in aug), #3 (data dir), #4 (symlinks) |
| `src/augmentation.py` | 152 | #2 (replace with YOLO built-in), #3 (processed dir) |
| `src/exports.py` | 118 | #3 (processed dir references) |
| `src/convert-annotations.py` | 119 | #3 (processed dir references) |
| `src/dataset-visualiser.py` | 52 | #3 (processed dir references) |
| `src/annotation-queue/annotation_queue_handler.py` | 173 | #5 (remove separate config.yaml) |
| `src/annotation-queue/config.yaml` | 21 | #5 (delete — duplicated config) |
| `config.yaml` | 30 | #5 (single source of truth) |

## Test Suite Baseline

```
77 passed, 0 failed, 0 skipped (blackbox/unit)
6 passed, 0 failed, 0 skipped (performance)
Total: 83 passed in ~130s
```

## Functionality Inventory

| Feature | Status | Affected by Refactoring |
|---------|--------|------------------------|
| Augmentation pipeline | Working | Yes (#2, #3) |
| Dataset formation | Working | Yes (#3, #4) |
| Training | Working | Yes (#1, #2) |
| Model export (ONNX) | Working | No |
| Inference (ONNX/TensorRT) | Working | No |
| Annotation queue | Working | Yes (#5) |
| API client | Working | No |
| CDN manager | Working | No |
| Security/encryption | Working | No |
| Label validation | Working | No |
