Spaces:
Runtime error
Runtime error
OmerFarooq
commited on
Commit
•
4c8eb7e
1
Parent(s):
509b38e
Update app.py
Browse files
app.py
CHANGED
@@ -94,8 +94,12 @@ def gen_grad_img_single(weights, img, alpha = 0.4):
|
|
94 |
weights = "weights.h5"
|
95 |
# img, y_pred = gen_grad_img_single(weights, img)
|
96 |
|
|
|
|
|
|
|
|
|
97 |
demo = gr.Interface(
|
98 |
-
fn =
|
99 |
inputs = gr.Image(type = "pil", shape = (224,224)),
|
100 |
# outputs = [gr.outputs.Label(num_top_classes = 2, label = 'Classifiaction'), gr.Textbox('infer_time', label = 'Inference Time(ms)')]
|
101 |
outputs = [gr.Image(type = "numpy"), gr.Textbox('y_pred', label = 'Prediction')]
|
|
|
94 |
weights = "weights.h5"
|
95 |
# img, y_pred = gen_grad_img_single(weights, img)
|
96 |
|
97 |
+
def get_grad(img):
|
98 |
+
a = gen_grad_img_single(weights, img)
|
99 |
+
return a
|
100 |
+
|
101 |
demo = gr.Interface(
|
102 |
+
fn = get_grad,
|
103 |
inputs = gr.Image(type = "pil", shape = (224,224)),
|
104 |
# outputs = [gr.outputs.Label(num_top_classes = 2, label = 'Classifiaction'), gr.Textbox('infer_time', label = 'Inference Time(ms)')]
|
105 |
outputs = [gr.Image(type = "numpy"), gr.Textbox('y_pred', label = 'Prediction')]
|