Ilde commited on
Commit
33b5143
1 Parent(s): 34efcdb

funciona por dios

Browse files
Files changed (2) hide show
  1. app.py +24 -0
  2. model.pkl +3 -0
app.py ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+ from fastai.vision.all import *
3
+
4
+
5
+ def is_marth(x): return x[0].isupper()
6
+
7
+ # Model
8
+ learn = load_learner("model.pkl")
9
+
10
+ # Categories
11
+ categories = ("Marth", "Sheik")
12
+
13
+
14
+ def classify_images(img):
15
+ pred, idx, probs = model.predict(img)
16
+ return dict(zip(catogories, map(float, probs)))
17
+
18
+ image = gr.inputs.Image(shape = (192, 192))
19
+ label = gr.outputs.Label()
20
+
21
+
22
+ intf = gr.Interface(fn = classify_images, inputs = image, outputs = label)
23
+
24
+ intf.launch()
model.pkl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:c780d5631e79e864476e1aa54481af3028ac59a67e4d052334b1012853ebb5e6
3
+ size 46964971