Spaces:
Sleeping
Sleeping
| import gradio as gr | |
| from fastai.vision.all import * | |
| learn = load_learner('export.pkl') | |
| def predict_image(img): | |
| prediction, _, _ = learn.predict(img) | |
| return prediction | |
| # UI huggface | |
| # image = gr.Image(shape=(192, 192)) | |
| # label = gr.Label() | |
| #intrfce = gr.Interface(fn=predict_image, inputs=image, outputs=label) | |
| intrfce = gr.Interface(fn=predict_image, | |
| inputs=gr.Image(type="pil"), | |
| outputs=gr.Label(num_top_classes=3)).launch() | |
| # intrfce.launch(inline=False) |