Spaces:
Runtime error
Runtime error
Init!
Browse files
app.py
ADDED
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from transformers import pipeline
|
2 |
+
|
3 |
+
vision_classifier = pipeline(task="image-classification")
|
4 |
+
result = vision_classifier(images="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/pipeline-cat-chonk.jpeg")
|
5 |
+
print("\n".join([f"Class {d['label']} with score {round(d['score'], 4)}" for d in result]))
|