import gradio as gr from transformers import pipeline pipe = pipeline("image-classification", model="flyswot/convnext-tiny-224_flyswot") def predict(image): predictions = pipe(image) return {pred['label']: pred['score'] for pred in predictions} iface = gr.Interface( fn=predict, inputs=gr.inputs.Image(type='filepath'), outputs='label', interpretation='default',theme="huggingface") iface.launch()