Paperspace/DataAugmentationForObjectDetection

Rotation and Shearing giving faulty results

ogencoglu opened this issue · 4 comments

According to the examples in the readme, rotation and shearing are not correctly implemented. Any update in progress?

What exactly in the ReadMe points toward an incorrect implementation of rotation and shearing?

The bounding boxes in your examples are simply wrong after shearing and rotation.

@ogencoglu This can happen if you are using Python 2

In data_aug.py your scale factor should be float, but in Python 2 they will be treated as Integers

Just change the scale_factor code in data_aug.py as follows:'

Instead of

        scale_factor_x = img.shape[1] / w
        scale_factor_y = img.shape[0] / h

Do this

        scale_factor_x = 1.0* img.shape[1] / w
        scale_factor_y = 1.0*img.shape[0] / h

I can also confirm that shear and rotation don't work properly on python 3. I think the problem is due to resize to fit the original image dimensions