Spaces:
Runtime error
Runtime error
File size: 621 Bytes
47aaca2 d8f620d 47aaca2 d8f620d 47aaca2 d8f620d |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
---
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() |