Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -71,7 +71,7 @@ def compute_similarity(output1, output2):
|
|
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 = features.detach().numpy() #.squeeze() normalize heatmap to ndarray
|
76 |
plt.imshow(heatmap, cmap="hot") # display heatmap as plot
|
77 |
plt.axis("off")
|
|
|
71 |
def visualize_heatmap(model, image):
|
72 |
model.eval()
|
73 |
x = image#.unsqueeze(0) # remove batch dimension
|
74 |
+
features = model.convnet.features(x) # feature heatmap learnt by model
|
75 |
heatmap = features.detach().numpy() #.squeeze() normalize heatmap to ndarray
|
76 |
plt.imshow(heatmap, cmap="hot") # display heatmap as plot
|
77 |
plt.axis("off")
|