{
 "id": "sam2",
 "title": "SAM 2",
 "aliases": [
  "Segment Anything Model 2"
 ],
 "domain": "capture",
 "subdomain": "segmentation",
 "stage": "capture",
 "realtime": "interactive",
 "platforms": [
  "cuda",
  "python"
 ],
 "year_introduced": 2024,
 "inputs": [
  "photos"
 ],
 "outputs": [
  "visibility-mask"
 ],
 "style": "both",
 "dynamic": "dynamic",
 "summary": "Extends Segment Anything to video with a streaming memory that propagates prompted masks across frames, also usable on image sets as a sequence.",
 "how_it_works": "Like SAM, SAM 2 has an image encoder, a prompt encoder and a mask decoder, but frames are processed as a stream. A memory bank stores embeddings of recent frames and of prompted frames along with predicted masks. Each new frame's features cross-attend to this memory through memory attention before decoding, so the mask follows the object across motion and short occlusions. Users can add corrective clicks on any frame, and the model updates the track. Images are treated as a one-frame video. Training combined a data engine with a large video segmentation dataset. A hierarchical image encoder makes the model faster than the original SAM at comparable image quality.",
 "when_to_use": "Choose it to propagate object masks across video frames or ordered multi-view captures, e.g. to mask a turntable sequence for `visual-hull` or splat training. Prefer `segment-anything` for single unrelated images, and masks from 3D-aware methods when views are sparse and unordered.",
 "cost": {
  "class": "medium",
  "notes": "Real-time-ish per-frame on a modern GPU for small variants; memory use grows with the stored frame count."
 },
 "failure_modes": [
  "Identity switches when similar objects cross or after long occlusions",
  "Drift on fast motion, motion blur or thin objects",
  "Unordered or wide-baseline multi-view sets break the temporal-memory assumption",
  "Boundary quality is limited for hair and transparent edges"
 ],
 "sources": [
  {
   "role": "primary",
   "key": "arxiv:2408.00714",
   "type": "paper",
   "title": "SAM 2: Segment Anything in Images and Videos",
   "authors": [
    "Nikhila Ravi",
    "Valentin Gabeur",
    "Yuan-Ting Hu",
    "Ronghang Hu",
    "Chaitanya Ryali",
    "Tengyu Ma",
    "Haitham Khedr",
    "Roman Rädle",
    "Chloe Rolland",
    "Laura Gustafson",
    "Eric Mintun",
    "Junting Pan",
    "Kalyan Vasudev Alwala",
    "Nicolas Carion",
    "Chao-Yuan Wu",
    "Ross Girshick",
    "Piotr Dollár",
    "Christoph Feichtenhofer"
   ],
   "year": 2024,
   "venue": "arXiv preprint (cs.CV)",
   "url": "https://arxiv.org/abs/2408.00714",
   "ids": {
    "arxiv": "2408.00714"
   },
   "license": null,
   "extra": {
    "arxiv_version": "2",
    "category": "cs.CV"
   },
   "provenance": {
    "title": {
     "authority": "arxiv",
     "endpoint": "https://export.arxiv.org/api/query?id_list=2408.00714",
     "checked_at": "2026-11-29T15:51:27.588Z"
    },
    "authors": {
     "authority": "arxiv",
     "endpoint": "https://export.arxiv.org/api/query?id_list=2408.00714",
     "checked_at": "2026-11-29T15:51:27.588Z"
    },
    "year": {
     "authority": "arxiv",
     "endpoint": "https://export.arxiv.org/api/query?id_list=2408.00714",
     "checked_at": "2026-11-29T15:51:27.588Z"
    },
    "venue": {
     "authority": "arxiv",
     "endpoint": "https://export.arxiv.org/api/query?id_list=2408.00714",
     "checked_at": "2026-11-29T15:51:27.588Z"
    },
    "url": {
     "authority": "arxiv",
     "endpoint": "https://export.arxiv.org/api/query?id_list=2408.00714",
     "checked_at": "2026-11-29T15:51:27.588Z"
    }
   },
   "status": "verified",
   "checked_at": "2026-11-29T15:51:27.588Z",
   "title_sim": 1,
   "__bib": "ravi2024segment"
  },
  {
   "role": "implementation",
   "key": "gh:facebookresearch/sam2",
   "type": "code",
   "title": "facebookresearch/sam2",
   "description": "The repository provides code for running inference with the Meta Segment Anything Model 2 (SAM 2), links for downloading the trained model checkpoints, and example notebooks that show how to use the model.",
   "authors": [
    "facebookresearch"
   ],
   "year": 2024,
   "venue": "GitHub",
   "url": "https://github.com/facebookresearch/sam2",
   "ids": {
    "repo": "facebookresearch/sam2"
   },
   "license": "Apache-2.0",
   "extra": {
    "stars": 20256,
    "stars_checked": "2026-11-29",
    "archived": false,
    "fork": false,
    "pushed_at": "2026-05-30T02:29:40Z",
    "language": "Jupyter Notebook",
    "homepage": null,
    "license_name": "Apache License 2.0"
   },
   "provenance": {
    "title": {
     "authority": "github",
     "endpoint": "https://api.github.com/repos/facebookresearch/sam2",
     "checked_at": "2026-11-29T15:51:27.588Z"
    },
    "authors": {
     "authority": "github",
     "endpoint": "https://api.github.com/repos/facebookresearch/sam2",
     "checked_at": "2026-11-29T15:51:27.588Z"
    },
    "year": {
     "authority": "github",
     "endpoint": "https://api.github.com/repos/facebookresearch/sam2",
     "checked_at": "2026-11-29T15:51:27.588Z"
    },
    "venue": {
     "authority": "github",
     "endpoint": "https://api.github.com/repos/facebookresearch/sam2",
     "checked_at": "2026-11-29T15:51:27.588Z"
    },
    "url": {
     "authority": "github",
     "endpoint": "https://api.github.com/repos/facebookresearch/sam2",
     "checked_at": "2026-11-29T15:51:27.588Z"
    },
    "license": {
     "authority": "github",
     "endpoint": "https://api.github.com/repos/facebookresearch/sam2",
     "checked_at": "2026-11-29T15:51:27.588Z"
    }
   },
   "status": "verified",
   "checked_at": "2026-11-29T15:51:27.588Z",
   "title_sim": null,
   "__bib": "facebookresearch2024facebookresearch"
  }
 ],
 "presets": [],
 "related": [
  "segment-anything",
  "visual-hull"
 ],
 "extends": [
  "segment-anything"
 ],
 "supersedes": [],
 "combines_with": [],
 "provenance": {
  "prose": "original text written for this index (research draft, editorially reviewed)",
  "sources_verified_at": "2026-11-29T15:51:27.588Z",
  "draft": "data/drafts/capture/sam2.json"
 },
 "solves": [
  "need object masks across video frames",
  "mask the same object in every turntable photo",
  "propagate a prompted mask through ordered images",
  "segmenting each frame separately flickers"
 ],
 "authority": "Ravi et al., 2024",
 "url": "https://texelatlas.vercel.app/t/sam2/",
 "execution_fidelity": "none",
 "fidelity_label": "No Live Specimen",
 "benchmark_eligible": false
}