nvidia.dali.fn.color_twist

nvidia.dali.fn.color_twist(*inputs, **kwargs)

Adjusts hue, saturation, brightness and contrast of the image.

This operator allows sequence inputs and supports volumetric data.

Supported backends
  • ‘cpu’

  • ‘gpu’

Parameters:

input (TensorList ('HWC', 'FHWC', 'DHWC')) – Input to the operator.

Keyword Arguments:
  • brightness (float or TensorList of float, optional, default = 1.0) –

    Brightness change factor.

    Values must be non-negative.

    Example values:

    • 0 - Black image.

    • 1 - No change.

    • 2 - Increase brightness twice.

    Supports per-frame inputs.

  • bytes_per_sample_hint (int or list of int, optional, default = [0]) –

    Output size hint, in bytes per sample.

    If specified, the operator’s outputs residing in GPU or page-locked host memory will be preallocated to accommodate a batch of samples of this size.

  • contrast (float or TensorList of float, optional, default = 1.0) –

    Contrast change factor.

    Values must be non-negative.

    Example values:

    • 0 - Uniform grey image.

    • 1 - No change.

    • 2 - Increase brightness twice.

    Supports per-frame inputs.

  • dtype (nvidia.dali.types.DALIDataType, optional) –

    Output data type.

    If not set, the input type is used.

  • hue (float or TensorList of float, optional, default = 0.0) –

    Hue change, in degrees.

    Supports per-frame inputs.

  • image_type (nvidia.dali.types.DALIImageType, optional, default = DALIImageType.RGB) – The color space of the input and the output image.

  • preserve (bool, optional, default = False) – Prevents the operator from being removed from the graph even if its outputs are not used.

  • saturation (float or TensorList of float, optional, default = 1.0) –

    Saturation change factor.

    Values must be non-negative.

    Example values:

    • 0 - Completely desaturated image.

    • 1 - No change to image’s saturation.

    Supports per-frame inputs.

  • seed (int, optional, default = -1) –

    Random seed.

    If not provided, it will be populated based on the global seed of the pipeline.