whichlight commited on
Commit
19f236b
·
1 Parent(s): e39d03a

reverting to deprecated code to see if image examples work

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -31,17 +31,17 @@ learn = load_learner('door_model.pkl')
31
  labels = learn.dls.vocab
32
 
33
  def predict(img):
34
- img = PILImage.create(img)
35
  pred,pred_idx,probs = learn.predict(img)
36
  return {labels[i]: float(probs[i]) for i in range(len(labels))}
37
 
38
 
39
  iface = gr.Interface(
40
  fn=predict,
41
- inputs=gr.Image(shape=(512, 512)),
42
- outputs=gr.Label(num_top_classes=3),
43
  title=title,
44
  description=description,
45
- examples=['examples/red.jpg']).queue().launch()
46
 
47
 
 
31
  labels = learn.dls.vocab
32
 
33
  def predict(img):
34
+ #img = PILImage.create(img)
35
  pred,pred_idx,probs = learn.predict(img)
36
  return {labels[i]: float(probs[i]) for i in range(len(labels))}
37
 
38
 
39
  iface = gr.Interface(
40
  fn=predict,
41
+ inputs=gr.inputs.Image(shape=(512, 512)),
42
+ outputs=gr.outputs.Label(),
43
  title=title,
44
  description=description,
45
+ examples=['examples/red.jpg']).launch()
46
 
47