osbornep8 commited on
Commit
8554c02
·
1 Parent(s): 50a35aa

added components method

Browse files
Files changed (1) hide show
  1. app.py +5 -3
app.py CHANGED
@@ -12,11 +12,13 @@ def classify_image(img):
12
  pred,pred_idx,probs = learn.predict(img)
13
  return dict(zip(categories, map(float,probs)))
14
 
15
- image = gr.Image(shape=(224,224), type='pil')
16
- label = gr.Label()
17
  examples = ['cat.jpg', 'dog.jpg', 'dunno.jpg']
 
 
18
 
19
 
20
 
21
- iface = gr.Interface(fn=classify_image, inputs=image, outputs=label, examples=examples)
22
  iface.launch(inline=False)
 
12
  pred,pred_idx,probs = learn.predict(img)
13
  return dict(zip(categories, map(float,probs)))
14
 
15
+ image = gr.components.Image(shape=(224,224))
16
+ label = gr.components.Label(num_top_classes=3)
17
  examples = ['cat.jpg', 'dog.jpg', 'dunno.jpg']
18
+ interpretation='default'
19
+ enable_queue=True
20
 
21
 
22
 
23
+ iface = gr.Interface(fn=classify_image, inputs=image, outputs=label, examples=examples,interpretation=interpretation, enable_queue=enable_queue)
24
  iface.launch(inline=False)