Preprocessing images

In YOLO assignment the images are preprocessed with imported code that we can’t see. Given that the images must all be 608x608, there seem to be a number of ways of doing this:

  1. If the image was smaller, pad to height and width
  2. Resize the image, potentially distorting it if it was not square
  3. Resize the image and applying padding to one dimension to preserve the aspect ratio.

Further, if the image was resized, there is no discussion as to what kind of interpolation was used. Nearest neighbour? Linear? Does it matter?

I suspect the answer to the first part is option 3, but I’d really like some practical advise as to what can realistically have an effect, including the interpolation method.

You can see that imported function if you want to. Just click “File → Open” and have a look around. You can figure out the pathname by reading the import cell:

yad2k/utils/utils.py

If you’re new to the courses and started in Course 4, it might be worth having a look at the DLS FAQ Thread. It has a number of topics, including one about how to find the source for imported functions.