Spaces:
Runtime error
Runtime error
OmerFarooq
commited on
Commit
•
f7bf704
1
Parent(s):
4d444b7
Update app.py
Browse files
app.py
CHANGED
@@ -83,8 +83,8 @@ def create_heatmap(model, imgs, class_index):
|
|
83 |
#removing the extra dimension of value 1
|
84 |
heatmap = tf.squeeze(heatmap)
|
85 |
|
86 |
-
#
|
87 |
-
heatmap = tf.
|
88 |
|
89 |
return heatmap, preds.numpy()
|
90 |
|
|
|
83 |
#removing the extra dimension of value 1
|
84 |
heatmap = tf.squeeze(heatmap)
|
85 |
|
86 |
+
# For visualization purpose, we will normalize the heatmap between 0 & 1
|
87 |
+
heatmap = tf.maximum(heatmap, 0) / tf.math.reduce_max(heatmap)
|
88 |
|
89 |
return heatmap, preds.numpy()
|
90 |
|