NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

SAM 2: Segment Anything in Images and Videos

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 Dollar, Christoph Feichtenhofer

TL;DR

SAM 2 (Segment Anything Model 2) is a unified foundation model for promptable visual segmentation in both images and videos. By introducing a novel streaming memory architecture and the massive new SA-V dataset, it achieves state-of-the-art performance, running 6x faster than the original SAM on images and requiring 3x fewer user interactions for high-accuracy video tracking.

What Problem Does This Paper Address?

The original Segment Anything Model (SAM) revolutionized image segmentation by providing a "foundation" that could generalize to almost any object via simple prompts (clicks or boxes). However, SAM was limited to static images. The real world is dynamic, and segmenting objects in video introduces significant hurdles: objects move, deform, become occluded, and reappear.

Existing video object segmentation (VOS) models often struggled with efficiency or required extensive manual per-frame corrections. Furthermore, the field lacked a massive, diverse video dataset comparable to the image-based SA-1B. SAM 2 aims to bridge this gap by creating a single, high-performance system that treats images as single-frame videos and provides a seamless, interactive experience for "segmenting anything" in motion.

Methods

SAM 2 utilizes a simple transformer-based architecture designed for real-time, streaming processing.

Overview of the SAM 2 framework: promptable visual segmentation, the streaming memory model, and the data engine.

Its key components include:

  • Streaming Memory: Unlike previous models that might process a whole video at once, SAM 2 processes frames sequentially. It maintains a memory bank that stores features of past frames and user prompts.
  • Memory Attention: A transformer-based module that allows the current frame's features to "attend" to the stored memories. This allows the model to maintain a consistent understanding of an object even as its appearance changes or it disappears behind an obstacle.
  • Promptable Visual Segmentation (PVS): This task generalizes image segmentation to video. A user can provide prompts (clicks, boxes, or masks) on any frame. The model then propagates this information forward and backward in time to create a "masklet" (a spatio-temporal mask).
  • Interactive Refinement: If the model loses track of an object, the user can simply click on a frame where the prediction is wrong. The model uses its memory to instantly update the entire video sequence based on this new information.
An example of interactive refinement: a single click in frame 3 corrects the tracking of the dog's tongue across the entire sequence.

Datasets

The authors introduced the Segment Anything Video (SA-V) dataset, the largest of its kind to date. It was built using a three-phase "data engine" where human annotators worked in the loop with SAM 2 to iteratively improve both the model and the data.

  • SA-V Dataset: Contains 50.9K videos and 642.6K masklets, totaling 35.5M individual masks. This is 53x more masks than any previous video segmentation dataset.
  • Training Mix: The model was trained on a combination of SA-V, the original SA-1B image dataset, and several existing video benchmarks to ensure robust generalization.

Key Insights and Ideas

  • Unification is Key: By treating an image as a 1-frame video, the authors created a single model that outperforms specialized image-only and video-only models.
  • Memory as a Generalization of SAM: When the memory bank is empty, SAM 2 behaves exactly like the original SAM, making it a natural and powerful evolution.
  • Data Engine Efficiency: Using SAM 2 in the annotation loop made the data collection process 8.4x faster than manual frame-by-frame methods, proving that foundation models can effectively "bootstrap" their own training data.
  • Handling Ambiguity: In video, a single click can be ambiguous (e.g., clicking a tire vs. the whole bike). SAM 2 predicts multiple potential masks and uses a "masklet" logic to propagate the most consistent one across frames.

Key Results

  • Video Performance: SAM 2 outperforms prior state-of-the-art models (like XMem and Cutie) on 17 zero-shot video benchmarks, often while requiring significantly fewer user interactions.
  • Image Performance: On image segmentation tasks, SAM 2 is more accurate than the original SAM and is 6x faster in inference speed.
  • Efficiency: The model runs at real-time speeds (~44 FPS) on a single GPU, making it viable for interactive applications.
  • Fairness: Evaluations across diverse geographic regions and demographic groups (gender, age) showed minimal performance discrepancies, indicating a high degree of robustness.

Limitations and Future Work

Despite its strengths, the authors acknowledge several areas for improvement:

  • Shot Changes: The model can struggle with abrupt camera cuts in edited videos.
  • Long Occlusions: If an object is hidden for a very long duration, the model may lose its "memory" of it.
  • Fine Details: Tracking very thin or fast-moving objects (like a thin wire or a flying insect) remains a challenge.
  • Crowded Scenes: In scenes with many identical-looking objects (e.g., a group of identical fish), the model can occasionally switch identities.

Future work will likely focus on more explicit motion modeling and improving inter-object communication to handle complex, multi-object interactions more efficiently.

Summary updated

BibTeX
@inproceedings{ravi2025sam,
  author = {Nikhila Ravi and Valentin Gabeur and Yuan-Ting Hu and Ronghang Hu and Chaitanya Ryali and Tengyu Ma and Haitham Khedr and Roman Rädle and Chloe Rolland and Laura Gustafson and Eric Mintun and Junting Pan and Kalyan Vasudev Alwala and Nicolas Carion and Chao-Yuan Wu and Ross Girshick and Piotr Dollar and Christoph Feichtenhofer},
  title = {{SAM 2: Segment Anything in Images and Videos}},
  booktitle = {International Conference on Learning Representations},
  year = {2025},
  url = {https://openreview.net/forum?id=Ha6RTeWMd0},
}
Figure