Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added transform option 'resize-pad' to dataset_tool.py #64

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

nmichlo
Copy link

@nmichlo nmichlo commented Nov 8, 2021

Pull request for #63

Adds a new transform mode called resize-pad that:

  1. first scales an input image into the specified bounds given by --resolution. Such that at least one of the dimensions (width or hight) match their corresponding output size.
  2. Then if any dimension (width or height) is still less than the required size, pads the image to the required size

@nmichlo nmichlo force-pushed the feature_resize-pad branch from db15804 to e53d47c Compare November 9, 2021 09:41
First scales an image within the specified bounds then pads the scaled image if one axis is smaller than what is required

This operation preserves the image aspect ratio and content, without cropping or warping.
@nmichlo nmichlo force-pushed the feature_resize-pad branch from e53d47c to 87f04fa Compare November 9, 2021 10:29
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.

1 participant