from transformers import pipeline import gradio as gr pipe = pipeline("image-classification", model="julien-c/hotdog-not-hotdog") def predict(img): predictions = pipe(img) return img, {p["label"]: p["score"] for p in predictions} interface = gr.Interface(fn = predict, inputs = gr.Image(label = "select hot dog image", sources = ['upload', 'webcam'], type='pil'), outputs = [gr.Image(label = "processed image"), gr.Label(label = "result", num_top_classes = 2)], title = "hot dog or not") interface.launch()