Paperspace / DataAugmentationForObjectDetection

Data Augmentation For Object Detection
https://blog.paperspace.com/data-augmentation-for-bounding-boxes/
MIT License
1.13k stars 318 forks source link

Difference between resizing and scaling? #2

Open ogencoglu opened 5 years ago

ogencoglu commented 5 years ago

What is the difference between resizing and scaling? Seems like scaling is just a special case of resizing.

ayooshkathuria commented 5 years ago

Scaling scales the image while keeping the dimensions constant. If you were to scale a image 2x, you will see a zooming effect with some part of the image expelled from the frame. Now I think I should rename it to zooming. The dimensions don't change.

Resize is a case where the actual dimensions of the image change say (1920 x 720) -> (416,416)

davidlmorton commented 5 years ago

It looks like the Resize function doesn't allow you to change the aspect ratio though:

https://github.com/Paperspace/DataAugmentationForObjectDetection/blame/master/data_aug/data_aug.py#L675

It looks like it takes a tuple of integers but letterbox_image is expecting a single integer (despite the docstring to the contrary):

https://github.com/Paperspace/DataAugmentationForObjectDetection/blob/master/data_aug/bbox_util.py#L289