-
Notifications
You must be signed in to change notification settings - Fork 7k
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
move parameter sampling of RandomPhotometricDistort into _get_params #7442
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/vision/7442
Note: Links to docs will display an error until the docs builds have been completed. This comment was automatically generated by Dr. CI and updates every 15 minutes. |
@@ -228,19 +228,22 @@ def __init__( | |||
|
|||
def _get_params(self, flat_inputs: List[Any]) -> Dict[str, Any]: | |||
num_channels, *_ = query_chw(flat_inputs) | |||
return dict( | |||
zip( | |||
["brightness", "contrast1", "saturation", "hue", "contrast2"], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure why we went for "contrast1"
and "contrast2"
before. Since we have the additional "contrast_before"
flag, it is guaranteed, that they will never be applied at the same time. Meaning, there is no point in sampling them twice.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks Philip, LGTM.
We should try to remember to add such consistency tests to the V2 transforms tests
…t_params (#7442) Reviewed By: vmoens Differential Revision: D44416572 fbshipit-source-id: da21a5f8f85fa7959dc533f49f30db4f36a83515
This violated our requirement that parameters will only be sampled once. Meaning, without this PR, you will get multiple different distortions when passing multiple images.
cc @vfdev-5