Skip to content

Add size limits to RandomScale transform #462

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

Merged

Conversation

ShahJahanIshaq
Copy link
Contributor

Thank you for your contribution to the MindOCR repo.
Before submitting this PR, please make sure:

Motivation

During training, the RandomScale transform randomly scaled the images in the datasets; however, in some datasets, there are mixtures of small and big images, which, when scaled randomly, may lead to extremely small or extremely large images.

Therefore, this PR implements the logic of taking the minimum and maximum side lengths (side_limits) as arguments and then using them to calculate the scaling factor, so the randomly scaled images always stay within the specified reasonable limits.

Test Plan

(How should this PR be tested? Do you require special setup to run the test or repro the fixed bug?)

Related Issues and PRs

(Is this PR part of a group of changes? Link the other relevant PRs and Issues here. Use https://help.github.com/en/articles/closing-issues-using-keywords for help on GitHub syntax)

@hadipash
Copy link
Collaborator

@colawyee FCENet's original scaling transformation required size limits. This PR adds this functionality so that you can integrate limits in FCENet if you find it necessary.

@SamitHuang SamitHuang merged commit 567c710 into mindspore-lab:main Jul 4, 2023
@ShahJahanIshaq ShahJahanIshaq deleted the add-limit-scale-transform branch July 5, 2023 06:01
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.

4 participants