ccdle12 commited on
Commit
96bebdc
·
1 Parent(s): 4059f6f

remove version of gradio and use up to date interface

Browse files
Files changed (2) hide show
  1. app.py +3 -4
  2. requirements.txt +1 -1
app.py CHANGED
@@ -3,8 +3,8 @@ from fastai.vision.all import *
3
 
4
  learn = load_learner('model.pkl')
5
 
6
- image = gr.inputs.Image(shape=(192, 192))
7
- label = gr.outputs.Label()
8
  examples = ['grizzly.jpg', 'black-bear.jpg', 'teddy-bear.jpg']
9
 
10
  categories = ('Grizzly Bear', 'Black Bear', 'Teddy Bear')
@@ -13,6 +13,5 @@ def classify_image(img):
13
  pred, idx, probs = learn.predict(img)
14
  return dict(zip(categories, map(float, probs)))
15
 
16
- intf = gr.Interface(fn=classify_image, inputs=image, outputs=label, examples=examples)
17
  intf.launch(inline=False)
18
-
 
3
 
4
  learn = load_learner('model.pkl')
5
 
6
+ image = gr.Image(type='pil', height=192, width=192)
7
+ label = gr.Label()
8
  examples = ['grizzly.jpg', 'black-bear.jpg', 'teddy-bear.jpg']
9
 
10
  categories = ('Grizzly Bear', 'Black Bear', 'Teddy Bear')
 
13
  pred, idx, probs = learn.predict(img)
14
  return dict(zip(categories, map(float, probs)))
15
 
16
+ intf = gr.Interface(fn=classify_image, inputs=image, outputs=label)
17
  intf.launch(inline=False)
 
requirements.txt CHANGED
@@ -1,2 +1,2 @@
1
- gradio==3.43.1
2
  fastai
 
1
+ gradio
2
  fastai