Instructions to use AvitoTech/SigLIP2-Base-for-animal-identification with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use AvitoTech/SigLIP2-Base-for-animal-identification with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-feature-extraction", model="AvitoTech/SigLIP2-Base-for-animal-identification")# Load model directly from transformers import AutoProcessor, AutoModelForZeroShotImageClassification processor = AutoProcessor.from_pretrained("AvitoTech/SigLIP2-Base-for-animal-identification") model = AutoModelForZeroShotImageClassification.from_pretrained("AvitoTech/SigLIP2-Base-for-animal-identification", device_map="auto") - Notebooks
- Google Colab
- Kaggle
License clarification + a weight-loading issue in the released checkpoint
Hi, and thank you for releasing these models.
We are building a lost-pet matching service and benchmarked six embedding
models on public re-identification datasets (DogFaceNet, MPDD,
CatIndividualImages). SigLIP2-Base-for-animal-identification gave the best
verification performance of all candidates - the lowest EER on all three
datasets, roughly half the error rate of general-purpose SigLIP2 and CLIP
baselines. Thank you for making it public.
Two things.
- License
The model card has no license field, and there is no LICENSE file in the
repository. Could you clarify under which license the weights are released,
and whether commercial use is permitted? We would of course cite your
Journal of Imaging paper.
- A loading issue that may affect other users
The checkpoint does not load correctly with the standard call:
AutoModel.from_pretrained("AvitoTech/SigLIP2-Base-for-animal-identification")
Two reasons:
All 408 tensor keys are prefixed with
clip.. transformers strips only the
target class prefix, which for SiglipModel issiglip, so none of the keys
match. The model silently loads with randomly initialised weights and only
emits a warning. In our first run this produced Top-1 20.2% instead of the
expected ~95%, and we nearly discarded the model as underperforming.text_config.vocab_sizeis absent from config.json, so it defaults to 32000
while the checkpoint's token embedding is [256000, 768].
We worked around both locally (stripping the prefix and setting vocab_size),
after which the model loads with 0 missing / 0 unexpected / 0 mismatched keys
and reproduces the performance reported on your model card.
The same clip. prefix is present in CLIP-ViT-base-for-animal-identification,
but there it happens to load correctly because CLIPModel's prefix is clip.
Thanks again for the models.