Keep original aspect ratio / size of images#1312
Draft
FennelFetish wants to merge 5 commits intoNerogar:masterfrom
Draft
Keep original aspect ratio / size of images#1312FennelFetish wants to merge 5 commits intoNerogar:masterfrom
FennelFetish wants to merge 5 commits intoNerogar:masterfrom
Conversation
Add Enum and migration.
Collaborator
|
Thanks! about |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR changes the toggle for
aspect_ratio_bucketingto a combo boximage_preprocessingwith a new third option:Keep Aspect Ratio.The corresponding config value is migrated.
The other two options are:
Square Center Crop(previously: aspect_ratio_bucketing = off)Aspect Ratio Bucketing(previously: aspect_ratio_bucketing = on)I've also expanded on the tooltip. This was quite confusing to me when I started using OT and I hope these changes also make it more clear.
The new
Keep Aspect Ratiopreprocessing strategy:resolution²pixels.resolutionwhich disables scaling, e.g. 2048.As with the other processing strategies, the
resolutioncan be overridden for each concept.Multiple resolutions can be specified, e.g.
1024, 768, 1280, in which case it will randomly select a value for each image.This PR depends on the
KeepAspectCalculationmodule from: Nerogar/mgds#29Which is part of: #975
... and hasn't been merged yet.
The
image_preprocessingsetting could also be used to selectMixed Resolution Batching.My version of the module with less verbose logging is here: https://github.com/FennelFetish/mgds/blob/keep-image-size/src/mgds/pipelineModules/KeepAspectCalculation.py
I think it needs to somehow handle
possible_resolutionslike the other modules do.Since I'm not the author of that pipeline module, I'll first do the changes in my MGDS fork and we can see later how to integrate the changes in upstream MGDS, ok?
Closes #1276
TODO:
possible_resolutions.