The repository provides code for running inference and finetuning with the Meta Segment Anything Model 3 (SAM 3), links for downloading the trained model checkp
The repository provides code for running inference and finetuning with the Meta Segment Anything Model 3 (SAM 3), links for downloading the trained model checkp
Meta Superintelligence Labs
Nicolas Carion*, Laura Gustafson*, Yuan-Ting Hu*, Shoubhik Debnath*, Ronghang Hu*, Didac Suris*, Chaitanya Ryali*, Kalyan Vasudev Alwala*, Haitham Khedr*, Andrew Huang, Jie Lei, Tengyu Ma, Baishan Guo, Arpit Kalla, Markus Marks, Joseph Greer, Meng Wang, Peize Sun, Roman Rädle, Triantafyllos Afouras, Effrosyni Mavroudi, Katherine Xu°, Tsung-Han Wu°, Yu Zhou°, Liliane Momeni°, Rishi Hazra°, Shuangrui Ding°, Sagar Vaze°, Francois Porcher°, Feng Li°, Siyuan Li°, Aishwarya Kamath°, Ho Kei Cheng°, Piotr Dollar†, Nikhila Ravi†, Kate Saenko†, Pengchuan Zhang†, Christoph Feichtenhofer†
* core contributor, ° intern, † project lead, order is random within groups
[Paper]
[Project]
[Demo]
[Blog]
[BibTeX]
SAM 3 is a unified foundation model for promptable segmentation in images and videos. It can detect, segment, and track objects using text or visual prompts such as points, boxes, and masks. Compared to its predecessor SAM 2, SAM 3 introduces the ability to exhaustively segment all instances of an open-vocabulary concept specified by a short text phrase or exemplars. Unlike prior work, SAM 3 can handle a vastly larger set of open-vocabulary prompts. It achieves 75-80% of human performance on our new SA-CO benchmark which contains 270K unique concepts, over 50 times more than existing benchmarks.
This breakthrough is driven by an innovative data engine that has automatically annotated over 4 million unique concepts, creating the largest high-quality open-vocabulary segmentation dataset to date. In addition, SAM 3 introduces a new model architecture featuring a presence token that improves discrimination between closely related text prompts (e.g., “a player in white” vs. “a player in red”), as well as a decoupled detector–tracker design that minimizes task interference and scales efficiently with data.
03/27/2026 -- SAM 3.1 Object Multiplex is released. It introduces a shared-memory approach for joint multi-object tracking that is significantly faster without sacrificing accuracy.
RELEASE_SAM3p1.md for full details.git pull), and then reinstall the repo following Installation below.conda create -n sam3 python=3.12
conda deactivate
conda activate sam3pip install torch==2.10.0 torchvision --index-url https://download.pytorch.org/whl/cu128git clone https://github.com/facebookresearch/sam3.git
cd sam3
pip install -e .# For running example notebooks
pip install -e ".[notebooks]"
# For development
pip install -e ".[train,dev]"pip install einops ninja && pip install flash-attn-3 --no-deps --index-url https://download.pytorch.org/whl/cu128
pip install git+https://github.com/ronghanghu/cc_torch.git⚠️ Before using SAM 3, please request access to the checkpoints on the SAM 3
Hugging Face repo. Once accepted, you
need to be authenticated to download the checkpoints. You can do this by running
the following steps
(e.g. hf auth login after generating an access token.)
…The examples directory contains notebooks demonstrating how to use SAM3 with
various types of prompts:
sam3_image_predictor_example.ipynb
: Demonstrates how to prompt SAM 3 with text and visual box prompts on images.sam3_video_predictor_example.ipynb
: Demonstrates how to prompt SAM 3 with text prompts on videos, and doing
further interactive refinements with points.sam3_image_batched_inference.ipynb
: Demonstrates how to run batched inference with SAM 3 on images.sam3_agent.ipynb: Demonsterates the use of SAM
3 Agent to segment complex text prompt on images.saco_gold_silver_vis_example.ipynb
: Shows a few examples from SA-Co image evaluation set.saco_veval_vis_example.ipynb :
Shows a few examples from SA-Co video evaluation set.There are additional notebooks in the examples directory that demonstrate how to use SAM 3 for interactive instance segmentation in images and videos (SAM 1/2 tasks), or as a tool for an MLLM, and how to run evaluations on the SA-Co dataset.
To run the Jupyter notebook examples:
# Make sure you have the notebooks dependencies installed
pip install -e ".[notebooks]"
# Start Jupyter notebook
jupyter notebook examples/sam3_image_predictor_example.ipynbSAM 3 consists of a detector and a tracker that share a vision encoder. It has 848M parameters. The detector is a DETR-based model conditioned on text, geometry, and image exemplars. The tracker inherits the SAM 2 transformer encoder-decoder architecture, supporting video segmentation and interactive refinement.
We release 2 image benchmarks, SA-Co/Gold and SA-Co/Silver, and a video benchmark SA-Co/VEval. The datasets contain images (or videos) with annotated noun phrases. Each image/video and noun phrase pair is annotated with instance masks and unique IDs of each object matching the phrase. Phrases that have no matching objects (negative prompts) have no masks, shown in red font in the figure. See the linked READMEs for more details on how to download and run evaluations on the datasets.
To set up the development environment:
pip install -e ".[dev,train]"To format the code:
ufmt format .See contributing and the code of conduct.
This project is licensed under the SAM License - see the LICENSE file for details.
We would like to thank the following people for their contributions to the SAM 3 project: Alex He, Alexander Kirillov, Alyssa Newcomb, Ana Paula Kirschner Mofarrej, Andrea Madotto, Andrew Westbury, Ashley Gabriel, Azita Shokpour, Ben Samples, Bernie Huang, Carleigh Wood, Ching-Feng Yeh, Christian Puhrsch, Claudette Ward, Daniel Bolya, Daniel Li, Facundo Figueroa, Fazila Vhora, George Orlin, Hanzi Mao, Helen Klein, Hu Xu, Ida Cheng, Jake Kinney, Jiale Zhi, Jo Sampaio, Joel Schlosser, Justin Johnson, Kai Brown, Karen Bergan, Karla Martucci, Kenny Lehmann, Maddie Mintz, Mallika Malhotra, Matt Ward, Michelle Chan, Michelle Restrepo, Miranda Hartley, Muhammad Maaz, Nisha Deo, Peter Park, Phillip Thomas, Raghu Nayani, Rene Martinez Doehner, Robbie Adkins, Ross Girshik, Sasha Mitts, Shashank Jain, Spencer Whitehead, Ty Toledano, Valentin Gabeur, Vincent Cho, Vivian Lee, William Ngan, Xuehai He, Yael Yungster, Ziqi Pang, Ziyi Dou, Zoe Quake.
If you use SAM 3 or the SA-Co dataset in your research, please use the following BibTeX entry.
…Request to Reset Rejected Hugging Face Access for SAM 3
Request to reset rejected Hugging Face access for SAM3
Reproducing SAM 3.1's LVOSv2 val VOS result (Table 44 / RELEASE_SAM3p1.md): which evaluation protocol and settings?
Request to Reset Rejected Hugging Face Access for SAM 3
Follow-up: Rejected access request for SAM3 checkpoints | HF username: xiaohu9
HF Approval
Verify evals on Papers with Code
Request to reset rejected Hugging Face access for SAM3
Question about the release timeline and scope of the SA-Co training datasets
[SAM 3.1 Multiplex] Explicit forward tracking bound can enter an empty grounding chunk