Image Classification
Transformers
Safetensors
siglip_vision_model
Generated from Trainer
siglip
custom_code
Instructions to use p1atdev/siglip-tagger-test-3 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use p1atdev/siglip-tagger-test-3 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-classification", model="p1atdev/siglip-tagger-test-3", trust_remote_code=True) pipe("https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/hub/parrots.png")# Load model directly from transformers import AutoTokenizer, AutoModelForImageClassification tokenizer = AutoTokenizer.from_pretrained("p1atdev/siglip-tagger-test-3", trust_remote_code=True) model = AutoModelForImageClassification.from_pretrained("p1atdev/siglip-tagger-test-3", trust_remote_code=True) - Notebooks
- Google Colab
- Kaggle
Update README.md
#3
by not-lain - opened
README.md
CHANGED
|
@@ -25,6 +25,16 @@ It achieves the following results on the evaluation set:
|
|
| 25 |
This model is an experimental model that predicts danbooru tags of images.
|
| 26 |
|
| 27 |
## Example
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 28 |
|
| 29 |
```py
|
| 30 |
from PIL import Image
|
|
|
|
| 25 |
This model is an experimental model that predicts danbooru tags of images.
|
| 26 |
|
| 27 |
## Example
|
| 28 |
+
```py
|
| 29 |
+
from transformers import pipeline
|
| 30 |
+
pipe = pipeline("image-classification",model="p1atdev/siglip-tagger-test-3",revision="refs/pr/2",trust_remote_code=True)
|
| 31 |
+
pipe("image.jpg", # takes str(path) or numpy array or PIL images as input
|
| 32 |
+
threshold=0.5, #optional parameter defaults to 0
|
| 33 |
+
return_scores = False #optional parameter defaults to False
|
| 34 |
+
)
|
| 35 |
+
```
|
| 36 |
+
* `threshold`: confidence intervale, if it's specified, the pipeline will only return tags with a confidence >= threshold
|
| 37 |
+
* `return_scores`: if specified the pipeline will return the labels and their confidences in a dictionary format.
|
| 38 |
|
| 39 |
```py
|
| 40 |
from PIL import Image
|