Skip to content

Commit

Permalink
chore: raise on missing semantic class
Browse files Browse the repository at this point in the history
  • Loading branch information
beniz committed Oct 25, 2023
1 parent 9a24605 commit 7f7472d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions data/online_creation.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ def crop_image(
# Bbox file
f = open(bbox_path, "r")
else:

# bbox_img = np.array(Image.open(img_path))
import cv2

Expand Down Expand Up @@ -95,7 +94,6 @@ def crop_image(
print("%s does not describe a bbox" % line)

else:

cat = str(int(np.max(bbox_img)))

# Find the indices of non-zero elements in the image
Expand Down Expand Up @@ -169,6 +167,8 @@ def crop_image(
else:
raise ValueError("mask_delta value is incorrect.")
else:
if len(mask_delta) <= cat - 1:
raise ValueError("too few classes, can't find mask_delta value")
mask_delta_cat = mask_delta[cat - 1]
if isinstance(mask_delta[0][0], float):
if len(mask_delta_cat) == 1:
Expand Down

0 comments on commit 7f7472d

Please sign in to comment.