🚀 SigLIP 2 So400m
SigLIP 2 は、SigLIP の事前学習目的を、以前に独立して開発された手法を統合したレシピに拡張し、セマンティック理解、位置特定、および密な特徴量を向上させています。
🚀 クイックスタート
想定される用途
このモデルは、ゼロショット画像分類や画像 - テキスト検索などのタスクに生モデルとして使用できます。また、VLM(およびその他のビジョンタスク)のビジョンエンコーダーとしても利用できます。
以下は、このモデルを使用してゼロショット画像分類を実行する方法です。
from transformers import pipeline
ckpt = "google/siglip2-so400m-patch16-512"
image_classifier = pipeline(model=ckpt, task="zero-shot-image-classification")
url = "http://images.cocodataset.org/val2017/000000039769.jpg"
candidate_labels = ["2 cats", "a plane", "a remote"]
outputs = image_classifier(image, candidate_labels)
print(outputs)
また、Vision Tower を使用して画像をエンコードすることもできます。
import torch
from transformers import AutoModel, AutoProcessor
from transformers.image_utils import load_image
ckpt = "google/siglip2-so400m-patch16-512"
model = AutoModel.from_pretrained(ckpt, device_map="auto").eval()
processor = AutoProcessor.from_pretrained(ckpt)
image = load_image("https://huggingface.co/datasets/merve/coco/resolve/main/val2017/000000000285.jpg")
inputs = processor(images=[image], return_tensors="pt").to(model.device)
with torch.no_grad():
image_embeddings = model.get_image_features(**inputs)
print(image_embeddings.shape)
より多くのコード例については、siglip ドキュメントを参照してください。
💻 使用例
基本的な使用法
from transformers import pipeline
ckpt = "google/siglip2-so400m-patch16-512"
image_classifier = pipeline(model=ckpt, task="zero-shot-image-classification")
url = "http://images.cocodataset.org/val2017/000000039769.jpg"
candidate_labels = ["2 cats", "a plane", "a remote"]
outputs = image_classifier(image, candidate_labels)
print(outputs)
高度な使用法
import torch
from transformers import AutoModel, AutoProcessor
from transformers.image_utils import load_image
ckpt = "google/siglip2-so400m-patch16-512"
model = AutoModel.from_pretrained(ckpt, device_map="auto").eval()
processor = AutoProcessor.from_pretrained(ckpt)
image = load_image("https://huggingface.co/datasets/merve/coco/resolve/main/val2017/000000000285.jpg")
inputs = processor(images=[image], return_tensors="pt").to(model.device)
with torch.no_grad():
image_embeddings = model.get_image_features(**inputs)
print(image_embeddings.shape)
🔧 技術詳細
学習手順
SigLIP 2 は、SigLIP にいくつかの賢い学習目的を追加しています。
- デコーダー損失
- グローバル - ローカルおよびマスクされた予測損失
- アスペクト比と解像度の適応性
学習データ
SigLIP 2 は、WebLI データセット (Chen et al., 2023) で事前学習されています。
コンピューティング
このモデルは、最大 2048 個の TPU - v5e チップで学習されました。
📚 ドキュメント
評価結果
SigLIP 2 の評価結果は以下の通りです(論文から引用)。

BibTeX エントリと引用情報
@misc{tschannen2025siglip2multilingualvisionlanguage,
title={SigLIP 2: Multilingual Vision-Language Encoders with Improved Semantic Understanding, Localization, and Dense Features},
author={Michael Tschannen and Alexey Gritsenko and Xiao Wang and Muhammad Ferjad Naeem and Ibrahim Alabdulmohsin and Nikhil Parthasarathy and Talfan Evans and Lucas Beyer and Ye Xia and Basil Mustafa and Olivier Hénaff and Jeremiah Harmsen and Andreas Steiner and Xiaohua Zhai},
year={2025},
eprint={2502.14786},
archivePrefix={arXiv},
primaryClass={cs.CV},
url={https://arxiv.org/abs/2502.14786},
}
📄 ライセンス
このモデルは Apache - 2.0 ライセンスの下で提供されています。