Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -2,6 +2,13 @@ import streamlit as st
|
|
2 |
from transformers import pipeline
|
3 |
|
4 |
vision_classifier = pipeline(task="image-classification")
|
5 |
-
|
6 |
-
|
7 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
from transformers import pipeline
|
3 |
|
4 |
vision_classifier = pipeline(task="image-classification")
|
5 |
+
|
6 |
+
text = st.text_area('Enter a link to an image:')
|
7 |
+
|
8 |
+
if text:
|
9 |
+
result = vision_classifier(images=text)
|
10 |
+
st.text("\n".join([f"Class {d['label']} with score {round(d['score'], 4)}" for d in result]))
|
11 |
+
|
12 |
+
#result = vision_classifier(images="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/pipeline-cat-chonk.jpeg")
|
13 |
+
#print("\n".join([f"Class {d['label']} with score {round(d['score'], 4)}" for d in result]))
|
14 |
+
#st.text("\n".join([f"Class {d['label']} with score {round(d['score'], 4)}" for d in result]))
|