OmerFarooq commited on
Commit
f7bf704
1 Parent(s): 4d444b7

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
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
- #applying relu activation
87
- heatmap = tf.keras.activations.relu(heatmap)
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