Spaces:
Sleeping
Sleeping
update: heatmap change
Browse files
yolov5.py
CHANGED
@@ -212,7 +212,7 @@ def dff_nmf(image, target_lyr, n_components):
|
|
212 |
boxes = output1[..., :4] # First 4 values are x1, y1, x2, y2
|
213 |
boxes = boxes[confidence_mask] # Filter boxes by confidence mask
|
214 |
fig, ax = plt.subplots(1, figsize=(10, 10))
|
215 |
-
ax.imshow(torch.tensor(batch_explanations[0][indx]).cpu().numpy(), cmap="
|
216 |
top_score_idx = scores.argmax(dim=0) # Get the index of the max score
|
217 |
top_score = scores[top_score_idx].item()
|
218 |
top_class_id = class_ids[top_score_idx].item()
|
|
|
212 |
boxes = output1[..., :4] # First 4 values are x1, y1, x2, y2
|
213 |
boxes = boxes[confidence_mask] # Filter boxes by confidence mask
|
214 |
fig, ax = plt.subplots(1, figsize=(10, 10))
|
215 |
+
ax.imshow(torch.tensor(batch_explanations[0][indx]).cpu().numpy(), cmap="RdYlGn") # Display image
|
216 |
top_score_idx = scores.argmax(dim=0) # Get the index of the max score
|
217 |
top_score = scores[top_score_idx].item()
|
218 |
top_class_id = class_ids[top_score_idx].item()
|