Cathaltwo commited on
Commit
4deaebb
·
1 Parent(s): 86cc325

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +17 -18
app.py CHANGED
@@ -1,18 +1,17 @@
1
- import gradio as gr
2
- from fastai.vision.all import *
3
-
4
- def is_cat(x): return x[0].isupper()
5
- learn =load_learner ('model.pkl')
6
- categories =['dog','Cat']
7
- def classify_image(img):
8
- pred,idx,probs = learn.predict(img)
9
- return dict(zip(categories,map(float,probs)))
10
-
11
- def greet(name):
12
- return "Hello " + name + "!!"
13
-
14
- image=gr.inputs.Image(shape=(192,192))
15
- label =gr.outputs.Label()
16
- examples = ['dog.jpg','Cat_November_2010-1a.jpg']
17
- intf =gr.Interface(fn=classify_image,inputs =image,outputs=label,examples=examples)
18
- intf.launch()
 
1
+ import gradio as gr
2
+ from fastai.vision.all import *
3
+
4
+ def is_cat(x): return x[0].isupper()
5
+ learn =load_learner ('model.pkl')
6
+ categories =['dog','Cat']
7
+ def classify_image(img):
8
+ pred,idx,probs = learn.predict(img)
9
+ return dict(zip(categories,map(float,probs)))
10
+
11
+
12
+
13
+ image=gr.inputs.Image(shape=(192,192))
14
+ label =gr.outputs.Label()
15
+ examples = ['dog.jpg','Cat_November_2010-1a.jpg']
16
+ intf =gr.Interface(fn=classify_image,inputs =image,outputs=label,examples=examples)
17
+ intf.launch()