tree-classifier / app.py
Daniel-123's picture
Upload 3 files
8819004 verified
raw
history blame contribute delete
335 Bytes
import gradio as gr
from fastai.vision.all import *
learn = load_learner('./tree-classifier.pkl')
def predict(image):
leaf_type,_,probs = learn.predict(image)
return f"This is a: {leaf_type}. \nProbability it's a {leaf_type}: {probs.max():.4f}"
iface = gr.Interface(fn=predict, inputs="image", outputs="text")
iface.launch()