mindspore.dataset.vision.c_transforms.Rescale

class mindspore.dataset.vision.c_transforms.Rescale(rescale, shift)[source]

Rescale the input image with the given rescale and shift. This operator will rescale the input image with: output = image * rescale + shift.

Note

This operation supports running on Ascend or GPU platforms by Offload.

Parameters
  • rescale (float) – Rescale factor.

  • shift (float) – Shift factor.

Raises
  • TypeError – If rescale is not of type float.

  • TypeError – If shift is not of type float.

Supported Platforms:

CPU Ascend GPU

Examples

>>> transforms_list = [c_vision.Decode(), c_vision.Rescale(1.0 / 255.0, -1.0)]
>>> image_folder_dataset = image_folder_dataset.map(operations=transforms_list,
...                                                 input_columns=["image"])