madness_combat / app.py
EvanMarie's picture
Create app.py
262c091
raw
history blame
499 Bytes
from fastai.vision.all import *
import gradio as gr
learner_madness = load_learner('madness.pkl')
categories = ['Hank', 'Tricky', 'Deimos', "Jeb", 'Sanford', 'The Auditor']
def classify_madness(img):
prediction, index, probability = learner_madness.predict(img)
return dict(zip(categories, map(float, probability)))
intf = gr.Interface(fn=classify_madness,
inputs=gr.Image(shape=(192, 192)),
outputs=gr.Label(),
examples=[])
intf.launch(inline=False)