p1atdev not-lain commited on
Commit
80a030b
1 Parent(s): a5d4375

Update README.md (#3)

Browse files

- Update README.md (39991cf2ba3995d43e50c206cec5a5475d90efc5)


Co-authored-by: L_Ai_n <not-lain@users.noreply.huggingface.co>

Files changed (1) hide show
  1. README.md +10 -0
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