SWCNN icon indicating copy to clipboard operation
SWCNN copied to clipboard

Fix distortion in training data resizing for non-square images

Open aliciusschroeder opened this issue 2 years ago • 0 comments

This Pull Request addresses an issue in the training data preparation process where non-square images were being resized with swapped width and height parameters in the cv2.resize function. The issue caused distortion in the training data, affecting datasets with predominantly non-square images, such as PASCAL VOC 2012.

Changes Made:

  • Corrected the parameter order in the cv2.resize function from (height, width) to (width, height).
  • Ensured resized training images maintain their original aspect ratio, avoiding distortion.
  • Verified that extracted patches reflect the correct image dimensions and distribution.

Impact:
This fix ensures consistency between the training and testing datasets, potentially improving model performance by training on undistorted images. This is important, because during testing no comparable distortion is performed. This PR fixes #3

Testing:

  • Verified that non-square training images are now being resized correctly and maintain their aspect ratio.
  • Checked extracted patches to confirm they are undistorted.

aliciusschroeder avatar Dec 01 '24 12:12 aliciusschroeder