segadeds commited on
Commit
0a396dd
·
verified ·
1 Parent(s): 0e716c2

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -1
app.py CHANGED
@@ -17,12 +17,13 @@ categories = (['abraham_grampa_simpson', 'agnes_skinner', 'apu_nahasapeemapetilo
17
 
18
 
19
  def classify_image(img):
 
20
  pred,idx,probs = learn.predict(img)
21
  return dict(zip(categories, map(float,probs)))
22
 
23
 
24
 
25
- image = gr.Image(shape=(192,192))
26
  label = gr.Label()
27
  examples = ['ednar.jpg', 'maggie.jpg', 'bart.jpg']
28
 
 
17
 
18
 
19
  def classify_image(img):
20
+ img = PILImage.create(img).resize((192, 192))
21
  pred,idx,probs = learn.predict(img)
22
  return dict(zip(categories, map(float,probs)))
23
 
24
 
25
 
26
+ image = gr.Image(type='pil')
27
  label = gr.Label()
28
  examples = ['ednar.jpg', 'maggie.jpg', 'bart.jpg']
29