Instructions to use google/siglip2-base-patch16-naflex with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use google/siglip2-base-patch16-naflex with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("zero-shot-image-classification", model="google/siglip2-base-patch16-naflex") pipe( "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/hub/parrots.png", candidate_labels=["animals", "humans", "landscape"], )# Load model directly from transformers import AutoProcessor, AutoModelForZeroShotImageClassification processor = AutoProcessor.from_pretrained("google/siglip2-base-patch16-naflex") model = AutoModelForZeroShotImageClassification.from_pretrained("google/siglip2-base-patch16-naflex") - Notebooks
- Google Colab
- Kaggle
Fix error in example code snippet
#3
by marksverdhei - opened
Looks like you forgot to load the image from the url in the first example.
This results in name error because the image object does not exist.
This PR fixes that.
(You might have to fix this in the other siglip repos as well)