File size: 843 Bytes
262c091
 
 
 
1e6dcf6
262c091
 
 
 
 
 
 
 
5d89c79
e951e27
1fed1f4
262c091
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
from fastai.vision.all import *
import gradio as gr

learner_madness = load_learner('madness.pkl')
categories = ['The Auditor', 'Deimos', 'Hank', "Jeb", 'Sanford', 'Tricky']

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(),
             title="Which Madness Combat Character",
             description="This app was created for my 14 year old son. It can differentiate between The Auditor, Tricky, Hank, Sanford, Jeb, and Deimos! Try it out! Maybe see which it thinks you most resemble!",
             examples=['auditor.jpg', 'hank.jpg', 'tricky.jpg', 'jeb.jpg', 'sanford.jpg', 'deimos.jpg'])
intf.launch(inline=False)