# Segmentation Sam2

> Interactive click-to-segment using Segment Anything 2 — AI-assisted labeling for Annotation Studio

- **Type:** Skill
- **Install:** `agentstack add skill-sharpai-deepcamera-sam2-segmentation`
- **Verified:** Yes — security-reviewed for prompt injection and unsafe behavior
- **Seller:** [SharpAI](https://agentstack.voostack.com/s/sharpai)
- **Installs:** 0
- **Category:** [AI & ML](https://agentstack.voostack.com/c/ai-and-ml)
- **Latest version:** 0.1.0
- **License:** MIT
- **Upstream author:** [SharpAI](https://github.com/SharpAI)
- **Source:** https://github.com/SharpAI/DeepCamera/tree/master/skills/segmentation/sam2-segmentation
- **Website:** http://www.sharpai.org

## Install

```sh
agentstack add skill-sharpai-deepcamera-sam2-segmentation
```

Requires the [AgentStack CLI](https://agentstack.voostack.com/docs/cli). Works with Claude Code, Cursor, and any MCP-compatible agent.

## About

# 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)
```jsonl
{"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)
```jsonl
{"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.

```bash
./deploy.sh
```

## Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

- **Author:** [SharpAI](https://github.com/SharpAI)
- **Source:** [SharpAI/DeepCamera](https://github.com/SharpAI/DeepCamera)
- **License:** MIT
- **Homepage:** http://www.sharpai.org

Install and usage instructions live in the source repository linked above.

## Pricing

- **Free** — Free

## Security capabilities

Automated source analysis of v0.1.0 — what this tool can access:

- **Network access:** no
- **Filesystem access:** no
- **Shell / process execution:** no
- **Environment & secrets:** no
- **Dynamic code execution:** no

*"Yes" means the capability is present in the source — more access means more to trust, not that it is unsafe.*


## Versions

- **0.1.0** — security scan: passed — Imported from the upstream source.

## Links

- Listing page: https://agentstack.voostack.com/l/skill-sharpai-deepcamera-sam2-segmentation
- Seller: https://agentstack.voostack.com/s/sharpai
- Browse the marketplace: https://agentstack.voostack.com/browse

---
Listed on AgentStack — the marketplace for AI agent skills and MCP servers. Every listing is security-reviewed. Creators keep 70%.
