Agent SkillsSharpAI/DeepCamera › model-training

model-training

GitHub

基于Aegis Agent的YOLO模型微调技能,支持从COCO数据集输入、硬件自适应训练到多格式自动导出及部署的全流程闭环。

skills/training/model-training/SKILL.md SharpAI/DeepCamera

Trigger Scenarios

需要微调YOLO目标检测模型 将标注好的数据集转换为可部署的检测模型 优化模型以适配特定硬件(如MPS/TensorRT)

Install

npx skills add SharpAI/DeepCamera --skill model-training -g -y
More Options

Non-standard path

npx skills add https://github.com/SharpAI/DeepCamera/tree/master/skills/training/model-training -g -y

Use without installing

npx skills use SharpAI/DeepCamera@model-training

指定 Agent (Claude Code)

npx skills add SharpAI/DeepCamera --skill model-training -a claude-code -g -y

安装 repo 全部 skill

npx skills add SharpAI/DeepCamera --all -g -y

预览 repo 内 skill

npx skills add SharpAI/DeepCamera --list

SKILL.md

Frontmatter
{
    "name": "model-training",
    "version": "1.0.0",
    "parameters": [
        {
            "name": "base_model",
            "type": "select",
            "group": "Training",
            "label": "Base Model",
            "default": "yolo26n",
            "options": [
                "yolo26n",
                "yolo26s",
                "yolo26m",
                "yolo26l"
            ],
            "description": "Pre-trained model to fine-tune"
        },
        {
            "name": "dataset_dir",
            "type": "string",
            "group": "Training",
            "label": "Dataset Directory",
            "default": "~\/datasets",
            "description": "Path to COCO-format dataset (from dataset-annotation skill)"
        },
        {
            "name": "epochs",
            "type": "number",
            "group": "Training",
            "label": "Training Epochs",
            "default": 50
        },
        {
            "name": "batch_size",
            "type": "number",
            "group": "Training",
            "label": "Batch Size",
            "default": 16,
            "description": "Adjust based on GPU VRAM"
        },
        {
            "name": "auto_export",
            "type": "boolean",
            "group": "Deployment",
            "label": "Auto-Export to Optimal Format",
            "default": true,
            "description": "Automatically convert to TensorRT\/CoreML\/OpenVINO after training"
        },
        {
            "name": "deploy_as_skill",
            "type": "boolean",
            "group": "Deployment",
            "label": "Deploy as Detection Skill",
            "default": false,
            "description": "Replace the active YOLO detection model with the fine-tuned version"
        }
    ],
    "description": "Agent-driven YOLO fine-tuning — annotate, train, export, deploy",
    "capabilities": {
        "training": {
            "script": "scripts\/train.py",
            "description": "Fine-tune YOLO models on custom annotated datasets"
        }
    }
}

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)

{"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/"}

Skill → Aegis (stdout)

{"event": "ready", "gpu": "mps", "base_models": ["yolo26n", "yolo26s", "yolo26m", "yolo26l"]}
{"event": "progress", "epoch": 12, "total_epochs": 50, "loss": 0.043, "mAP50": 0.87, "mAP50_95": 0.72}
{"event": "training_complete", "model_path": "runs/train/best.pt", "metrics": {"mAP50": 0.91, "mAP50_95": 0.78, "params": "2.6M"}}
{"event": "export_complete", "format": "coreml", "path": "runs/train/best.mlpackage", "speedup": "2.1x vs PyTorch"}
{"event": "validation", "mAP50": 0.91, "per_class": [{"class": "person", "ap": 0.95}, {"class": "car", "ap": 0.88}]}

Setup

python3 -m venv .venv && source .venv/bin/activate
pip install -r requirements.txt

Version History

  • 2264fcb Current 2026-08-20 16:02

Same Skill Collection

skills/analysis/cloud-provider-regression/SKILL.md
skills/analysis/home-security-benchmark/SKILL.md
skills/analysis/homesafe-bench/SKILL.md
skills/analysis/smarthome-bench/SKILL.md
skills/annotation/dataset-annotation/SKILL.md
skills/annotation/dataset-management/SKILL.md
skills/camera-providers/eufy/SKILL.md
skills/camera-providers/tapo/SKILL.md
skills/channels/matrix/SKILL.md
skills/detection/yolo-detection-2026-coral-tpu-macos/SKILL.md
skills/detection/yolo-detection-2026-coral-tpu-win-wsl/SKILL.md
skills/detection/yolo-detection-2026-openvino/SKILL.md
skills/detection/yolo-detection-2026/SKILL.md
skills/integrations/homeassistant-bridge/SKILL.md
skills/segmentation/sam2-segmentation/SKILL.md
skills/transformation/depth-estimation/SKILL.md
skills/automation/ha-trigger/SKILL.md
skills/automation/mqtt/SKILL.md
skills/automation/webhook/SKILL.md
skills/camera-providers/reolink/SKILL.md
skills/channels/line/SKILL.md
skills/channels/signal/SKILL.md
skills/streaming/go2rtc-cameras/SKILL.md

Metadata

Files
0
Version
2264fcb
Hash
d9507853
Indexed
2026-08-20 16:02

Accueil - Wiki
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-08-29 21:52
浙ICP备14020137号-1 $Carte des visiteurs$