Unverified Commit f1172393 authored by Behrooz's avatar Behrooz Committed by GitHub
Browse files

Update docstring of ColorJitter, adjust_hue,_rgb2hsv (#5695)



* Update docstring of adjust_hue
Signed-off-by: default avatarBehrooz <3968947+drbeh@users.noreply.github.com>

* Update docstring of ColorJitter
Signed-off-by: default avatarBehrooz <3968947+drbeh@users.noreply.github.com>

* Minor corrections
Signed-off-by: default avatarBehrooz <3968947+drbeh@users.noreply.github.com>
parent 61f82669
...@@ -880,6 +880,9 @@ def adjust_hue(img: Tensor, hue_factor: float) -> Tensor: ...@@ -880,6 +880,9 @@ def adjust_hue(img: Tensor, hue_factor: float) -> Tensor:
If img is torch Tensor, it is expected to be in [..., 1 or 3, H, W] format, If img is torch Tensor, it is expected to be in [..., 1 or 3, H, W] format,
where ... means it can have an arbitrary number of leading dimensions. where ... means it can have an arbitrary number of leading dimensions.
If img is PIL Image mode "1", "I", "F" and modes with transparency (alpha channel) are not supported. If img is PIL Image mode "1", "I", "F" and modes with transparency (alpha channel) are not supported.
Note: the pixel values of the input image has to be non-negative for conversion to HSV space;
thus it does not work if you normalize your image to an interval with negative values,
or use an interpolation that generates negative values before using this function.
hue_factor (float): How much to shift the hue channel. Should be in hue_factor (float): How much to shift the hue channel. Should be in
[-0.5, 0.5]. 0.5 and -0.5 give complete reversal of hue channel in [-0.5, 0.5]. 0.5 and -0.5 give complete reversal of hue channel in
HSV space in positive and negative direction respectively. HSV space in positive and negative direction respectively.
......
...@@ -1156,6 +1156,9 @@ class ColorJitter(torch.nn.Module): ...@@ -1156,6 +1156,9 @@ class ColorJitter(torch.nn.Module):
hue (float or tuple of float (min, max)): How much to jitter hue. hue (float or tuple of float (min, max)): How much to jitter hue.
hue_factor is chosen uniformly from [-hue, hue] or the given [min, max]. hue_factor is chosen uniformly from [-hue, hue] or the given [min, max].
Should have 0<= hue <= 0.5 or -0.5 <= min <= max <= 0.5. Should have 0<= hue <= 0.5 or -0.5 <= min <= max <= 0.5.
To jitter hue, the pixel values of the input image has to be non-negative for conversion to HSV space;
thus it does not work if you normalize your image to an interval with negative values,
or use an interpolation that generates negative values before using this function.
""" """
def __init__(self, brightness=0, contrast=0, saturation=0, hue=0): def __init__(self, brightness=0, contrast=0, saturation=0, hue=0):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment