SAM 2

Meta 2024 · Paper

One-line summary — Extends Segment Anything to video with a streaming memory-attention architecture that tracks and segments objects consistently across frames, while also being more accurate and 6x faster than SAM on still images.

Problem

SAM segments each image independently, so running it on video loses object identity across frames — yet robotics, AR, and video editing all need the same object segmented consistently over time, through motion, deformation, occlusion, and lighting change, and often at lower per-frame quality (blur, camera motion). SAM 2 poses Promptable Visual Segmentation (PVS): given clicks/boxes/masks on any frame of a video, predict the object’s spatio-temporal mask (a “masklet”) across the entire video, refinable with further prompts on any frame. Existing VOS models were not promptable in this sense, and video mask annotations were scarce — so the model and the dataset had to be built together.

Method & architecture

A streaming generalization of SAM — frames are consumed one at a time, and when the memory is empty the model is SAM on an image:

Training is joint on images and video: 8-frame sequences with up to 2 prompted frames, corrective clicks sampled from ground truth and model predictions; the initial prompt is a ground-truth mask (p=0.5), a positive click (p=0.25), or a box (p=0.25).

Data engine (three phases): Phase 1, per-frame SAM annotation at 6 FPS — 37.8 s/frame, 16K masklets; Phase 2, SAM 2 Mask propagates first-frame masks — 7.4 s/frame (5.1x speedup), 63.5K masklets; Phase 3, full SAM 2 in the loop with occasional refinement clicks — 4.5 s/frame (8.4x speedup at comparable quality), 197K masklets, with a separate verification pass and automatic grid-prompted masklets for coverage. Result: SA-V — 50.9K videos, 642.6K masklets, 35.5M masks, 53x more masks (15x without auto) than any prior VOS dataset, released under CC-BY 4.0.

Results

Why it matters for SLAM

Frame-by-frame masks are not enough for SLAM — the system must know it is seeing the same object over time to build semantic maps and handle dynamic scenes. SAM 2’s streaming memory design matches the sequential nature of SLAM pipelines: temporally consistent masklets enable dynamic-object removal, object-level mapping, and persistent instance identity for data association, and the occlusion head explicitly models disappearance/re-appearance that map maintenance must handle. Spatio-temporal semantic mapping systems (e.g., Khronos-style) are natural consumers of this capability.