mindspore.dataset.vision.c_transforms.Normalize

class mindspore.dataset.vision.c_transforms.Normalize(mean, std)[source]

Normalize the input image with respect to mean and standard deviation.

Parameters
  • mean (sequence) – List or tuple of mean values for each channel, with respect to channel order. The mean values must be in range [0.0, 255.0].

  • std (sequence) – List or tuple of standard deviations for each channel, with respect to channel order. The standard deviation values must be in range (0.0, 255.0].

Examples

>>> import mindspore.dataset.vision.c_transforms as c_vision
>>>
>>> decode_op = c_vision.Decode()
>>> normalize_op = c_vision.Normalize(mean=[121.0, 115.0, 100.0], std=[70.0, 68.0, 71.0])
>>> transforms_list = [decode_op, normalize_op]
>>> data1 = data1.map(operations=transforms_list, input_columns=["image"])