Segment Anything (SAM)
A promptable image segmentation model: a heavy image encoder runs once, then a light decoder turns points, boxes or masks into object masks in milliseconds.
Also known as SAM
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 promptable segmentation 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
A ViT image encoder computes an embedding once per image. A prompt encoder converts clicks, boxes or rough masks into tokens, and a lightweight mask decoder attends between the prompt tokens and the embedding to predict several candidate masks with predicted quality scores, handling ambiguity such as part versus whole. The model was trained on a very large mask dataset built with a model-in-the-loop data engine. An automatic mode prompts a regular grid of points and filters the resulting masks by predicted IoU, stability under thresholding and non-maximum suppression, producing masks for everything in the image. Since the decoder is cheap, interactive use is possible in a browser after the embedding step.
When to choose it
Reach for it when
- need to cut out a subject from a photo quickly
- isolate objects before 3d reconstruction
- want masks from a click or a box
- label parts of a splat or image interactively
Choose it for object masks to isolate subjects before reconstruction, to build Visual Hull (Shape from Silhouette) silhouettes or to label splats. Prefer SAM 2 for video or multi-view propagation of masks, and plain thresholding when the background is controlled.
Field marks
- Fine structures and thin boundaries are rounded off
- Masks are not semantically labelled, so class names need another model
- Ambiguous prompts return the wrong granularity (part or whole)
- No temporal consistency across frames or views
Presets
SAM automatic mask generator defaults
{
"points_per_side": 32,
"pred_iou_thresh": 0.88,
"stability_score_thresh": 0.95,
"stability_score_offset": 1,
"box_nms_thresh": 0.7,
"crop_n_layers": 0,
"min_mask_region_area": 0
}Attribution: Parameter names follow facebookresearch/segment-anything (Apache-2.0); values are the SamAutomaticMaskGenerator defaults, written for this index.
Lineage
From the citation graph (Crossref reference lists): cited by Depth Anything V2, Depth Pro, MoGe (Monocular Geometry Estimation), SAM 3D Objects, TRELLIS (Structured 3D Latents).
Crosses
- Visual Hull (Shape from Silhouette): Per-view SAM masks give the silhouettes that visual hull carving intersects.
Sources
- primaryAlexander Kirillov, Eric Mintun, Nikhila Ravi, Hanzi Mao, Chloe Rolland, Laura Gustafson et al. (2023). Segment Anything. arXiv preprint (cs.CV).Verified via arxiv · 2026-11-29arXiv:2304.02643
- implementationfacebookresearch (2023). facebookresearch/segment-anything. The repository provides code for running inference with the SegmentAnything Model (SAM), 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
- tutorialMeta AI. Segment Anything project page. aidemos.meta.com.Verified via live page · 2026-11-29