$npx -y skills add SharpAI/DeepCamera --skill sam2-segmentationInteractive click-to-segment using Segment Anything 2 — AI-assisted labeling for Annotation Studio
| 1 | # SAM2 Interactive Segmentation |
| 2 | |
| 3 | 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. |
| 4 | |
| 5 | ## What You Get |
| 6 | |
| 7 | - **Click-to-segment** — click on any object to get its mask |
| 8 | - **Point & box prompts** — positive/negative points and bounding box selection |
| 9 | - **Video tracking** — segment in one frame, propagate across the clip |
| 10 | - **Annotation Studio** — full integration with sidebar Annotation Studio |
| 11 | |
| 12 | ## Protocol |
| 13 | |
| 14 | Communicates via **JSON lines** over stdin/stdout. |
| 15 | |
| 16 | ### Aegis → Skill (stdin) |
| 17 | ```jsonl |
| 18 | {"event": "frame", "frame_path": "/tmp/frame.jpg", "frame_id": "frame_1", "request_id": "req_001"} |
| 19 | {"command": "segment", "points": [{"x": 450, "y": 320, "label": 1}], "request_id": "req_002"} |
| 20 | {"command": "track", "frame_path": "/tmp/frame2.jpg", "frame_id": "frame_2", "request_id": "req_003"} |
| 21 | {"command": "stop"} |
| 22 | ``` |
| 23 | |
| 24 | ### Skill → Aegis (stdout) |
| 25 | ```jsonl |
| 26 | {"event": "segmentation", "type": "ready", "request_id": "", "data": {"model": "sam2-small", "device": "mps"}} |
| 27 | {"event": "segmentation", "type": "encoded", "request_id": "req_001", "data": {"frame_id": "frame_1", "width": 1920, "height": 1080}} |
| 28 | {"event": "segmentation", "type": "segmented", "request_id": "req_002", "data": {"mask_path": "/tmp/mask.png", "mask_b64": "...", "score": 0.95, "bbox": [100, 50, 350, 420]}} |
| 29 | {"event": "segmentation", "type": "tracked", "request_id": "req_003", "data": {"frame_id": "frame_2", "mask_path": "/tmp/track.png", "score": 0.93}} |
| 30 | ``` |
| 31 | |
| 32 | ## Installation |
| 33 | |
| 34 | The `deploy.sh` bootstrapper handles everything — Python environment, GPU detection, dependency installation, and model download. No manual setup required. |
| 35 | |
| 36 | ```bash |
| 37 | ./deploy.sh |
| 38 | ``` |