tensorkelechi commited on
Commit
1bbe9b6
·
verified ·
1 Parent(s): d8a79b0

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -70,7 +70,7 @@ def compute_similarity(output1, output2):
70
  # Function to visualize feature heatmaps
71
  def visualize_heatmap(model, image):
72
  model.eval()
73
- x = image.unsqueeze(0) # remove batch dimension
74
  features = model.convnet(x) # feature heatmap learnt by model
75
  heatmap = torch.mean(features, dim=1).squeeze().detach().numpy() # normalize heatmap to ndarray
76
  plt.imshow(heatmap, cmap="hot") # display heatmap as plot
 
70
  # Function to visualize feature heatmaps
71
  def visualize_heatmap(model, image):
72
  model.eval()
73
+ x = image#.unsqueeze(0) # remove batch dimension
74
  features = model.convnet(x) # feature heatmap learnt by model
75
  heatmap = torch.mean(features, dim=1).squeeze().detach().numpy() # normalize heatmap to ndarray
76
  plt.imshow(heatmap, cmap="hot") # display heatmap as plot