SAM 2 (Segment Anything in Images and Videos)
What it is
A promptable unified segmentation model extending visual mask prediction to real-time streaming video through a spatio-temporal memory bank and memory attention.
When to use it
Interactive video object tracking, zero-shot video segmentation, and fast pixel-accurate mask propagation across temporal cuts.
Caveats
Tracking can drift or lose the object after long occlusions, across shot changes, or in crowded scenes with similar-looking objects. Each object is tracked separately, so cost grows with the number of objects, and like SAM it outputs masks without class labels.
Key ideas
- Memory bank stores past frame embeddings and interactive prompt selections
- Memory attention block cross-attends current visual features against historical memory tokens
- Runs at 44+ FPS in real-time streaming inference mode
Related architectures
Original paper
SAM 2: Segment Anything in Images and Videos (2024, arXiv)