-
Notifications
You must be signed in to change notification settings - Fork 315
Description
I get this error when setting RandomScale to a large number like 0.5、0.8
transforms = Sequence([RandomHorizontalFlip(1), RandomScale((0.8,0.9), diff = True), RandomRotate(10)])
IndexError Traceback (most recent call last)
in
34 transforms = Sequence([RandomHorizontalFlip(1), RandomScale((0.8,0.9), diff = True), RandomRotate(10)])
35
---> 36 img, bboxes = transforms(img, bboxes)
37 cv2.imwrite(os.path.join('JPEGImages2',file), img)
38 plt.imshow(draw_rect(img, bboxes))
~/card/DataAugmentationForObjectDetection/data_aug/data_aug.py in call(self, images, bboxes)
853
854 if random.random() < prob:
--> 855 images, bboxes = augmentation(images, bboxes)
856 return images, bboxes
~/card/DataAugmentationForObjectDetection/data_aug/data_aug.py in call(self, img, bboxes)
456
457
--> 458 corners[:,:8] = rotate_box(corners[:,:8], angle, cx, cy, h, w)
459
460 new_bbox = get_enclosing_box(corners)
~/card/DataAugmentationForObjectDetection/data_aug/bbox_util.py in rotate_box(corners, angle, cx, cy, h, w)
214
215 corners = corners.reshape(-1,2)
--> 216 corners = np.hstack((corners, np.ones((corners.shape[0],1), dtype = type(corners[0][0]))))
217
218 M = cv2.getRotationMatrix2D((cx, cy), angle, 1.0)
IndexError: index 0 is out of bounds for axis 0 with size 0