dronedetect / app.py
dylanmcc's picture
First version of model
9b66dad
raw
history blame
432 Bytes
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()