tunglinwu commited on
Commit
5756aa4
1 Parent(s): d5bc45a

Update Gradio API of image() and label()

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -17,10 +17,10 @@ categories = ['Godzilla', 'King Kong']
17
  def classify_kaiju(img):
18
  pred,idx,probs=learn.predict(img)
19
  return dict(zip(categories, map(float,probs)))
20
-
21
  # %% ../app.ipynb 16
22
- image = gr.inputs.Image(shape=(192, 192))
23
- label = gr.outputs.Label()
24
  examples = ['Godzilla_1.jpg', 'KingKong_1.jpg', 'Godzilla_2.jpg', 'KingKong_2.jpg']
25
 
26
  intf = gr.Interface(fn=classify_kaiju, inputs=image, outputs=label, examples=examples)
 
17
  def classify_kaiju(img):
18
  pred,idx,probs=learn.predict(img)
19
  return dict(zip(categories, map(float,probs)))
20
+
21
  # %% ../app.ipynb 16
22
+ image = gr.Image()
23
+ label = gr.Label()
24
  examples = ['Godzilla_1.jpg', 'KingKong_1.jpg', 'Godzilla_2.jpg', 'KingKong_2.jpg']
25
 
26
  intf = gr.Interface(fn=classify_kaiju, inputs=image, outputs=label, examples=examples)