claudegoodies
Skill

segment-anything-model

From NousResearch

SAM: zero-shot image segmentation via points, boxes, masks.

Runs Meta AI's SAM model for zero-shot image segmentation using point, box, or mask prompts.

Use it when

  • Segmenting arbitrary objects in images without domain-specific training
  • Building interactive annotation tools with click/box prompts
  • Generating masks to create training data for other vision models
  • Processing medical, satellite, or other unusual image domains

Skip it if

  • Need real-time detection with class labels — use YOLO/Detectron2 instead
  • Need semantic/panoptic segmentation with categories — use Mask2Former
  • Need text-prompted or video segmentation — use GroundingDINO+SAM or SAM 2
  • Requires downloading large checkpoints (375MB–2.4GB) and GPU for practical use

Facts

Status
Actively maintained
Last commit

Source preview

The instructions Claude Code reads when this skill runs.

# Segment Anything Model (SAM)

Comprehensive guide to using Meta AI's Segment Anything Model for zero-shot image segmentation.

## When to use SAM

**Use SAM when:**
- Need to segment any object in images without task-specific training
- Building interactive annotation tools with point/box prompts
- Generating training data for other vision models
- Need zero-shot transfer to new image domains
- Building object detection/segmentation pipelines
- Processing medical, satellite, or domain-specific images

**Key features:**
- **Zero-shot segmentation**: Works on any image domain without fine-tuning
- **Flexible prompts**: Points, bounding boxes, or previous masks
- **Automatic segmentation**: Generate all object masks automatically
- **High quality**: Trained on 1.1 billion masks from 11 million images
- **Multiple model sizes**: ViT-B (fastest), ViT-L, ViT-H (most accurate)
- **ONNX export**: Deploy in browsers and edge devices

**Use alternatives instead:**
- **YOLO/Detectron2**: For real-time object detection with classes
- **Mask2Former**: For semantic/panoptic segmentation with categories
- **GroundingDINO + SAM**: For text-prompted segmentation
- **SAM 2**: For video segmentation tasks

## Quick start

### Installation

```bash
# From GitHub
pip install git+https://github.com/facebookresearch/segment-anything.git

# Optional dependencies
pip install opencv-python pycocotools
View full source on GitHub →

Other skills