uhlarlar commited on
Commit
8ddb400
·
1 Parent(s): 1d0624e

added model

Browse files
Files changed (2) hide show
  1. app.py +22 -0
  2. bearModel.pkl +3 -0
app.py ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ from fastai.vision.all import *
3
+ import gradio as gr
4
+
5
+ learn = load_learner('bearModel.pkl')
6
+
7
+ categories = ("grizzly", "black", "teddy", "polar")
8
+
9
+ def classify_img(img):
10
+ pred,idx,probs = learn.predict(img)
11
+ return dict(zip(categories, map(float,probs)))
12
+
13
+ image = gr.inputs.Image(shape=(192,192))
14
+ label = gr.outputs.Label()
15
+ examples = ['dog.jpg','cat.jpg','dunno.jpg']
16
+
17
+ def greet(name):
18
+ return "Hello " + name + "!!"
19
+
20
+
21
+ iface = gr.Interface(fn=classify_img, inputs=image, outputs=label, examples=examples)
22
+ iface.launch(inline=False)
bearModel.pkl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b594b78658f84aa67835ddaff803f2f53c9d707f80dccc760a6d686b3aeed64f
3
+ size 46974277