Spaces:
Runtime error
Runtime error
| from fastai.vision.all import * | |
| import gradio as gr | |
| def get_label_kunst(fname): | |
| return 'beschikbaar' | |
| # Cell | |
| learn = load_learner('model.pkl') | |
| categories = ['beschikbaar','uitgeleend'] | |
| def classify_image(img): | |
| pred,idx,probs = learn.predict(img) | |
| return dict(zip(categories, map(float,probs))) | |
| # Cell | |
| image = gr.Image(height=192, width=192) | |
| label = gr.Label() | |
| examples = ['examples/woodblock-print.png', 'examples/nijmegen-print.png', 'examples/beschikbaar.png','examples/verkocht.png'] | |
| intf = gr.Interface(fn=classify_image, inputs=image, outputs=label, examples=examples) | |
| intf.launch(inline=False) | |