tunglinwu commited on
Commit
a1d66c5
·
1 Parent(s): b83c6b6
Files changed (2) hide show
  1. app.ipynb +0 -0
  2. app.py +4 -4
app.ipynb CHANGED
The diff for this file is too large to render. See raw diff
 
app.py CHANGED
@@ -11,15 +11,15 @@ import gradio as gr
11
  learn = load_learner('model.pkl')
12
 
13
  # %% ../app.ipynb 18
14
- categories = ['Godzilla', 'King Kong']
15
  def classify_kaiju(img):
16
  pred,idx,probs=learn.predict(img)
17
  return dict(zip(categories, map(float,probs)))
18
 
19
  # %% ../app.ipynb 20
20
- image = gr.inputs.Image(shape=(192, 192))
21
- label = gr.outputs.Label()
22
- examples = ['Godzilla_1.jpg', 'KingKong_1.jpg', 'Godzilla_2.jpg', 'KingKong_2.jpg']
23
 
24
  intf = gr.Interface(fn=classify_kaiju, inputs=image, outputs=label, examples=examples)
25
  intf.launch(inline=False)
 
11
  learn = load_learner('model.pkl')
12
 
13
  # %% ../app.ipynb 18
14
+ categories = ['Godzilla', 'King Kong', 'Mothra', 'King Ghidorah', 'Rodan']
15
  def classify_kaiju(img):
16
  pred,idx,probs=learn.predict(img)
17
  return dict(zip(categories, map(float,probs)))
18
 
19
  # %% ../app.ipynb 20
20
+ image = gr.Image()
21
+ label = gr.Label()
22
+ examples = ['Godzilla_1.jpg', 'Godzilla_2.jpg', 'KingKong_1.jpg', 'KingKong_2.jpg', 'Mothra_1.jpg', 'Mothra_2.jpg', 'King Ghidorah_1.jpg', 'King Ghidorah_2.jpg', 'Rodan_1.jpg', 'Rodan_2.jpg', ]
23
 
24
  intf = gr.Interface(fn=classify_kaiju, inputs=image, outputs=label, examples=examples)
25
  intf.launch(inline=False)