Skip to content

Commit 5ee7526

Browse files
authored
Merge pull request IDEA-Research#42 from Greywan/dev
fix:fixed interruptions when there is no mask result for the current …
2 parents be1fa53 + f3d3819 commit 5ee7526

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

utils/common_utils.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,10 @@ def draw_masks_and_box_with_supervision(raw_image_path, mask_path, json_path, ou
4848
object_mask = (mask == uid)
4949
all_object_masks.append(object_mask[None])
5050

51+
if len(all_object_masks) == 0:
52+
output_image_path = os.path.join(output_path, raw_image_name)
53+
cv2.imwrite(output_image_path, image)
54+
continue
5155
# get n masks: (n, h, w)
5256
all_object_masks = np.concatenate(all_object_masks, axis=0)
5357

0 commit comments

Comments
 (0)