Scale training images according to area, not longest side#380
Merged
filipstrand merged 1 commit intofilipstrand:mainfrom Mar 15, 2026
Merged
Scale training images according to area, not longest side#380filipstrand merged 1 commit intofilipstrand:mainfrom
filipstrand merged 1 commit intofilipstrand:mainfrom
Conversation
8010296 to
e9d3853
Compare
When the user limits the `max_resolution` it's very likely because of resource constraints. But the resource use is strongly correlated to the total number of pixels and not the length of the longer side of an image. This change modifies the logic to resolve dimensions where the *area* of the resolved image is ~ `max_resoluton ^ 2`, which means non-square images get the same "pixel budget" as square images.
e9d3853 to
fe06de7
Compare
Owner
|
I agree, this makes more sense, thanks for considering this use case! At first, I thought of updating the name I'll go ahead and include it for v0.17 which is due soon. If you have further suggestions for API related things, they are also very welcome here #357 |
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.
When the user limits the
max_resolutionit's very likely because of resource constaints. But the resource use is strongly correlated to the total number of pixels and not the length of the longer side of an image.This change modifies the logic to resolve dimensions where the area of the resolved image is ~
max_resoluton ^ 2, which means non-square images get the same "pixel budget" as square images.