model_explorer / app.py
davanstrien's picture
davanstrien HF staff
Update app.py
ddab47a
raw
history blame
414 Bytes
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()