Spaces:
Runtime error
Runtime error
| 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() | |