This commit is contained in:
Glenn Jocher 2019-09-21 23:55:20 +02:00
parent 7de6584a34
commit ccb971aa3c
1 changed files with 5 additions and 3 deletions

View File

@ -657,9 +657,11 @@ def cutout(image, labels):
image[ymin:ymax, xmin:xmax] = mask_color
# return unobscured labels
if len(labels):
box = np.array([xmin, ymin, xmax, ymax], dtype=np.float32)
ioa = bbox_ioa(box, labels[:, 1:5]) # intersection over area
return labels[ioa < 0.90] # > 90% obscured labels removed
labels = labels[ioa < 0.90] # remove >90% obscured labels
return labels
def convert_images2bmp():