Spaces:
Runtime error
Runtime error
| import gradio as gr | |
| import fastbook | |
| fastbook.setup_book() | |
| from fastbook import * | |
| from fastai.vision.widgets import * | |
| from PIL import Image | |
| def greet(name): | |
| return "Hello " + name + "!!" | |
| def image_mod(image): | |
| print(image) | |
| learn_inf = load_learner('export.pkl') | |
| item, t, m = learn_inf.predict(image) | |
| return 'The image is classified as a ' + item.upper() + ' bear.' | |
| # learn_inf = load_learner('export.pkl') | |
| # learn_inf.predict(image) | |
| demo = gr.Interface( | |
| image_mod, | |
| gr.Image(type="pil"), | |
| "label", | |
| flagging_options=[], | |
| examples=[], | |
| ) | |
| demo.launch() | |