CCop / app.py
abcdef12356's picture
Update app.py
589b7f7
raw
history blame contribute delete
374 Bytes
__all__ = ['learn', 'classify_image', 'categories', 'image', 'label', 'intf']
from fastai.vision.all import *
import gradio as gr
learn = load_learner('export (1).pkl')
def classify_image(img):
pred, idx, probs = learn.predict(img)
return pred
image=gr.Image()
label = gr.Label()
intf = gr.Interface(fn=classify_image, inputs=image, outputs=label)
intf.launch()