Spaces:
Runtime error
Runtime error
Commit
·
76cb22f
1
Parent(s):
b059e33
Update app.py
Browse files
app.py
CHANGED
@@ -47,7 +47,7 @@ def create_model_mod():
|
|
47 |
def create_heatmap(model, imgs):
|
48 |
#predicting the images and getting the conv outputs and predictions
|
49 |
with tf.GradientTape() as tape:
|
50 |
-
|
51 |
|
52 |
#computing gradients of predictions w.r.t the feature maps
|
53 |
grads = tape.gradient(preds, maps)
|
@@ -103,7 +103,7 @@ def gen_grad_img_single(weights, img, alpha = 0.4):
|
|
103 |
|
104 |
|
105 |
weights = "weights.h5"
|
106 |
-
img, y_pred = gen_grad_img_single(weights, img)
|
107 |
|
108 |
demo = gr.Interface(
|
109 |
fn = gen_grad_img_single,
|
|
|
47 |
def create_heatmap(model, imgs):
|
48 |
#predicting the images and getting the conv outputs and predictions
|
49 |
with tf.GradientTape() as tape:
|
50 |
+
maps, preds = model(imgs);
|
51 |
|
52 |
#computing gradients of predictions w.r.t the feature maps
|
53 |
grads = tape.gradient(preds, maps)
|
|
|
103 |
|
104 |
|
105 |
weights = "weights.h5"
|
106 |
+
# img, y_pred = gen_grad_img_single(weights, img)
|
107 |
|
108 |
demo = gr.Interface(
|
109 |
fn = gen_grad_img_single,
|