batch_adjust_hue#
- torchaug.batch_transforms.functional.batch_adjust_hue(imgs, hue_factor, value_check=False)[source]#
Adjust hue of a batch of images.
The image hue is adjusted by converting the image to HSV and cyclically shifting the intensities in the hue channel (H). The image is then converted back to original image mode.
hue_factor is the amount of shift in H channel and must be in the interval [-0.5, 0.5].
See Hue for more details.
- Parameters:
imgs (
Tensor) – Batch of images to be adjusted. It is expected to be in [B, …, 1 or 3, H, W] format, where … means it can have an arbitrary number of dimensions. 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|Tensor) – How much to shift the hue channel. Can be 1 or B elements 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. 0 means no shift. Therefore, both -0.5 and 0.5 will give an image with complementary colors while 0 gives the original image.value_check (
bool, optional) – Bool to perform tensor value check. Might cause slow down on some devices because of synchronization or large batch size.Default:False- Return type:
Tensor- Returns:
Hue adjusted batch of images.