SAM 3
SAM 3は通常の点とボックスにテキストconceptプロンプトを加えてSAMを拡張します。そのため「yellow school bus」のようなフレーズから、一致するすべてのインスタンスを返します。LibreYOLOはLibreYOLO()検出器ファクトリとは別の専用LibreSAMファクトリを通じて、その画像経路に対応します。
- タスク
- instance segmentation
- サイズ
- large at 1008 px
- インストール
pip install libreyolo- サポートティア
- 姉妹ティア、v以降。独自のファクトリと契約を持つ、独立した製品インターフェースです。
- ライセンス
- コード:MIT、重み:SAM License (Meta custom, gated)。商用利用
インストール
SAM 3にはsam追加パッケージが必要で、transformersとtimmがインストールされます。
pip install "libreyolo[sam]"重みにはアクセス制限があります。huggingface.co/facebook/sam3を
開いてMetaのSAM Licenseに同意し、初回ダウンロード前にhf auth loginを実行してください
(またはHF_TOKENを設定します)。LibreYOLOはこのファミリーを初めてダウンロードするときに
ライセンス通知を記録します。
推論
LibreSAM(...)(またはファミリー固有のLibreSAM3(...))はLibreYOLO(...)とは別の
エントリポイントです。プロンプトなしの順伝播には意味がないため、検出器ではなくプロンプト可能な
セグメンターを返します。このファミリーにlibreyolo predict CLIコマンドはありません。
Python APIを使ってください。対応するのは画像推論だけで、SAM 3の動画モデルは対象外です。
from libreyolo import LibreSAM, SAMPLE_IMAGE # "sam3"が唯一のサイズ("large")。別名: "sam3", "sam-3", "sam3-large"model = LibreSAM("sam3") # 点プロンプト。[x, y]はピクセル座標、ラベル1は前景result = model.predict(SAMPLE_IMAGE, points=[640, 420], labels=[1])print(result.masks.xy) # マスクごとのポリゴンprint(result.boxes.xyxy) # マスクから導出した外接ボックス # 点の代わりにボックスプロンプトresult = model.predict(SAMPLE_IMAGE, bboxes=[300, 200, 900, 700])from libreyolo import LibreSAM3, SAMPLE_IMAGE model = LibreSAM3("large") # 1個の物体だけでなく、フレーズに一致するすべてのインスタンスを検出# text=はpoints, bboxes, labels, masksと同時使用不可result = model.predict(SAMPLE_IMAGE, text="a person")print(result.names) # {0: "a person"}print(result.boxes.conf) # インスタンスごとのPCS検出スコアfrom libreyolo import LibreSAM3, SAMPLE_IMAGE model = LibreSAM3("large") # 画像エンコーダーは計算負荷が高い部分。set_image()で1回実行し# 以後のpredict()呼び出しはキャッシュ済み埋め込みベクトルを再利用。text=の# 呼び出しでは内部で再エンコード。trackerとconcept-segmentation encoderは# キャッシュを共有しないためmodel.set_image(SAMPLE_IMAGE)a = model.predict(points=[640, 420], labels=[1])b = model.predict(bboxes=[300, 200, 900, 700])model.reset_image()点とボックスの経路はほかのSAMファミリーと同じです。点プロンプトは1個の物体に[x, y]、
複数の物体に[[x, y], ...]を受け付けます。labelsは各点を1(前景)または0(背景)として示し、
ボックスプロンプトは[x1, y1, x2, y2]またはボックスのリストを受け取ります。この経路のconfは
物体検出の信頼度ではなく、予測マスクの品質(IoU)で絞り込みます。
text=経路はSAM 3で追加された機能です。concept文字列からPromptable Concept Segmentationを
通じて画像内の一致するすべてのインスタンスを返し、点、ボックス、ラベル、マスクとは同時に使えません。
この経路のconfはマスクIoUではなくPCS検出スコアです。デフォルトのままにするとモデル固有の0.3の
しきい値が適用され、conf=0.0ではすべての候補を維持します。プロンプト可能なマスクにはそれ以外の
固定クラスセットがないため、返されるnamesはクラスID0を要求したconcept文字列へ対応付けます。
device=はモデルを移動し、set_image()セッションが有効ならキャッシュ済み埋め込みベクトルも
移動します。train()、val()、export()、track()はすべて、このファミリーでは
NotImplementedErrorを発生させます。LibreYOLOのSAM 3は推論専用で、動画追跡は対象外です。
入力ソースの種類については推論を参照してください。
バリアント
サイズはlargeの1種類で、固定1008 px入力です。SAM 3.1には対応しません。その実装はこのMIT リポジトリへ同梱できない独自ライセンスを採用しており、LibreYOLOが依存するTransformersの バージョンもチェックポイント形式をまだ読み込めないためです。
ライセンス
ダウンロードする特定の重みについて、Hugging Faceリポジトリのライセンスを確認してください。LibreYOLO orgの各チェックポイントにはライセンスが付与されており、同じファミリー内でも常に同一とは限りません。そのリポジトリが正式な情報源です。以下の概要は、このページを最後に検証した時点で適用されていた内容を示します。
これは関連するライセンスの説明であり、法的助言ではありません。商用上重要な場合は、自分でライセンスを読み、専門家の助言を受けてください。
- 原著作物
- SAM 3, Meta FAIR
- アップストリームのライセンス
- SAM License (Meta custom, gated)
- アップストリームのソース
- github.com/facebookresearch/sam3
- LibreYOLOのコード
- MIT
- 重み
- SAM License (Meta custom, gated)、著者が配布。LibreYOLOではホストもミラーもしていません。
- 解釈
- 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. Weights are gated on facebook/sam3 on Hugging Face: you must accept the terms there and authenticate before downloading. LibreYOLO calls SAM 3 through the Apache-2.0 Transformers implementation and vendors none of Meta's model source, but does not redistribute the weights themselves; read the license yourself before relying on it commercially.
LibreYOLOはSAM 3の重みの独自コピーをホストせず、再配布もしません。LibreSAM("sam3")は
Metaのアクセス制限付きHugging Faceリポジトリfacebook/sam3から直接ダウンロードします。
初回ダウンロード前にMetaのSAM Licenseへの同意と認証が必要です。
引用
@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},
}著者によるgithub.com/facebookresearch/sam3#citing-sam-3の引用ブロックからコピーしています。