Image segmentation for the impatient: point, box, done.
To give developers a zero-shot image segmentation model that generates masks from a click or a bounding box, no retraining required.

What it does
SAM takes an image and a lightweight prompt—a single point, a bounding box, or nothing at all—and returns high-quality object masks. The repository contains inference code, pretrained vit_h, vit_l, and vit_b checkpoints, and Jupyter notebooks to handle either interactive or fully automatic segmentation.
The interesting bit
The model was trained on 11 million images and 1.1 billion masks, which is the scale that makes its zero-shot generalization possible. More practically, its mask decoder is compact enough to export to ONNX and run inside a browser with multithreading, as demonstrated by the included React demo.
Key highlights
- Promptable segmentation via points, boxes, or automatic full-image generation.
- Three backbone sizes (ViT-B, ViT-L, ViT-H) to trade off speed and accuracy.
- ONNX export path for running the decoder outside PyTorch, including in-browser.
- Apache 2.0 license.
- Companion web demo and example notebooks included.
Caveats
- CUDA is strongly recommended; CPU inference is possible but not ideal.
- The repository is inference-only—there is no code for training or fine-tuning your own model.
- This is the original image-only SAM; video segmentation moved to the separate SAM 2 repository.
Verdict
Useful if you need drop-in segmentation for prototypes, browser demos, or pipelines where retraining is not an option. Look elsewhere if you need to train a foundation model from scratch or segment video, since Meta already released SAM 2 for that.
Frequently asked
- What is facebookresearch/segment-anything?
- To give developers a zero-shot image segmentation model that generates masks from a click or a bounding box, no retraining required.
- Is segment-anything open source?
- Yes — facebookresearch/segment-anything is open source, released under the Apache-2.0 license.
- What language is segment-anything written in?
- facebookresearch/segment-anything is primarily written in Jupyter Notebook.
- How popular is segment-anything?
- facebookresearch/segment-anything has 54.6k stars on GitHub and is currently cooling off.
- Where can I find segment-anything?
- facebookresearch/segment-anything is on GitHub at https://github.com/facebookresearch/segment-anything.