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
|