Class Normalize

Inheritance Relationships

Base Type

Class Documentation

class Normalize : public mindspore::dataset::TensorTransform

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

Public Functions

Normalize(const std::vector<float> &mean, const std::vector<float> &std)

Constructor.

Parameters
  • mean[in] A vector of mean values for each channel, with respect to channel order. The mean values must be in range [0.0, 255.0].

  • std[in] A vector of standard deviations for each channel, with respect to channel order. The standard deviation values must be in range (0.0, 255.0].

Example
/* Define operations */
auto decode_op = vision::Decode();
auto normalize_op = vision::Normalize({128, 128, 128}, {1.0, 1.0, 1.0});

/* dataset is an instance of Dataset object */
dataset = dataset->Map({decode_op, normalize_op},  // operations
                       {"image"});                 // input columns
~Normalize() = default

Destructor.