evaluation with a given GT is only possible for segmentation tasks

This commit is contained in:
vahidrezanezhad 2025-12-17 13:28:02 +01:00
parent 4651000191
commit 6ee79c7320

View file

@ -576,9 +576,9 @@ class sbb_predict:
if self.save_layout: if self.save_layout:
cv2.imwrite(self.save_layout, only_layout) cv2.imwrite(self.save_layout, only_layout)
if self.ground_truth: if self.ground_truth:
gt_img=cv2.imread(self.ground_truth) gt_img=cv2.imread(self.ground_truth)
self.IoU(gt_img[:,:,0],res[:,:,0]) self.IoU(gt_img[:,:,0],res[:,:,0])
else: else:
ls_images = os.listdir(self.dir_in) ls_images = os.listdir(self.dir_in)
@ -599,9 +599,9 @@ class sbb_predict:
self.save_layout = os.path.join(self.out, f_name+'_layout.png') self.save_layout = os.path.join(self.out, f_name+'_layout.png')
cv2.imwrite(self.save_layout, only_layout) cv2.imwrite(self.save_layout, only_layout)
if self.ground_truth: if self.ground_truth:
gt_img=cv2.imread(self.ground_truth) gt_img=cv2.imread(self.ground_truth)
self.IoU(gt_img[:,:,0],res[:,:,0]) self.IoU(gt_img[:,:,0],res[:,:,0])