Skip to content

Latest commit

 

History

5 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

license apache-2.0
library_name onnxruntime
tags
siglip2
onnx
zero-shot-image-classification

SigLIP2 ONNX Bundle

Fused zero-shot ONNX export of google/siglip2-base-patch16-224.

Usage

Published on Hugging Face as horrible/siglip2-base-patch16-224. Inference uses ONNX Runtime on CPU.

Inputs: pixel_values, input_ids
Output: logits_per_image (plus auxiliary embeds/logits from the fused graph)

Format candidate labels with the bundle prompt template before tokenization:

This is a photo of {label}.

Files

File Purpose
model.onnx Fused zero-shot SigLIP2 graph
config.json Model config
preprocessor_config.json Image preprocessor
tokenizer.json, tokenizer_config.json, special_tokens_map.json Text tokenizer
prompt_template.jinja Zero-shot label prompt template

Export and republish

The PyTorch checkpoint does not ship a fused zero-shot ONNX graph. Use this repo to export and upload a fresh bundle:

python -m venv .venv
source .venv/bin/activate   # Windows: .venv\Scripts\activate
pip install -e ".[dev]"

python scripts/export_onnx_model.py --output ./bundle
hf upload horrible/siglip2-base-patch16-224 ./bundle .

Development

pytest -m "not integration"
pytest -m integration   # downloads SigLIP2 weights and runs export + parity checks

About

Tools for exporting & publishing SigLIP2 as ONNX model

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages