kellyshreeve commited on
Commit
3a120bc
·
verified ·
1 Parent(s): 270179a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -8,10 +8,10 @@ labels = neural_net.dls.vocab
8
 
9
  def predict(img):
10
  # img = PILImage.create(img)
11
- # category, idx, probs = neural_net.predict(img)
12
- # return dict(zip(labels, map(float, probs)))
13
  # return {'cat': 0.3, 'dog': 0.7}
14
- return img.rotate(45)
15
 
16
  title = 'Natural Landscape Classifier'
17
 
@@ -19,7 +19,7 @@ examples = ['farm.png']
19
 
20
  iface = gr.Interface(fn=predict,
21
  inputs=gr.Image(type='pil'),
22
- outputs='image',
23
  title=title,
24
  examples=examples)
25
  iface.launch(share=True)
 
8
 
9
  def predict(img):
10
  # img = PILImage.create(img)
11
+ category, idx, probs = neural_net.predict(img)
12
+ return dict(zip(labels, map(float, probs)))
13
  # return {'cat': 0.3, 'dog': 0.7}
14
+ # return img.rotate(45)
15
 
16
  title = 'Natural Landscape Classifier'
17
 
 
19
 
20
  iface = gr.Interface(fn=predict,
21
  inputs=gr.Image(type='pil'),
22
+ outputs='label',
23
  title=title,
24
  examples=examples)
25
  iface.launch(share=True)