sandwich_Classifier / README.md
akansha2k2's picture
app.py
d8f620d verified
|
raw
history blame
621 Bytes
metadata
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()