Images · SAM 3 and SAM 3.1
Meta SAM 3 Image Segmentation: Pixel-Perfect Masks From a Phrase Type “red cars”, box one example, or click. SAM 3 finds and outlines every matching object in your photo.
At a glance
SAM 3 for Images in Six Points
Overview
What Is SAM 3 Image Segmentation?
Image segmentation means outlining objects pixel by pixel. SAM 3 does it from a prompt, and unlike earlier SAM models it can find every object that matches a concept, not just the one you click.
- Concepts, not just clicks. Meta calls this Promptable Concept Segmentation (PCS): one prompt returns all matching objects.
- Still interactive. Clicks, boxes and masks still work for a single object (PVS), and SAM 3 scores higher than SAM 2 at it.
- Open vocabulary. No fixed label list: “solar panels”, “striped cats” or “goalkeepers in green” all work.
- About 2× better than earlier systems on Meta’s SA-Co concept benchmark.
SAM 3.1? The March 2026 update mainly speeds up video. For still images, prompts and results are essentially the same. See SAM 3.1.
Prompt types
Three Ways to Prompt an Image
Choose by your question: “every X”, “things like this”, or “this one”.
Text: “every X”
Short noun phrases such as “yellow school bus” or “blue recycling bins”. Returns a mask, box and score for each match.
Example boxes: “things like this”
Box one clear example; SAM 3 finds look-alikes. Add negative boxes to exclude near-misses, for example “these chairs, not those stools”. Great for logos or things that are hard to name.
Clicks, boxes, masks: “this one”
Positive and negative clicks, a rough box, or an existing mask, for precise control over one object.
Full guide: SAM 3 prompts
Multiple concepts
Several Concepts in One Image
Run one prompt per concept on the same image, and you get a structured inventory of the scene.
- One concept per prompt: “cars”, “bikes”, “pedestrians”; or “buildings”, “roads”, “trees”.
- Each concept gets its own masks, boxes and scores, ready to count, measure or export.
- Cheap to repeat: the image is encoded once, and extra prompts reuse those features.
- Not a scene graph: SAM 3 tells you what and where, not how objects relate to each other.
Under the hood
How SAM 3 Segments an Image
SAM 3 combines a detector, which finds every match, with SAM’s mask head, which draws precise outlines.
- 1EncodeMeta’s Perception Encoder turns the image into features; your phrase and example boxes are encoded too.
- 2Check presenceA presence head first asks whether the concept is in the image at all, which cuts false matches.
- 3Detect and maskThe detector proposes each match, and the mask head outputs a mask, box and score for each, plus a semantic mask for the whole concept.
Why it generalises: SA-Co data
- About 5.2 million images and 52.5K videos in its high-quality training set.
- Over 4 million unique concept phrases, including hard negatives: phrases that are not in the image.
- Labelled by a data engine combining SAM 3, AI verifiers and human annotators.
More: SA-Co benchmark · SAM 3 architecture
Outputs
What You Get Back
For each object SAM 3 returns a mask, a box and a confidence score, which convert into whatever format your tool needs.
- Instance masks: one binary mask per object, for cut-outs and counting.
- Boxes and scores: filter out weak matches with a score threshold.
- Semantic mask: one combined mask for the whole concept, handy for “all sky” or “all road”.
- Export: PNG or alpha mattes for design tools, polygons or RLE for labelling, COCO JSON for training.
Formats explained: mask formats · export masks
Prompt tips
Getting Better Masks
Short, concrete prompts and a click or two of refinement beat long descriptions.
✓ Good prompts
- red basketball jerseys
- solar panels on roofs
- white delivery vans
✗ Avoid
- please find and segment every player wearing a red jersey
- cool stuff
- Hard to name? Box one clean example, add more for variety, and add negatives for look-alikes.
- Rough edges? Add a positive click on missed parts and a negative click on leaks; don’t start over.
- Small or thin parts? Use a higher-resolution image or crop and zoom. See improve mask quality.
Use cases
What People Use It For
Photo and design
Smart cut-outs for thumbnails and posters, local edits, background swaps and collages.
Data labelling
Auto-label large image sets, including rare classes, then train small, fast models.
Maps, aerial and industry
Buildings, roads, fields and solar panels from drone or satellite images; count containers or parked cars.
Robotics
Turn camera frames into object maps, often combined with depth or LiDAR.
Privacy
Find faces, licence plates or screens and blur them before sharing.
Into 3D
Select an object with SAM 3, then rebuild it in 3D with SAM 3D.
More: all use cases
Try it
How to Try SAM 3 on Images
From no code to full control.
facebookresearch/sam3 code, or Transformers’ SAM 3 models (Sam3Model for concepts, Sam3Tracker for clicks).
HostedPlatforms and APIsRoboflow, Ultralytics and others wrap SAM 3 in web tools and REST APIs.
Requirements in brief
- Python 3.12+, PyTorch 2.7+ and a CUDA 12.6+ NVIDIA GPU.
- Request access to the weights on Hugging Face (
facebook/sam3orfacebook/sam3.1). - Step by step: install SAM 3 · system requirements
Several prompts on one image
from PIL import Image
from sam3.model_builder import build_sam3_image_model
from sam3.model.sam3_image_processor import Sam3Processor
model = build_sam3_image_model()
processor = Sam3Processor(model)
state = processor.set_image(Image.open("parking.jpg")) # encode once
for phrase in ["red cars", "bikes", "people"]: # reuse for each prompt
out = processor.set_text_prompt(state=state, prompt=phrase)
masks, boxes, scores = out["masks"], out["boxes"], out["scores"]Based on the official sam3 repository. More: Python tutorial
Limits
Limits to Know
Where it struggles
- Tiny or thin objects such as wires or distant people may need zooming and extra clicks.
- Vague prompts like “cool stuff” give noisy results.
- Reasoning prompts such as “the cup left of the laptop” need SAM 3 Agent.
- Specialist images (medical, thermal, microscopy) are weak zero-shot.
What helps
- Short, concrete prompts, plus example boxes when words fail.
- Refine with clicks instead of restarting.
- Fine-tune on your domain; research variants like MedSAM3 do this for medicine.
- Full list: SAM 3 limitations
Questions
Image Segmentation FAQ
What is Meta SAM 3 image segmentation?
It is SAM 3 used on still images: you give a short text phrase, an example box or a click, and SAM 3 returns a pixel-accurate mask, a box and a confidence score for every matching object.
How is SAM 3 different from SAM 1 and SAM 2 on images?
SAM 1 and SAM 2 segment the one object you click or box. SAM 3 can also find every object that matches a phrase like “red cars” or an example box, and it is more accurate than SAM 2 on click-based segmentation too.
How fast is SAM 3 on a single image?
Meta reports about 30 milliseconds for one image with more than 100 detected objects on an H200 GPU. Smaller GPUs are slower, but the image features can be reused for several prompts.
Can SAM 3 segment several kinds of object in one image?
Yes, with one prompt per concept: run “cars”, “bikes” and “people” separately on the same image. Each concept gets its own set of masks.
What output does SAM 3 give for an image?
For each match: a binary mask, a bounding box and a score. You can turn these into PNG masks, polygons, RLE or COCO-style annotations.
Does SAM 3.1 change image segmentation?
Not much. SAM 3.1 mainly speeds up video with many objects. Image prompts, code and results are essentially the same as SAM 3.
Where can I try SAM 3 on images?
In Meta’s free Segment Anything Playground, with the official sam3 code or Hugging Face Transformers, or through hosted APIs such as Roboflow and Ultralytics.