test / app.py
Ilde's picture
porfabor señor jesus
6fe2844
import gradio as gr
from fastai.vision.all import *
def is_marth(x): return x[0].isupper()
# Model
learn = load_learner("model.pkl")
# Categories
categories = ("Marth", "Sheik")
def classify_images(img):
pred, idx, probs = learn.predict(img)
return dict(zip(categories, map(float, probs)))
image = gr.inputs.Image(shape = (192, 192))
label = gr.outputs.Label()
intf = gr.Interface(fn = classify_images, inputs = image, outputs = label)
intf.launch()