Instructions to use google/siglip2-so400m-patch16-naflex with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use google/siglip2-so400m-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-so400m-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-so400m-patch16-naflex") model = AutoModelForZeroShotImageClassification.from_pretrained("google/siglip2-so400m-patch16-naflex") - Notebooks
- Google Colab
- Kaggle
Not getting great semantic search results with this model
#5
by stephenmarsh - opened
Has anyone else had difficulty getting this model to yield decent results for semantic text searches of images? I put in the first 30,000 or so images from The Met's collection. So far my best result is "chair" giving me some chairs but also vases and tables.
A search for "horse" yields no horses, only seemingly random objects.
I spent many hours sanity-checking and debugging these issues and regenerating embeddings, but I can't get any better performance out of it.
Anyone experiencing similar or have any advice/guidance/wisdom on the situation?
Thanks in advance
