Update README.md
Browse files
README.md
CHANGED
|
@@ -13,6 +13,29 @@ Converted from [SmilingWolf/wd-swinv2-tagger-v3](https://huggingface.co/SmilingW
|
|
| 13 |
|
| 14 |
## Example
|
| 15 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 16 |
```py
|
| 17 |
from PIL import Image
|
| 18 |
|
|
|
|
| 13 |
|
| 14 |
## Example
|
| 15 |
|
| 16 |
+
### Pipeline
|
| 17 |
+
|
| 18 |
+
```py
|
| 19 |
+
from transformers import pipeline
|
| 20 |
+
|
| 21 |
+
pipe = pipeline("image-classification", model="p1atdev/wd-swinv2-tagger-v3-hf", trust_remote_code=True)
|
| 22 |
+
|
| 23 |
+
print(pipe("sample.webp", top_k=20))
|
| 24 |
+
#[{'label': '1girl', 'score': 0.996832549571991},
|
| 25 |
+
# {'label': 'solo', 'score': 0.958362340927124},
|
| 26 |
+
# {'label': 'dress', 'score': 0.9418023228645325},
|
| 27 |
+
# {'label': 'hat', 'score': 0.9263725280761719},
|
| 28 |
+
# {'label': 'sitting', 'score': 0.9178062677383423},
|
| 29 |
+
# {'label': 'looking_up', 'score': 0.8978123068809509},
|
| 30 |
+
# {'label': 'short_hair', 'score': 0.8242536187171936},
|
| 31 |
+
# {'label': 'sky', 'score': 0.784591794013977},
|
| 32 |
+
# {'label': 'outdoors', 'score': 0.767611563205719},
|
| 33 |
+
# {'label': 'rating:general', 'score': 0.7561964988708496}]
|
| 34 |
+
```
|
| 35 |
+
|
| 36 |
+
### AutoModel
|
| 37 |
+
|
| 38 |
+
|
| 39 |
```py
|
| 40 |
from PIL import Image
|
| 41 |
|