Spaces:
Runtime error
Runtime error
File size: 523 Bytes
7ffc434 6638fb9 b03550c 7ffc434 b03550c 6638fb9 7ffc434 6638fb9 b03550c 58e9314 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | import gradio as gr
from fastai.vision.all import *
import skimage
from PIL import Image
from timm import *
learn = load_learner('auctionet-model.pkl')
labels = learn.dls.vocab
def classify_image(img):
img = Image.fromarray(img)
pred, idx, probs = learn.predict(img)
return dict(zip(labels, map(float, probs)))
iface = gr.Interface(fn=classify_image, inputs=gr.inputs.Image(shape=(512, 512)), outputs=gr.outputs.Label(num_top_classes=3), interpretation="default", title="Watches classifier")
iface.launch()
|