SAM 3
SAM 3 extends SAM with a text-concept prompt on top of the usual points and boxes, so a phrase like "yellow school bus" returns every matching instance. LibreYOLO supports its image path through a dedicated LibreSAM factory, separate from the LibreYOLO() detector factory.
- Tasks
- instance segmentation
- Sizes
- sam3: large at 1008 px; sam31: large at 1008 px
- Install
pip install "libreyolo[sam]"- Support tier
- Sibling tier, since v1.4.0. A separate product surface with its own factory and contract.
- Licenses
- Code MIT, weights SAM License (Meta custom, gated). Commercial use
Install
SAM 3 needs the sam extra, which pulls in transformers and timm.
pip install "libreyolo[sam]"The weights are gated: visit
huggingface.co/facebook/sam3, accept
Meta's SAM License, then run hf auth login (or set HF_TOKEN) before the
first download. LibreYOLO logs a license notice the first time it downloads
this family.
Predict
LibreSAM(...) (or the family-specific LibreSAM3(...)) is a separate entry
point from LibreYOLO(...): it returns a promptable segmenter rather than a
detector, because a forward pass here is meaningless without a prompt. There
is no libreyolo predict CLI command for this family; use the Python API.
Only image inference is supported; SAM 3's video models are out of scope
here.
from libreyolo import LibreSAM, SAMPLE_IMAGE # "sam3" is the only size ("large"); aliases: "sam3", "sam-3", "sam3-large".model = LibreSAM("sam3") # A point prompt: [x, y] in pixel coordinates, label 1 = foreground.result = model.predict(SAMPLE_IMAGE, points=[640, 420], labels=[1])print(result.masks.xy) # polygon per maskprint(result.boxes.xyxy) # tight box derived from the mask # A box prompt instead of a point.result = model.predict(SAMPLE_IMAGE, bboxes=[300, 200, 900, 700])from libreyolo import LibreSAM3, SAMPLE_IMAGE model = LibreSAM3("large") # Finds every instance matching the phrase, not just one object.# text= is mutually exclusive with points, bboxes, labels and masks.result = model.predict(SAMPLE_IMAGE, text="a person")print(result.names) # {0: "a person"}print(result.boxes.conf) # the PCS detection score per instancefrom libreyolo import LibreSAM3, SAMPLE_IMAGE model = LibreSAM3("large") # The image encoder is the expensive part. set_image() runs it once;# every predict() call after that reuses the cached embedding. A# text= call re-encodes internally, since the tracker and the# concept-segmentation encoder do not share a cache.model.set_image(SAMPLE_IMAGE)a = model.predict(points=[640, 420], labels=[1])b = model.predict(bboxes=[300, 200, 900, 700])model.reset_image()The point and box path matches the rest of the SAM family: a point prompt
accepts [x, y] for one object or [[x, y], ...] for several, labels marks
each point 1 (foreground) or 0 (background), and a box prompt takes
[x1, y1, x2, y2] or a list of boxes. conf on this path filters by
predicted mask quality (IoU), not a detection confidence.
The text= path is SAM 3's addition: a concept string returns every matching
instance in the image through Promptable Concept Segmentation, and cannot be
combined with points, boxes, labels or masks. conf there is the PCS
detection score instead of mask IoU; leaving it at the default applies the
model's own 0.3 threshold, and conf=0.0 keeps every candidate. The returned
names maps class id 0 to the requested concept string, since a promptable
mask has no fixed class set otherwise. device= moves the model and, if a
set_image() session is active, its cached embedding. train(), val(),
export() and track() all raise NotImplementedError for this family: SAM
3 is predict-only in LibreYOLO, and video tracking is out of scope. See
prediction for source types.
Variants
One size, large, at a fixed 1008 px input.
SAM 3.1 is supported since 1.8.0 as LibreSAM("sam3.1"), or the
LibreSAM31 class. It runs Meta's SAM 3.1 image path on the same pipeline as
SAM 3, with the same prompts, the same text= concept prompts and the same
Results. Its weights download from the gated LibreYOLO/LibreSAM31large
mirror, converted from Meta's original-format checkpoint, under Meta's SAM
License rather than MIT, so accept the terms on the model page and
authenticate before the first download. SAM 3.1 Object Multiplex video
tracking is not supported.
Licensing
Check the license on the Hugging Face repository of the specific weights you download. Every checkpoint in the LibreYOLO org carries one, and they are not always the same across a family. That repository is the authoritative source; the summary below describes what applied when this page was last verified.
This is a description of the licenses involved, not legal advice. If the answer matters commercially, read the licenses yourself and take your own counsel.
- Original work
- SAM 3, Meta FAIR
- Upstream license
- SAM License (Meta custom, gated)
- Upstream source
- github.com/facebookresearch/sam3
- LibreYOLO code
- MIT
- Weights
- SAM License (Meta custom, gated), republished at huggingface.co/LibreYOLO
- Interpretation
- The SAM License is Meta's own agreement, not an OSI-approved license like MIT or Apache-2.0. It grants a worldwide, royalty-free license to use, reproduce, distribute and create derivative works, and does not itself say the weights are non-commercial. It does add terms Apache and MIT do not: publications that use the results must acknowledge SAM Materials, reverse engineering is prohibited, use is subject to export-control and sanctions compliance, filing IP litigation against Meta over the materials terminates your license, and Meta may amend the agreement. This page also covers SAM 3.1 (key sam31), the retrained detector release from the same facebookresearch/sam3 project, whose weights are under the same SAM License. SAM 3 weights are gated on facebook/sam3 on Hugging Face: you must accept the terms there and authenticate before downloading, and LibreYOLO does not redistribute them. SAM 3.1 weights come from facebook/sam3.1 at revision daa63191845a41281374e725f4c9e51c7a824460; because the SAM License permits redistribution when its terms are passed through, LibreYOLO mirrors the converted image path (detector and interactive head, no learned value changed, Object Multiplex video weights not included) at LibreYOLO/LibreSAM31large with the license verbatim and its own access gate, so you must accept the terms there too. LibreYOLO runs both through the Apache-2.0 Transformers SAM 3 implementation and vendors none of Meta's model source; only the SAM 3.1 key mapping is adapted from the Apache-2.0 Transformers converters. Neither set of weights is covered by LibreYOLO's MIT license; read the SAM License yourself before relying on it commercially.
LibreYOLO does not host its own copy of the SAM 3 weights and does not
redistribute them. LibreSAM("sam3") downloads directly from Meta's gated
facebook/sam3 repository on Hugging Face, which requires accepting Meta's
SAM License and authenticating before the first download.
Citation
@misc{carion2025sam3segmentconcepts,
title={SAM 3: Segment Anything with Concepts},
author={Nicolas Carion and Laura Gustafson and Yuan-Ting Hu and Shoubhik Debnath and Ronghang Hu and Didac Suris and Chaitanya Ryali and Kalyan Vasudev Alwala and Haitham Khedr and Andrew Huang and Jie Lei and Tengyu Ma and Baishan Guo and Arpit Kalla and Markus Marks and Joseph Greer and Meng Wang and Peize Sun and Roman Rädle and Triantafyllos Afouras and Effrosyni Mavroudi and Katherine Xu and Tsung-Han Wu and Yu Zhou and Liliane Momeni and Rishi Hazra and Shuangrui Ding and Sagar Vaze and Francois Porcher and Feng Li and Siyuan Li and Aishwarya Kamath and Ho Kei Cheng and Piotr Dollár and Nikhila Ravi and Kate Saenko and Pengchuan Zhang and Christoph Feichtenhofer},
year={2025},
eprint={2511.16719},
archivePrefix={arXiv},
primaryClass={cs.CV},
url={https://arxiv.org/abs/2511.16719},
}Copied from the authors' citation block at github.com/facebookresearch/sam3#citing-sam-3.