Spaces:
Runtime error
Runtime error
title: Sandwich Classifier | |
emoji: π | |
colorFrom: indigo | |
colorTo: purple | |
sdk: gradio | |
sdk_version: 4.31.1 | |
app_file: app.py | |
pinned: false | |
import gradio as gr | |
from transformers import pipeline | |
pipeline = pipeline(task="image-classification", model="akansha2k2/Burger_sandwich_pizza") | |
def predict(image): | |
predictions = pipeline(image) | |
return {p["label"]: p["score"] for p in predictions} | |
gr.Interface( | |
predict, | |
inputs=gr.Image(label="Upload junk food (sandwich,pizza,burgur) candidate", type="filepath"), | |
outputs=gr.Label(num_top_classes=2), | |
title="pizza or burgur or sandwich?", | |
).launch() |