Instructions to use google/siglip-so400m-patch14-384 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use google/siglip-so400m-patch14-384 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("zero-shot-image-classification", model="google/siglip-so400m-patch14-384") pipe( "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/hub/parrots.png", candidate_labels=["animals", "humans", "landscape"], )# pip install -U transformers accelerate # Load model directly from transformers import AutoProcessor, AutoModelForZeroShotImageClassification processor = AutoProcessor.from_pretrained("google/siglip-so400m-patch14-384") model = AutoModelForZeroShotImageClassification.from_pretrained("google/siglip-so400m-patch14-384", device_map="auto") - Notebooks
- Google Colab
- Kaggle
Update README.md
Browse files
README.md
CHANGED
|
@@ -56,7 +56,7 @@ print(f"{probs[0][0]:.1%} that image 0 is '{texts[0]}'")
|
|
| 56 |
|
| 57 |
Alternatively, one can leverage the pipeline API which abstracts away the complexity for the user:
|
| 58 |
|
| 59 |
-
```
|
| 60 |
from transformers import pipeline
|
| 61 |
from PIL import Image
|
| 62 |
import requests
|
|
|
|
| 56 |
|
| 57 |
Alternatively, one can leverage the pipeline API which abstracts away the complexity for the user:
|
| 58 |
|
| 59 |
+
```python
|
| 60 |
from transformers import pipeline
|
| 61 |
from PIL import Image
|
| 62 |
import requests
|