Zero-Shot Image Classification
Transformers
Safetensors
siglip
vision
Inference Endpoints
merve HF staff commited on
Commit
365d321
1 Parent(s): a0d740a

Fix snippets

Browse files
Files changed (1) hide show
  1. README.md +8 -5
README.md CHANGED
@@ -3,9 +3,12 @@ license: apache-2.0
3
  tags:
4
  - vision
5
  widget:
6
- - src: https://huggingface.co/datasets/mishig/sample_images/resolve/main/cat-dog-music.png
 
7
  candidate_labels: playing music, playing sports
8
  example_title: Cat & Dog
 
 
9
  ---
10
 
11
  # SigLIP (shape-optimized model)
@@ -37,8 +40,8 @@ import requests
37
  from transformers import AutoProcessor, AutoModel
38
  import torch
39
 
40
- model = AutoModel.from_pretrained("merve/siglip-so400m-patch16-256-i18n")
41
- processor = AutoProcessor.from_pretrained("merve/siglip-so400m-patch16-256-i18n")
42
 
43
  url = "http://images.cocodataset.org/val2017/000000039769.jpg"
44
  image = Image.open(requests.get(url, stream=True).raw)
@@ -62,7 +65,7 @@ from PIL import Image
62
  import requests
63
 
64
  # load pipe
65
- image_classifier = pipeline(task="zero-shot-image-classification", model="merve/siglip-so400m-patch16-256-i18n")
66
 
67
  # load image
68
  url = 'http://images.cocodataset.org/val2017/000000039769.jpg'
@@ -109,4 +112,4 @@ alt="drawing" width="600"/>
109
  archivePrefix={arXiv},
110
  primaryClass={cs.CV}
111
  }
112
- ```
 
3
  tags:
4
  - vision
5
  widget:
6
+ - src: >-
7
+ https://huggingface.co/datasets/mishig/sample_images/resolve/main/cat-dog-music.png
8
  candidate_labels: playing music, playing sports
9
  example_title: Cat & Dog
10
+ pipeline_tag: zero-shot-image-classification
11
+ library_name: transformers
12
  ---
13
 
14
  # SigLIP (shape-optimized model)
 
40
  from transformers import AutoProcessor, AutoModel
41
  import torch
42
 
43
+ model = AutoModel.from_pretrained("google/siglip-so400m-patch16-256-i18n")
44
+ processor = AutoProcessor.from_pretrained("google/siglip-so400m-patch16-256-i18n")
45
 
46
  url = "http://images.cocodataset.org/val2017/000000039769.jpg"
47
  image = Image.open(requests.get(url, stream=True).raw)
 
65
  import requests
66
 
67
  # load pipe
68
+ image_classifier = pipeline(task="zero-shot-image-classification", model="google/siglip-so400m-patch16-256-i18n")
69
 
70
  # load image
71
  url = 'http://images.cocodataset.org/val2017/000000039769.jpg'
 
112
  archivePrefix={arXiv},
113
  primaryClass={cs.CV}
114
  }
115
+ ```