Skip to content

Fix distortion in training data resizing for non-square images#4

Open
aliciusschroeder wants to merge 1 commit into
hellloxiaotian:mainfrom
aliciusschroeder:fix-training-data-distortion
Open

Fix distortion in training data resizing for non-square images#4
aliciusschroeder wants to merge 1 commit into
hellloxiaotian:mainfrom
aliciusschroeder:fix-training-data-distortion

Conversation

@aliciusschroeder

Copy link
Copy Markdown

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Distortion in training data due to incorrect resizing of non-square images

1 participant