$npx -y skills add SharpAI/DeepCamera --skill model-trainingAgent-driven YOLO fine-tuning — annotate, train, export, deploy
| 1 | # Model Training |
| 2 | |
| 3 | 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. |
| 4 | |
| 5 | ## What You Get |
| 6 | |
| 7 | - **Fine-tune YOLO26** — start from nano/small/medium/large pre-trained weights |
| 8 | - **COCO dataset input** — uses standard format from `dataset-annotation` skill |
| 9 | - **Hardware-aware training** — auto-detects CUDA, MPS, ROCm, or CPU |
| 10 | - **Auto-export** — converts trained model to TensorRT / CoreML / OpenVINO / ONNX via `env_config.py` |
| 11 | - **One-click deploy** — replace the active detection model with your fine-tuned version |
| 12 | - **Training telemetry** — real-time loss, mAP, and epoch progress streamed to Aegis UI |
| 13 | |
| 14 | ## Training Loop (Aegis Training Agent) |
| 15 | |
| 16 | ``` |
| 17 | dataset-annotation model-training yolo-detection-2026 |
| 18 | ┌─────────────┐ ┌──────────────────┐ ┌──────────────────┐ |
| 19 | │ Annotate │───────▶│ Fine-tune YOLO │───────▶│ Deploy custom │ |
| 20 | │ Review │ COCO │ Auto-export │ .pt │ model as active │ |
| 21 | │ Export │ JSON │ Validate mAP │ .engine│ detection skill │ |
| 22 | └─────────────┘ └──────────────────┘ └──────────────────┘ |
| 23 | ▲ │ |
| 24 | └────────────────────────────────────────────────────┘ |
| 25 | Feedback loop: better detection → better annotation |
| 26 | ``` |
| 27 | |
| 28 | ## Protocol |
| 29 | |
| 30 | ### Aegis → Skill (stdin) |
| 31 | ```jsonl |
| 32 | {"event": "train", "dataset_path": "~/datasets/front_door_people/", "base_model": "yolo26n", "epochs": 50, "batch_size": 16} |
| 33 | {"event": "export", "model_path": "runs/train/best.pt", "formats": ["coreml", "tensorrt"]} |
| 34 | {"event": "validate", "model_path": "runs/train/best.pt", "dataset_path": "~/datasets/front_door_people/"} |
| 35 | ``` |
| 36 | |
| 37 | ### Skill → Aegis (stdout) |
| 38 | ```jsonl |
| 39 | {"event": "ready", "gpu": "mps", "base_models": ["yolo26n", "yolo26s", "yolo26m", "yolo26l"]} |
| 40 | {"event": "progress", "epoch": 12, "total_epochs": 50, "loss": 0.043, "mAP50": 0.87, "mAP50_95": 0.72} |
| 41 | {"event": "training_complete", "model_path": "runs/train/best.pt", "metrics": {"mAP50": 0.91, "mAP50_95": 0.78, "params": "2.6M"}} |
| 42 | {"event": "export_complete", "format": "coreml", "path": "runs/train/best.mlpackage", "speedup": "2.1x vs PyTorch"} |
| 43 | {"event": "validation", "mAP50": 0.91, "per_class": [{"class": "person", "ap": 0.95}, {"class": "car", "ap": 0.88}]} |
| 44 | ``` |
| 45 | |
| 46 | ## Setup |
| 47 | |
| 48 | ```bash |
| 49 | python3 -m venv .venv && source .venv/bin/activate |
| 50 | pip install -r requirements.txt |
| 51 | ``` |