import gradio as gr from transformers import pipeline pipeline = pipeline(task="image-segmentation") def predict(image): predictions = pipeline(image) return {p["label"]: p["score"] for p in predictions} gr.Interface( predict, inputs=gr.inputs.Image(label="Upload hot dog candidate", type="filepath"), outputs="image", title="Hot Dog? Or Not?", ).launch()