First-AI / app.py
FergusArgyll's picture
I'm so confused
84f8dc1
raw
history blame contribute delete
No virus
325 Bytes
import gradio as gr
from fastai.vision.all import *
learn = load_learner("model.pkl")
categories = ["Bald Eagle", "Osprey"]
def classify(img):
pred,idx,probs = learn.predict(img)
return dict(zip(categories, map(float,probs)))
iface = gr.Interface(fn=classify, inputs="image", outputs="label")
iface.launch()