leftbyte commited on
Commit
6a9201c
·
1 Parent(s): ee51549

wrap the zip object in a dict

Browse files
Files changed (1) hide show
  1. app.py +5 -5
app.py CHANGED
@@ -5,7 +5,7 @@ categories = ('black', 'grizzly', 'teddy')
5
 
6
  def classify_image(img):
7
  pred, idx, probs = learn.predict(img)
8
- return zip(categories, map(float, probs))
9
 
10
  def greet(name):
11
  return "Hello " + name + "!!"
@@ -15,9 +15,9 @@ learn = load_learner('model/bears.pkl')
15
  image = gr.inputs.Image(shape=(192, 192))
16
  label = gr.outputs.Label()
17
  examples = ['images/black.jpg', 'images/grizzly.jpg', 'images/teddy.jpg']
18
-
19
  intf = gr.Interface(fn=classify_image, inputs=image, outputs=label, examples=examples)
20
  intf.launch(inline=False)
21
- m = learn.model
22
- ps = list(m.parameters())
23
- ps[1]
 
 
5
 
6
  def classify_image(img):
7
  pred, idx, probs = learn.predict(img)
8
+ return dict(zip(categories, map(float, probs)))
9
 
10
  def greet(name):
11
  return "Hello " + name + "!!"
 
15
  image = gr.inputs.Image(shape=(192, 192))
16
  label = gr.outputs.Label()
17
  examples = ['images/black.jpg', 'images/grizzly.jpg', 'images/teddy.jpg']
 
18
  intf = gr.Interface(fn=classify_image, inputs=image, outputs=label, examples=examples)
19
  intf.launch(inline=False)
20
+
21
+ # m = learn.model
22
+ # ps = list(m.parameters())
23
+ # ps[1]