DataAugmentationForObjectDetection icon indicating copy to clipboard operation
DataAugmentationForObjectDetection copied to clipboard

Error while using sequence

Open aymenmir94 opened this issue 6 years ago • 1 comments

I am using a sequence of transforms - randomHSV, randomscale, randomsheer, randomrotate and at the end I get a strange error

I am not sure what the problem is corners = np.hstack((corners, np.ones((corners.shape[0],1), dtype = type(corners[0][0])))) IndexError: index 0 is out of bounds for axis 0 with size 0

aymenmir94 avatar Dec 20 '18 22:12 aymenmir94

I think the error is due to the fact that previous transformations have produced an image that as no bounding boxes in it (the object is now out of the image or truncated at the point the bbox has been deleted). So the get_corners function returns an empty array and in the rotate_box function there is no check for an empty set of bboxes.

A solution I found avoiding to edit the code is to put RandomRotate as the first transformation in the sequence.

vavassoriluca avatar Apr 17 '19 10:04 vavassoriluca