Tracing one apple with a polygon tool takes a minute or so. Tracing every apple in a few thousand orchard photos takes a team and a few weeks. That gap is why SAM 3 auto-labeling got so much attention: you type a short phrase such as “red apple”, and the model returns a mask for every matching apple in the picture.
It sounds like the end of manual labeling. It is not. This guide shows what SAM 3 really does, how to set up a simple labeling run, how to write prompts that work, and a review checklist that keeps bad masks out of your training data.
In this article
What SAM 3 Does Differently
Earlier Segment Anything models worked one object at a time. You clicked or drew a box, and the model gave you one mask. SAM 3, released by Meta in November 2025, adds a new job: find every object that matches a concept. The paper calls this Promptable Concept Segmentation, or PCS.
A concept prompt can be a short noun phrase, a few example boxes drawn on the image, or both. The model returns a mask and a unique ID for each matching object. Per the SAM 3 paper, the text is limited to simple noun phrases, like “red apple” or “striped cat”. It is not built for long sentences or questions that need reasoning.
Under the hood, the model has a detector and a video tracker that share one vision backbone. The official repository lists 848 million parameters. The authors report about 30 milliseconds per image on an H200 GPU, for an image with more than 100 detected objects. That is a data-center card, so do not expect the same speed on a small GPU.
Why this matters for labeling
Segmentation masks are the most expensive label type to draw by hand. If you are not sure whether you even need masks, read our guide on image classification vs object detection vs segmentation first. If you do need them, a model that drafts the masks for you changes the job from “draw” to “check”. Checking is faster than drawing, as long as the drafts are good.
The SAM 3 Auto-Labeling Workflow in Five Steps
Here is a simple order of work. It keeps the model’s guesses separate from the labels you trust.
- Write your class list and rules first. Decide what each class is, and what is not in it. For example: “apple” means a whole fruit that is at least half visible.
- Test prompts on 30 to 50 images. Try two or three phrases per class. Pick the phrase that gives the cleanest masks.
- Run the model on the whole set. Save masks, boxes and scores for every image. Keep the scores, because you will use them to sort the review queue.
- Review by sampling, then by score. Check a random sample first to learn the error rate. Then review the low-score images in full.
- Export and train. Convert the approved masks to your training format, hold back a hand-labeled test set, and train your own model.
Step 5 has a catch that many guides skip. If you test your final model only on SAM 3’s own labels, the score tells you how well your model copies SAM 3, not how well it sees the real world. Keep a small test set labeled by a person, and never let auto-labels into it.
What You Need Before You Start
These requirements come from the official repository README at the time of writing. Check it again before you start, because they can change.
- Software: Python 3.12 or higher and PyTorch 2.7 or higher.
- Hardware: a CUDA-compatible GPU with CUDA 12.6 or higher. The repository assumes CUDA, and users have asked for Apple Silicon and CPU-only support in the issue tracker. Plan on renting a GPU if you do not own one.
- Access: you must request access to the checkpoints on the Hugging Face model page, accept the terms, and log in before you can download them.
- Newer checkpoints: the repository also lists SAM 3.1, released on 27 March 2026. It speeds up tracking several objects in video. For still-image labeling, the original steps below still apply.
Read the license once
SAM 3 uses Meta’s own “SAM License”, not a standard open-source license. In plain words, it lets you use, copy, change and share the materials, and you own the changes you make. It also says your use must follow the law, including export rules, and it bans uses such as military or weapons work and anything under ITAR. If you share the model or a derived version, you must include the license. This is a short summary, not legal advice, so read the full text if you plan a commercial product.
A Minimal Labeling Script
The calls below follow the basic usage example in the official README. The loop and the YOLO export are our own sketch. Mask formats can differ between versions, so print the shapes on one image before you run a whole folder.
from pathlib import Path
from PIL import Image
import numpy as np, cv2
from sam3.model_builder import build_sam3_image_model
from sam3.model.sam3_image_processor import Sam3Processor
PROMPT, CLASS_ID, MIN_SCORE = "red apple", 0, 0.5
model = build_sam3_image_model()
processor = Sam3Processor(model)
Path("labels").mkdir(exist_ok=True)
for img_path in sorted(Path("images").glob("*.jpg")):
image = Image.open(img_path).convert("RGB")
w, h = image.size
state = processor.set_image(image)
out = processor.set_text_prompt(state=state, prompt=PROMPT)
lines = []
for mask, score in zip(out["masks"], out["scores"]):
if float(score) < MIN_SCORE:
continue
m = np.squeeze(mask.cpu().numpy()).astype(np.uint8)
cnts, _ = cv2.findContours(m, cv2.RETR_EXTERNAL,
cv2.CHAIN_APPROX_SIMPLE)
if not cnts:
continue
c = max(cnts, key=cv2.contourArea).reshape(-1, 2)
if len(c) < 3:
continue
pts = " ".join(f"{x/w:.5f} {y/h:.5f}" for x, y in c)
lines.append(f"{CLASS_ID} {pts}")
(Path("labels") / f"{img_path.stem}.txt").write_text("\n".join(lines))
Each output line is a class number followed by the polygon points, scaled from 0 to 1. This is the text format that YOLO segmentation training expects. If you train with a YOLO model, our YOLO26 vs YOLO11 comparison can help you pick one.
Practical tip: the sketch keeps only the largest outline per mask, which drops holes and detached parts. That is fine for apples. For objects with holes, like rings or frames, keep the inner contours as well, or check whether your training tool supports them.
How to Write Text Prompts That Work
The prompt is the only control you have in text mode, so it is worth some care. The paper gives a few clues about what to expect. Words with two meanings are a real problem, and it uses “mouse” as its own example: the device or the animal.
Prompt rules we would follow
- Use a plain noun phrase. “Yellow school bus” fits the design. “The bus that is about to turn left” does not.
- Avoid words with two meanings. Add a modifier that removes the doubt, such as “computer mouse”.
- Avoid vague or opinion words. The paper lists “cozy” and “large” as examples of descriptors that different people read differently.
- Keep one concept per run. Run “red apple” and “green apple” as two prompts, not one long phrase. The paper warns that mixing category definitions makes the behavior undefined.
- Add example boxes when text misses. A positive box on a missed object, or a negative box on a false match, refines the result. The Hugging Face model card shows this with a text prompt plus a negative box.
A simple prompt test table
Before the full run, fill in a table like this for each class on your 30 to 50 test images. It takes a few minutes and saves hours later. These column names are only a suggestion.
| Prompt tried | Missed objects | Wrong objects | Sloppy edges | Keep? |
|---|---|---|---|---|
| apple | count them | count them | count them | yes / no |
| red apple | count them | count them | count them | yes / no |
| apple fruit | count them | count them | count them | yes / no |
Pick the phrase with the fewest wrong objects, not the most masks. A prompt that finds everything and also finds shadows is worse than one that misses a few. Missed objects are easy to add later. Wrong objects hide inside the dataset and teach the model bad habits.
A Review Checklist for Auto-Generated Masks
Auto-labels are drafts. The review step decides whether your dataset is good, so give it a clear process.
- Edges. Does the mask follow the object, or spill into the background? Zoom in on a few.
- Merged objects. Do two touching objects share one mask? This is common in crowded scenes.
- Missed objects. Look for small, dark, blurry or half-hidden objects with no mask.
- Look-alikes. Check for masks on things that match the word but not your class rule, such as a toy apple or a picture of an apple.
- Score pattern. Review all images where the lowest mask score is below your cutoff. Do not trust a high score blindly, because a confident mask can still be wrong.
- Error rate. From a random sample of 100 images, count the images that needed any fix. If more than a small share did, change the prompt or add example boxes before going on.
The cut-off for “a small share” is your call, and it depends on how much label noise your project can take. A model for sorting fruit tolerates more than one used for safety checks. If you do not have the time to review, a data annotation team such as Annotationera can label images or check auto-generated masks. For a sense of what that costs, see our data annotation cost guide.
Where SAM 3 Struggles
The authors are open about this. The paper’s limits section says SAM 3 has trouble with fine-grained concepts outside its training domain, in a zero-shot setting. Their examples are aircraft types and medical terms. It also names niche image types, such as thermal imagery.
Outside studies point the same way. A paper on pathology images found that text-only prompts poorly activated nuclear concepts. A study on robotic surgery scenes found that text prompts did badly on surgical tools, while box and point prompts held up much better. A third group published a medical version of the model, fine-tuned on many medical datasets, because the plain model fell short there.
The paper adds one hopeful point. With a small amount of human-labeled data, SAM 3 adapts to new domains quickly. So the usual path for a hard domain is: label a small set by hand, fine-tune, then auto-label the rest.
When to use SAM 3 labels and when not to
| Your situation | Lean toward | Why |
|---|---|---|
| Everyday objects: fruit, cars, boxes, people | SAM 3 drafts plus review | Close to what the model saw in training |
| Fine-grained classes, like one aircraft type vs another | Hand labels first, then fine-tune | The paper names this as a weak spot |
| Medical, thermal or other niche images | Expert labels; box prompts if you use SAM at all | Text prompts were weak in the studies above |
| Very thin or tiny defects | Test on 50 images before you commit | No source we read covers this, so measure it yourself |
| Need fast, cheap inference on a small device | Train a small model, using SAM 3 only as labeler | SAM 3 is large and needs a CUDA GPU |
One more point on scoring. A study from Cornell and the University of the Peloponnese compared zero-shot SAM 3 with fine-tuned YOLO11 models on a dense apple dataset. Its main lesson was about method: the IoU threshold you pick can create performance gaps of up to 30 percent. So if you compare SAM 3 and your own model, use the same threshold for both and say which one you used.
Our Take
SAM 3 is a strong first-draft labeler for everyday objects, and the review habit matters more than the model. The risk is not that the masks look bad. The risk is that they look good enough that nobody checks them, and a few wrong patterns end up inside thousands of training images.
Our advice is simple. Use SAM 3 to make masks, not to decide what the classes are. Keep a hand-labeled test set. Do not skip the sampling step. And if the images come from a special field, assume the text prompts will be weaker until you have measured them.
Questions People Ask
What is SAM 3 used for?
It finds, segments and tracks objects in images and video from a text phrase, example boxes, or clicks. A common use is drafting masks for training data.
Can SAM 3 replace YOLO?
Not for most deployments. SAM 3 is a large model that needs a CUDA GPU. A small YOLO model trained on your labels is lighter to run. The two work well together: SAM 3 helps make the labels, and YOLO runs in production.
Do I need a GPU to run SAM 3?
The official repository lists a CUDA GPU with CUDA 12.6 or higher as a requirement. Support for other hardware has been requested by users, but we did not find it in the README.
Is SAM 3 free for commercial use?
The SAM License grants a royalty-free license to use, copy, modify and distribute the materials, with conditions such as legal compliance and a ban on some uses. Read the full text yourself, and ask a lawyer if you plan to sell a product.
How many images should I review by hand?
There is no fixed number. Start with a random sample of about 100 images to measure the error rate, then review every low-score image. If the error rate is high, fix the prompt before reviewing more.
Does SAM 3 work on video?
Yes. It tracks matching objects across frames. The paper defines the task for clips of up to 30 seconds, and says the cost grows with the number of tracked objects.
Final Thoughts
SAM 3 auto-labeling can cut the slowest part of a segmentation project, but only if you treat its output as a draft. Test your prompts on a small set, write down your class rules, review by sample and by score, and keep a hand-labeled test set that the model never touched.
For more guides on models, tools and labeling, browse our computer vision section.
Sources: SAM 3: Segment Anything with Concepts (arXiv), facebookresearch/sam3 on GitHub, facebook/sam3 on Hugging Face, Generalization vs. Specialization: SAM3 against fine-tuned YOLO detectors (arXiv).

Leave a Reply