Paperspace/DataAugmentationForObjectDetection

Rotation scaling difference

Opened this issue · 1 comments

I came across this useful library however, I noticed some unexpected behaviour when I applied the examples to my images. Unfortunately, in the example below, it seems that not only is the image being rotated it is also being scaled down. It also seems the bounding box doesn't get scaled-down alongside the image.

The problem seems to be particularly prevalent with rotations.

Here is the code for generating both images:

bboxes = np.array([list(details[image_name]['bbox'][0].values())[1:]], dtype=float)
print(bboxes)
img = cv2.imread(data_dir + "images/" + image_name + ".jpg")
plotted_img = draw_rect(img, bboxes)
plt.imshow(plotted_img)
plt.show()

img1, bboxes1 = RandomRotate(180)(img.copy(), bboxes.copy())
plotted_img = draw_rect(img1, bboxes1)
plt.imshow(plotted_img)
plt.show()

Here are the images:
Imgur

Wondering if one of the authors could offer some explanation (intended effect or bug and why) and/ or a function to modify to fix this.

Hi did u manage to solve this issue?