Spaces:
Sleeping
Sleeping
File size: 684 Bytes
1af5881 236485f b39ed56 236485f 1af5881 236485f 19cc01c 3a7dacd 5c80898 e6760ea 236485f 1b3e5e9 5c80898 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
import gradio as gr
import fastai
import skimage
from fastai.vision.all import *
learn=load_learner('export.pkl')
categories=('not psilocybe','psilocybe')
def classify(img):
pred,idx,probs=learn.predict(img)
return dict(zip(categories, map(float,probs)))
title = "Psilocybe classifier"
description = "~83 percent accurate model. Please do not consume unknown mushrooms based on this app. With a more accurate model this could complement a harm minimization approach."
image = gr.Image()
label= gr.Label()
examples=['psilocybe.jpg']
intf=gr.Interface(fn=classify,inputs=image,outputs=label,title=title, description=description, examples=examples)
intf.launch(inline=False) |