skcoirz commited on
Commit
0f10263
Β·
1 Parent(s): 760cf9b

initial version

Browse files
Files changed (2) hide show
  1. app.py +16 -0
  2. model.pkl +3 -0
app.py ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+ from fastai.vision.all import *
3
+
4
+ learner = load_learner('model.pkl')
5
+ categories = ("Dog", "Cat")
6
+
7
+
8
+ def infer(img):
9
+ _, _, prob = learner.predict(img)
10
+ return dict(zip(categories, map(float, prob)))
11
+
12
+ image = gr.inputs.Image(shape(192, 192))
13
+ label = gr.outputs.Label()
14
+
15
+ iface = gr.Interface(fn=infer, inputs=image, outputs=label)
16
+ iface.launch()
model.pkl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ac592727538df8f585ee34044b3ae7c6841a5e5259187210eda57baa1c8ef5b3
3
+ size 47058513