Manthanx commited on
Commit
5bac25e
·
1 Parent(s): f354de4

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -7,11 +7,11 @@ learn = load_learner('export.pkl')
7
  labels = learn.dls.vocab
8
 
9
 
10
-
11
-
12
  def predict(img):
13
  img = PILImage.create(img)
14
  pred,pred_idx,probs = learn.predict(img)
15
  return {labels[i]: float(probs[i]) for i in range(len(labels))}
16
 
17
- gr.Interface(fn=predict, inputs=gr.inputs.Image(shape=(512, 512)), outputs=gr.outputs.Label(num_top_classes=3)).launch(share=True)
 
 
 
7
  labels = learn.dls.vocab
8
 
9
 
 
 
10
  def predict(img):
11
  img = PILImage.create(img)
12
  pred,pred_idx,probs = learn.predict(img)
13
  return {labels[i]: float(probs[i]) for i in range(len(labels))}
14
 
15
+ image = gr.inputs.Image(shape=(192, 192))
16
+ label = gr.outputs.Label(num_top_classes=3)
17
+ gr.Interface(fn=predict, inputs=image, outputs=label).launch(share=True)