pmbrito's picture
Update app.py
1d89df1
raw
history blame
440 Bytes
import streamlit as st
from transformers import pipeline
vision_classifier = pipeline(task="image-classification")
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]))