Agent skill · research science · nousresearch
segment-anything-model
SAM: zero-shot image segmentation via points, boxes, masks.
Why this skill is useful
Provides specific commands and usage patterns for implementing zero-shot image segmentation with the Segment Anything Model that the AI wouldn't reliably generate on its own.
What it needs
Requires matplotlib, opencv-python, pycocotools, segment-anything, torch, transformers installed locally. About 6k tokens when loaded. Last updated 2026-08-07. 226,679 stars on the source repository.
What this skill does
Segment Anything Model (SAM) 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 Download checkpoints Basic usage with SamPredictor HuggingFace Transformers Core concepts Model architecture <!-- ascii-guard-ignore --> <!-- ascii-guard-ignore-end --> Model variants Model Checkpoint Size Speed Accuracy ------- ------------ ------ ------- ---------- ViT-H vith 2.4 GB Slowest Best ViT-L vitl 1.2 GB Medium Good ViT-B vitb 375 MB Fastest Good Prompt types Prompt Description Use Case -------- ------------- ---------- Point (foreground) Click on object Single object selection Point (background) Click outside object Exclude regions Bounding box Rectangle around object Larger objects Previous mask Low-res mask input Iterative refinement Interactive segmentation Point prompts Box prompts Combined prompts Iterative refinement Automatic mask generation Basic automatic segmentation Customized generation Filtering masks Batched inference Multiple images Mul …
How to use it
Reference it in AdaL, Claude Code, Cursor or any coding agent — nothing to install:
@skills nousresearch/segment-anything-model