# Model Training

Agent-driven YOLO fine-tuning, annotate, train, export, deploy

- Repository: https://github.com/SharpAI/DeepCamera (3124 stars)
- Category: AI and agents
- License: MIT
- Last updated: 2026-09-17
- Runs scripts: no, instructions only

## Install

Claude Code: `npx skills add SharpAI/DeepCamera --skill model-training -g -a claude-code -y`
Codex: `npx skills add SharpAI/DeepCamera --skill model-training -g -a codex -y`
Cursor: `npx skills add SharpAI/DeepCamera --skill model-training -g -a cursor -y`
Gemini CLI: `npx skills add SharpAI/DeepCamera --skill model-training -g -a gemini-cli -y`

## Description

Agent-driven YOLO fine-tuning, annotate, train, export, deploy

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

# Model Training

Agent-driven custom model training powered by Aegis's Training Agent. Closes the annotation-to-deployment loop: take a COCO dataset from `dataset-annotation`, fine-tune a YOLO model, auto-export to the optimal format for your hardware, and optionally deploy it as your active detection skill.

## What You Get

- **Fine-tune YOLO26**, start from nano/small/medium/large pre-trained weights
- **COCO dataset input**, uses standard format from `dataset-annotation` skill
- **Hardware-aware training**, auto-detects CUDA, MPS, ROCm, or CPU
- **Auto-export**, converts trained model to TensorRT / CoreML / OpenVINO / ONNX via `env_config.py`
- **One-click deploy**, replace the active detection model with your fine-tuned version
- **Training telemetry**, real-time loss, mAP, and epoch progress streamed to Aegis UI

## Training Loop (Aegis Training Agent)

```
dataset-annotation          model-training              yolo-detection-2026
┌─────────────┐        ┌──────────────────┐        ┌──────────────────┐
│ Annotate    │───────▶│ Fine-tune YOLO   │───────▶│ Deploy custom    │
│ Review      │  COCO  │ Auto-export      │ .pt    │ model as active  │
│ Export      │  JSON  │ Validate mAP     │ .engine│ detection skill  │
└─────────────┘        └──────────────────┘        └──────────────────┘
       ▲                                                    │
       └────────────────────────────────────────────────────┘
                    Feedback loop: better detection → better annotation
```

## Protocol

### Aegis → Skill (stdin)
```jsonl
{"event": "train", "dataset_path": "~/datasets/front_door_people/", "base_model": "yolo26n", "epochs": 50, "batch_size": 16}
{"event": "export", "model_path": "runs/train/best.pt", "formats": ["coreml", "tensorrt"]}
{"event": "validate", "model_path": "runs/train/best.pt", "dataset_path": "~/datasets/front_door_people/"}
```

The rest: https://github.com/SharpAI/DeepCamera/blob/HEAD/skills/training/model-training/SKILL.md
