BhumikaMak commited on
Commit
81eac19
·
verified ·
1 Parent(s): 800a3d9

debug: hstack dimensions inconsistency

Browse files
Files changed (1) hide show
  1. yolov5.py +3 -2
yolov5.py CHANGED
@@ -77,8 +77,7 @@ def xai_yolov5(image):
77
  cam_image, renormalized_cam_image = generate_cam_image(model, target_layers, tensor, image, boxes)
78
 
79
  rgb_img_float, batch_explanations = dff_nmf(image, target_lyr = -5, n_components = 8)
80
- visualize_batch_explanations(rgb_img_float, batch_explanations)
81
- im = cv2.imread("test_w.png")
82
 
83
  # Combine results
84
  print('shapes........', image.shape, detections_img.shape, renormalized_cam_image.shape, im.shape)
@@ -248,3 +247,5 @@ def visualize_batch_explanations(rgb_img_float, batch_explanations, image_weight
248
  plt.axis('off') # Hide axes
249
  plt.show() # Show the plot
250
  plt.savefig("test_w.png")
 
 
 
77
  cam_image, renormalized_cam_image = generate_cam_image(model, target_layers, tensor, image, boxes)
78
 
79
  rgb_img_float, batch_explanations = dff_nmf(image, target_lyr = -5, n_components = 8)
80
+ im = visualize_batch_explanations(rgb_img_float, batch_explanations)
 
81
 
82
  # Combine results
83
  print('shapes........', image.shape, detections_img.shape, renormalized_cam_image.shape, im.shape)
 
247
  plt.axis('off') # Hide axes
248
  plt.show() # Show the plot
249
  plt.savefig("test_w.png")
250
+ print('viz', visualization.shape)
251
+ return visualization