Skip to content

[BC-breaking] ColorJitter gets its random params by calling get_params() #3001

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
merged 5 commits into from
Nov 16, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions torchvision/transforms/transforms.py
Original file line number Diff line number Diff line change
Expand Up @@ -1059,10 +1059,14 @@ def get_params(brightness: Optional[List[float]],
"""Get the parameters for the randomized transform to be applied on image.

Args:
brightness (tuple of float (min, max)): The range from which the brightness_factor is chosen uniformly.
contrast (tuple of float (min, max)): The range from which the contrast_factor is chosen uniformly.
saturation (tuple of float (min, max)): The range from which the saturation_factor is chosen uniformly.
hue (tuple of float (min, max)): The range from which the hue_factor is chosen uniformly.
brightness (tuple of float (min, max) or None): The range from which the brightness_factor is chosen
uniformly. Pass None to turn off the transformation.
contrast (tuple of float (min, max) or None): The range from which the contrast_factor is chosen
uniformly. Pass None to turn off the transformation.
saturation (tuple of float (min, max) or None): The range from which the saturation_factor is chosen
uniformly. Pass None to turn off the transformation.
hue (tuple of float (min, max) or None): The range from which the hue_factor is chosen uniformly.
Pass None to turn off the transformation.

Returns:
tuple: The parameters used to apply the randomized transform
Expand Down