SAM 2
Extends Segment Anything to video with a streaming memory that propagates prompted masks across frames, also usable on image sets as a sequence.
Also known as Segment Anything Model 2
In the family Capture, reconstruction & splatting, segmentation
Where it runs
Built inOfficial add-onPluginNone foundNot researched
| Engine | Support | How |
|---|---|---|
| three.js r187 | None found | |
| Babylon.js 9.38.0 | None found | |
| Godot 4.7 | Not applicable | Offline reconstruction/generative method, not an engine feature. |
| Unity | None found | External video/image segmentation neural model; not built into Unity. |
| Unreal 5.7 | None found | |
| Blender 5.2 | None found | |
| WebGPU W3C | None found | |
| Metal | None found |
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 choose it
Reach for it when
- 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
Choose it to propagate object masks across video frames or ordered multi-view captures, e.g. to mask a turntable sequence for Visual Hull (Shape from Silhouette) or splat training. Prefer Segment Anything (SAM) for single unrelated images, and masks from 3D-aware methods when views are sparse and unordered.
Field marks
- 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
Lineage
From the citation graph (Crossref reference lists): cited by SAM 3D Objects.
Sources
- primaryNikhila Ravi, Valentin Gabeur, Yuan-Ting Hu, Ronghang Hu, Chaitanya Ryali, Tengyu Ma et al. (2024). SAM 2: Segment Anything in Images and Videos. arXiv preprint (cs.CV).Verified via arxiv · 2026-11-29arXiv:2408.00714
- implementationfacebookresearch (2024). facebookresearch/sam2. 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.GitHub API · license Apache-2.0 · 2026-11-29