OmerFarooq commited on
Commit
4a989c6
1 Parent(s): fe1c53b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -105,11 +105,11 @@ weights = "weights.h5"
105
  def get_grad(img):
106
  img = img_pros(img)
107
  grad_img, y_pred = gen_grad_img_single(weights, img)
108
-
109
- if y_pred[0] > 0.5: y_pred[0] = "cat"
110
- else: y_pred[0] = "dog"
111
 
112
- text = "Raw Score: " + str(y_pred) + "\nClassification: " + y_pred[0]
113
  return grad_img, text
114
 
115
  demo = gr.Interface(
 
105
  def get_grad(img):
106
  img = img_pros(img)
107
  grad_img, y_pred = gen_grad_img_single(weights, img)
108
+ pred_class = ""
109
+ if y_pred[0] > 0.5: pred_class = "cat"
110
+ else: pred_class = "dog"
111
 
112
+ text = "Raw Score: " + str(y_pred) + "\nClassification: " + pred_class
113
  return grad_img, text
114
 
115
  demo = gr.Interface(