Spaces:
Runtime error
Runtime error
OmerFarooq
commited on
Commit
•
4a989c6
1
Parent(s):
fe1c53b
Update app.py
Browse files
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:
|
110 |
-
else:
|
111 |
|
112 |
-
text = "Raw Score: " + str(y_pred) + "\nClassification: " +
|
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(
|