srini98 commited on
Commit
86229b3
1 Parent(s): 441a3bf
Files changed (1) hide show
  1. app.py +5 -5
app.py CHANGED
@@ -1,17 +1,17 @@
1
- from fastbook import *
2
- from fastai.vision.widgets import *
3
  import gradio as gr
4
 
5
 
6
  learn = load_learner("export.pkl" )
 
7
 
8
  def classify_image(img):
9
  pred, pred_idx, probs = learn.predict(img)
10
- return pred
11
 
12
- bear_types = 'grizzly' , 'black' , 'teddy'
13
 
14
- image = gr.inputs.Image(shape=(192 , 192))
 
15
 
16
  label = gr.outputs.Label()
17
 
 
1
+ from fastai.vision.all import *
 
2
  import gradio as gr
3
 
4
 
5
  learn = load_learner("export.pkl" )
6
+ bear_types = ('grizzly' , 'black' , 'teddy')
7
 
8
  def classify_image(img):
9
  pred, pred_idx, probs = learn.predict(img)
10
+ return dict(zip(bear_types , map(float , probs)))
11
 
 
12
 
13
+
14
+ image = gr.inputs.Image(shape=(224 , 224))
15
 
16
  label = gr.outputs.Label()
17