File size: 414 Bytes
fe53ce2
6935c2f
fe53ce2
6935c2f
 
 
 
 
 
 
 
 
 
ddab47a
6935c2f
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
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()