Agent SkillsSharpAI/DeepCamera › segmentation-sam2

segmentation-sam2

GitHub

基于SAM2的交互式视频分割技能,支持点击、点框提示及跨帧追踪,生成像素级掩码以辅助Annotation Studio进行数据标注和数据集创建。

skills/segmentation/sam2-segmentation/SKILL.md SharpAI/DeepCamera

Trigger Scenarios

需要快速对视频帧中的对象进行实例分割 使用AI辅助工具进行视频数据标注和追踪

Install

npx skills add SharpAI/DeepCamera --skill segmentation-sam2 -g -y
More Options

Non-standard path

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

Use without installing

npx skills use SharpAI/DeepCamera@segmentation-sam2

指定 Agent (Claude Code)

npx skills add SharpAI/DeepCamera --skill segmentation-sam2 -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": "segmentation-sam2",
    "entry": "scripts\/segment.py",
    "deploy": "deploy.sh",
    "version": "1.0.0",
    "parameters": [
        {
            "name": "model",
            "type": "select",
            "group": "Model",
            "label": "SAM2 Model",
            "default": "sam2-small",
            "options": [
                "sam2-tiny",
                "sam2-small",
                "sam2-base",
                "sam2-large"
            ]
        },
        {
            "name": "device",
            "type": "select",
            "group": "Performance",
            "label": "Device",
            "default": "auto",
            "options": [
                "auto",
                "cpu",
                "cuda",
                "mps"
            ]
        }
    ],
    "description": "Interactive click-to-segment using Segment Anything 2 — AI-assisted labeling for Annotation Studio",
    "capabilities": {
        "live_transform": {
            "script": "scripts\/segment.py",
            "description": "Interactive segmentation on frames"
        }
    }
}

SAM2 Interactive Segmentation

Click anywhere on a video frame to segment objects using Meta's Segment Anything 2. Generates pixel-perfect masks for annotation, tracking, and dataset creation.

What You Get

  • Click-to-segment — click on any object to get its mask
  • Point & box prompts — positive/negative points and bounding box selection
  • Video tracking — segment in one frame, propagate across the clip
  • Annotation Studio — full integration with sidebar Annotation Studio

Protocol

Communicates via JSON lines over stdin/stdout.

Aegis → Skill (stdin)

{"event": "frame", "frame_path": "/tmp/frame.jpg", "frame_id": "frame_1", "request_id": "req_001"}
{"command": "segment", "points": [{"x": 450, "y": 320, "label": 1}], "request_id": "req_002"}
{"command": "track", "frame_path": "/tmp/frame2.jpg", "frame_id": "frame_2", "request_id": "req_003"}
{"command": "stop"}

Skill → Aegis (stdout)

{"event": "segmentation", "type": "ready", "request_id": "", "data": {"model": "sam2-small", "device": "mps"}}
{"event": "segmentation", "type": "encoded", "request_id": "req_001", "data": {"frame_id": "frame_1", "width": 1920, "height": 1080}}
{"event": "segmentation", "type": "segmented", "request_id": "req_002", "data": {"mask_path": "/tmp/mask.png", "mask_b64": "...", "score": 0.95, "bbox": [100, 50, 350, 420]}}
{"event": "segmentation", "type": "tracked", "request_id": "req_003", "data": {"frame_id": "frame_2", "mask_path": "/tmp/track.png", "score": 0.93}}

Installation

The deploy.sh bootstrapper handles everything — Python environment, GPU detection, dependency installation, and model download. No manual setup required.

./deploy.sh

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/training/model-training/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
09c85923
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$