OmerFarooq commited on
Commit
421625a
1 Parent(s): ab67498

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -3
app.py CHANGED
@@ -109,14 +109,13 @@ def get_grad(img):
109
  if y_pred[0] > 0.5: pred_class = "cat"
110
  else: pred_class = "dog"
111
 
112
- text = "Raw Score: " + str(y_pred[0]) + "\nClassification: " + pred_class
113
  return grad_img, text
114
 
115
  demo = gr.Interface(
116
  fn = get_grad,
117
  inputs = gr.Image(type = "pil", shape = (224,224)),
118
- # outputs = [gr.outputs.Label(num_top_classes = 2, label = 'Classifiaction'), gr.Textbox('infer_time', label = 'Inference Time(ms)')]
119
- outputs = [gr.Image(type = "numpy", width = 160, height = 160), gr.Textbox(label = 'Prediction', info = '(threshold: 0.5)')]
120
  )
121
  demo.launch()
122
 
 
109
  if y_pred[0] > 0.5: pred_class = "cat"
110
  else: pred_class = "dog"
111
 
112
+ text = "Raw Score: " + str(y_pred[0][0]) + "\nClassification: " + pred_class
113
  return grad_img, text
114
 
115
  demo = gr.Interface(
116
  fn = get_grad,
117
  inputs = gr.Image(type = "pil", shape = (224,224)),
118
+ outputs = [gr.Image(type = "numpy", width = 320, height = 320), gr.Textbox(label = 'Prediction', info = '(threshold: 0.5)')]
 
119
  )
120
  demo.launch()
121