Spaces:
Runtime error
Runtime error
import gradio as gr | |
from fastai.vision.all import load_learner | |
learner = load_learner('saved_model/export.pkl') | |
categories = ('Has structure', 'Does Not Have structure') | |
def is_it_a_structure(input_img): | |
pred, idx, probs = learner.predict(input_img) | |
return f'{pred} {dict(zip(categories, map(float, probs)))}' | |
demo = gr.Interface(fn=is_it_a_structure, inputs=gr.Image(shape=(200, 200)), outputs=gr.Label()) | |
demo.launch() |