BhumikaMak commited on
Commit
58e6893
·
verified ·
1 Parent(s): 1e08dfa

resolved batch_explainations

Browse files
Files changed (1) hide show
  1. yolov5.py +1 -4
yolov5.py CHANGED
@@ -232,15 +232,12 @@ def dff_nmf(image, target_lyr, n_components):
232
  ax.text(x1, y1, f"{predicted_label}: {top_score:.2f}",
233
  color='r', fontsize=12, verticalalignment='top')
234
  plt.show()
235
- print("#################################")
236
- print("saving the test files........")
237
  plt.savefig("test_" + str(indx) + ".png" )
238
  plt.clf()
239
- return rgb_img_float, explanations
240
 
241
 
242
  def visualize_batch_explanations(rgb_img_float, batch_explanations, image_weight=0.7):
243
- print('shape_batch', batch_explanations.shape)
244
  for i, explanation in enumerate(batch_explanations):
245
  # Create visualization for each explanation
246
  visualization = show_factorization_on_image(rgb_img_float, explanation, image_weight=image_weight)
 
232
  ax.text(x1, y1, f"{predicted_label}: {top_score:.2f}",
233
  color='r', fontsize=12, verticalalignment='top')
234
  plt.show()
 
 
235
  plt.savefig("test_" + str(indx) + ".png" )
236
  plt.clf()
237
+ return rgb_img_float, batch_explanations
238
 
239
 
240
  def visualize_batch_explanations(rgb_img_float, batch_explanations, image_weight=0.7):
 
241
  for i, explanation in enumerate(batch_explanations):
242
  # Create visualization for each explanation
243
  visualization = show_factorization_on_image(rgb_img_float, explanation, image_weight=image_weight)