Image and text embeddings
SigLIP 2 Base
Google's image and text model from 2025: one space of vectors for photos and text in many languages, for search and zero-shot labels. Apache-2.0.
About this model
SigLIP 2 turns a photo and a piece of text into vectors of 768 numbers that are close when they match: label photos with words chosen at run time, or search photos with a description. It was trained on multilingual data, so queries need not be in English.
This is the Base model at 224 x 224 pixels with 16-pixel patches: an image encoder (93 million parameters) and a text encoder (282 million, most of it the 256,000-token vocabulary). It comes as two packs. The text pack carries the model's Gemma tokenizer, so the app passes plain text.
Unlike CLIP, each label is scored on its own with a sigmoid, sigmoid(112.67 × cosine − 16.77), so scores need not add up to 1 and an image can match several labels or none. The scores are often small (0.05 for a clear photo of a dog against "a photo of a dog"): compare them between labels, or set a threshold from your own photos.
What you can build
- Search a photo library in many languages
- Label photos with categories chosen at run time, several at once
- Find similar or duplicate photos (compare image embeddings)
- Sort or filter photos by what they show
Zero-shot labels: golden retriever dog
f16Karen Arnold, CC0, https://commons.wikimedia.org/wiki/File:Golden-retriever-dog-1362597631o6g.jpg
The photo against ten labels ("a photo of a dog", "a photo of a cat", ... "a photo of a flower"), scored as sigmoid(112.67 × cosine similarity − 16.77), each label on its own, on Metal. Top three: a dog 0.07, a cat 0.00, a bird 0.00.Zero-shot labels: sailboat
f16Kbuihner, Public domain, https://commons.wikimedia.org/wiki/File:Kite_sailboat_dinghy.jpg
The photo against ten labels ("a photo of a dog", "a photo of a cat", ... "a photo of a flower"), scored as sigmoid(112.67 × cosine similarity − 16.77), each label on its own, on Metal. Top three: a boat 0.03, a bird 0.00, a cat 0.00.Zero-shot labels: acoustic guitar
f16Wilfredor, CC0, https://commons.wikimedia.org/wiki/File:Man_playing_an_acoustic_brazilian_guitar_(Viol%C3%A3o)_on_Marco_Zero_Square,_Refice,_Pernambuco,_Brazil.jpg
The photo against ten labels ("a photo of a dog", "a photo of a cat", ... "a photo of a flower"), scored as sigmoid(112.67 × cosine similarity − 16.77), each label on its own, on Metal. Top three: a musical instrument 0.09, a boat 0.00, a cat 0.00.Photo search: "something to drink coffee from"
f16something to drink coffee from
The query against the 53 gallery photos (public-domain and CC0, Wikimedia Commons), by cosine similarity, on Metal. Best three: espresso cup (a02-espresso-cup.jpg, 0.125); coffee mug (b19-coffee-mug.jpg, 0.115); toaster (b43-toaster.jpg, 0.061).
Photo search: "a vehicle for fighting fires"
f16a vehicle for fighting fires
The query against the 53 gallery photos (public-domain and CC0, Wikimedia Commons), by cosine similarity, on Metal. Best three: fire truck (b31-fire-truck.jpg, 0.100); pickup truck (b49-pickup-truck.jpg, 0.070); tractor (b33-tractor.jpg, 0.066).
Photo search: "an animal that lives in the sea"
f16an animal that lives in the sea
The query against the 53 gallery photos (public-domain and CC0, Wikimedia Commons), by cosine similarity, on Metal. Best three: jellyfish (b11-jellyfish.jpg, 0.105); goldfish (b00-goldfish.jpg, 0.074); elephant (b06-elephant.jpg, 0.067).
Variants & downloads
Choose the build for your appModel files are hosted on Google Drive. Large files may open a confirmation page before downloading.
Small
SlabWeights stored as int8 in blocks of 64, decoded to float when loading, so it runs at the same speed. About 45% smaller; embeddings move slightly more (see Accuracy).
Platforms: macos · android
siglip2-base-image-int8.slab
98.6 MB · Hosted download
SHA-256 checksum
73949f3c5ca53dc384bacd182b01a1ab5effe90c553e71506c777174b8fb3c0csiglip2-base-text-int8.slab
297 MB · Hosted download
SHA-256 checksum
de24fc641e589e60ad6f8508eadc642824ef883debea5463d53aad9d57ccb346LICENSE-Apache-2.0.txt
11 KB
SHA-256 checksum
7a304fe05b20275589520f368cdf9c389fa34d0d65791bfc89b9796b43d6462bConversion details
- command
- hf download google/siglip2-base-patch16-224 --revision 75de2d55ec2d0b4efc50b3e9ad70dba96a7b2fa2 --local-dir siglip2-base-patch16-224 --include "*.json" --include model.safetensors python -c "import torch; from transformers import AutoModel; torch.set_grad_enabled(False); m = AutoModel.from_pretrained('siglip2-base-patch16-224').eval(); I = type('I', (torch.nn.Module,), {'forward': lambda s, pixel_values: s.m.get_image_features(pixel_values=pixel_values).pooler_output}); T = type('T', (torch.nn.Module,), {'forward': lambda s, input_ids: s.m.get_text_features(input_ids=input_ids).pooler_output}); i = I(); i.m = m; t = T(); t.m = m; torch.onnx.export(i, (torch.zeros(1, 3, 224, 224),), 'siglip2-base-image.onnx', input_names=['pixel_values'], output_names=['image_embeds'], opset_version=17, dynamo=False); torch.onnx.export(t, (torch.zeros(1, 64, dtype=torch.long),), 'siglip2-base-text.onnx', input_names=['input_ids'], output_names=['text_embeds'], opset_version=17, dynamo=False)" slab-load convert siglip2-base-image.onnx siglip2-base-image.slab --input pixel_values=1x3x224x224 --meta task=embed --meta resize=stretch --meta interpolation=bilinear --meta antialias:bool=true --meta normalize=neg_one_to_one --meta color=rgb slab-load convert siglip2-base-text.onnx siglip2-base-text.slab --input input_ids=1x64 --meta task=embed slab-load quantize siglip2-base-image.slab siglip2-base-image-int8.slab slab-load quantize siglip2-base-text.slab siglip2-base-text-int8.slab slab-load tokenizer siglip2-base-text-int8.slab siglip2-base-patch16-224/tokenizer.json slab-load meta set siglip2-base-image-int8.slab default_backend.macos=gpu slab-load meta set siglip2-base-text-int8.slab default_backend.macos=gpu
Integration examples
Python
python
import numpy as np, slab
cfg = slab.Config(cache_dir="/tmp/slab_cache", license=open("license.slablic.txt").read())
images = slab.Session(cfg, "siglip2-base-image-f16.slab")
texts = slab.Session(cfg, "siglip2-base-text-f16.slab") # carries the tokenizer
def embed(session, inp):
out = session.run(inp)
out.normalize_l2()
return out.numpy(0).reshape(-1)
photo = embed(images, slab.Input(frame=slab.Frame.open("photo.jpg")))
labels = ["a photo of a dog", "a photo of a cat", "a photo of a car"]
sims = np.array([photo @ embed(texts, slab.Input(text=t)) for t in labels]) # cosine similarities
probs = 1 / (1 + np.exp(-(112.67 * sims - 16.77))) # sigmoid per label, as SigLIP 2
print({l: round(float(p), 3) for l, p in zip(labels, probs)})
Device & backend compatibility
Pack default: macos / GPU. The fastest backend on the Mac that prepares quickly: an image in 11.5 ms and a short text in 6.8 ms. The Neural Engine runs only the image pack and takes about 9 s to prepare it.
| Platform | Engine | Status | Precision |
|---|---|---|---|
| apple | CPU CPU | Supported Measured on macOS: both packs. | f32 |
| apple | Metal GPU | Supported Measured on macOS: both packs. The default. | f32 |
| apple | Apple Neural Engine NPU | Supported Measured on macOS: the image pack only (it computes in FP16 and takes about 9 s to prepare). The text pack takes token ids, which the Neural Engine path does not accept. | f16 |
| android | CPU CPU | Supported Measured on a Samsung Galaxy S23 Ultra (Snapdragon 8 Gen 2, Adreno 740), Android 17. | f32 |
| android | Vulkan GPU | Supported Measured on a Samsung Galaxy S23 Ultra (Snapdragon 8 Gen 2, Adreno 740), Android 17. | f32 |
| android | Qualcomm Hexagon NPU (QNN) NPU | Not supported Tried on a Samsung Galaxy S23 Ultra (Hexagon v73): One of the model's nodes does not translate to QNN in Slab yet. | — |
Performance
Results depend on the device, runtime, and test conditions. Each measurement keeps its own context.
Mac with Apple M1 Max
Slab · CPU
macOS 26.6.2
124.8 ms
Measured time · scope below
Image encoder: median of 100 warm runs of the model (Slab's run time). From a 1920 x 1080 photo, resizing included: 124.6 ms median of 20. Peak memory after opening and one run: 455 MB.
Mac with Apple M1 Max
Slab · GPU
macOS 26.6.2
11.5 ms
Measured time · scope below
Image encoder: median of 100 warm runs of the model (Slab's run time). From a 1920 x 1080 photo, resizing included: 13.0 ms median of 20. Peak memory after opening and one run: 1205 MB.
Mac with Apple M1 Max
Slab · NPU
macOS 26.6.2
10.1 ms
Measured time · scope below
Image encoder: median of 100 warm runs of the model (Slab's run time). From a 1920 x 1080 photo, resizing included: 11.8 ms median of 20. Peak memory after opening and one run: 1203 MB.
Mac with Apple M1 Max
Slab · CPU
macOS 26.6.2
34.1 ms
Measured time · scope below
Text encoder: Input(text="a photo of a dog"), tokenizing included, median of 100. Peak memory after opening and one run: 1433 MB.
Mac with Apple M1 Max
Slab · GPU
macOS 26.6.2
8.4 ms
Measured time · scope below
Text encoder: Input(text="a photo of a dog"), tokenizing included, median of 100. Peak memory after opening and one run: 3814 MB.
Samsung Galaxy S23 Ultra (Snapdragon 8 Gen 2)
Slab · CPU
Android 17
647.0 ms
Measured time · scope below
Image encoder: median of 18 warm runs of the model (Slab's run time). From a 1920 x 1080 photo, preprocessing included: 614 ms median. open_ms: opening the session. Peak memory (resident) after the runs: 417 MB. Text encoder, Input(text="a photo of a dog"): 208 ms median of 56.
Samsung Galaxy S23 Ultra (Snapdragon 8 Gen 2)
Slab · GPU
Android 17
256.0 ms
Measured time · scope below
Image encoder: median of 38 warm runs of the model (Slab's run time). From a 1920 x 1080 photo, preprocessing included: 258 ms median. open_ms: opening the session with the GPU programs already in the cache folder (the first open on a device compiles them, about 0.3 s more). Peak memory (resident) after the runs: 426 MB. Text encoder, Input(text="a photo of a dog"): 79.7 ms median of 100.
Accuracy checks
macos · CPU · int8
The upstream PyTorch model against Hugging Face's SiglipProcessor, on 53 public-domain and CC0 photos (Wikimedia Commons) and the same texts; Slab's image path starts from the photo file (Frame)
Image embeddings: cosine similarity 0.999642 on average, 0.997738 on the worst of 53 photos. Text embeddings: 0.9998643 on average, 0.9996829 at worst (58 prompts and sentences in several languages). Zero-shot: the same label as upstream for 53 of 53 photos (each photo against all 53 labels as "a photo of a ..."); right for 46 (upstream 46).
macos · GPU · int8
The upstream PyTorch model against Hugging Face's SiglipProcessor, on 53 public-domain and CC0 photos (Wikimedia Commons) and the same texts; Slab's image path starts from the photo file (Frame)
Image embeddings: cosine similarity 0.999642 on average, 0.997737 on the worst of 53 photos. Text embeddings: 0.9998643 on average, 0.9996829 at worst (58 prompts and sentences in several languages). Zero-shot: the same label as upstream for 53 of 53 photos (each photo against all 53 labels as "a photo of a ..."); right for 46 (upstream 46).
macos · NPU · int8
The upstream PyTorch model against Hugging Face's SiglipProcessor, on 53 public-domain and CC0 photos (Wikimedia Commons) and the same texts; Slab's image path starts from the photo file (Frame)
Image embeddings: cosine similarity 0.999633 on average, 0.997650 on the worst of 53 photos. The text pack does not run on the Neural Engine.
Before you choose this model
- The text pack is large: 575 MB as FP16 and 311 MB as int8, most of it the vocabulary. Slab expands the weights to float when loading: with the text pack open and one run, the process peaks at about 1.6 GB on the CPU and 4 GB on the GPU (see Benchmarks). Plan memory for it on phones.
- Text beyond 64 tokens is cut. The text is not lowercased (as Hugging Face's processor); write labels the way the model saw them, such as "a photo of a dog".
- Weak at fine detail: counting, small text, fine-grained species or car models.
- Learned from web data, with its biases (see Google's model card).
- The text pack takes token ids, which Slab's Neural Engine path does not accept: it runs on the GPU or CPU. The image pack runs on all three.