Spaces:
Runtime error
Runtime error
import streamlit as st | |
from transformers import pipeline | |
vision_classifier = pipeline(task="image-classification") | |
text = st.text_area('Enter a link to an image:') | |
if text: | |
result = vision_classifier(images=text) | |
st.text("\n".join([f"Class {d['label']} with score {round(d['score'], 4)}" for d in result])) | |
#result = vision_classifier(images="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/pipeline-cat-chonk.jpeg") | |
#print("\n".join([f"Class {d['label']} with score {round(d['score'], 4)}" for d in result])) | |
#st.text("\n".join([f"Class {d['label']} with score {round(d['score'], 4)}" for d in result])) |