ekenkel commited on
Commit
e0072e2
·
1 Parent(s): 1a6cff5

added model and loaded it

Browse files
app.py CHANGED
@@ -1,7 +1,17 @@
 
1
  import gradio as gr
2
 
3
- def greet(name):
4
- return "Hello " + name + "!!"
5
 
6
- iface = gr.Interface(fn=greet, inputs="text", outputs="text")
7
- iface.launch()
 
 
 
 
 
 
 
 
 
 
 
1
+ from fastai.vision.all import *
2
  import gradio as gr
3
 
4
+ searchText = ('Golden Retreiver','German Shepherd', 'Dobermann', 'Golden Doodle')
 
5
 
6
+ def classify_image(img):
7
+ pred,idx,probs = learn.predict(img)
8
+ return dict(zip(searchText, map(float,probs)))
9
+
10
+ learn = load_learner('dogIdentifierModel.pkl')
11
+
12
+ image = gr.inputs.Image(shape=(192, 192))
13
+ label = gr.outputs.Label()
14
+ examples = ['german-shepherd.jpg', 'golden-retriever.jpg', 'dobermann.jpg']
15
+
16
+ intf = gr.Interface(fn=classify_image, inputs=image, outputs=label, examples=examples)
17
+ intf.launch(inline=False)
dobermann.jpg ADDED
dogIdentifierModel.pkl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:bd254ac7bda18f19f7d4939b612510a0ad535a9e89d885f85e829751a7e9e491
3
+ size 46973611
german-shephered.jpg ADDED
golden-retriever.jpg ADDED