asampaiosoares's picture
Update app.py
56bc10e
import pathlib
temp = pathlib.PosixPath
pathlib.WindowsPath = pathlib.PosixPath
learn_inf = load_learner('export.pkl')
import gradio as gr
labels = ['fluorescent', 'not_fluorescent']
def predict(img):
img = PILImage.create(img)
pred,pred_idx,probs = learn_inf.predict(img)
return {labels[i]: float(probs[i]) for i in range(len(labels))}
fluo_id_web = gr.Interface(fn = "predict",
inputs = "image",
outputs= "label",
interpretation = "default",
title="Fluorescence identification").launch(share=True)
fluo_id_web.launch()