Class RandomColor

Inheritance Relationships

Base Type

Class Documentation

class RandomColor : public mindspore::dataset::TensorTransform

Blend an image with its grayscale version with random weights t and 1 - t generated from a given range. If the range is trivial then the weights are determinate and t equals to the bound of the interval.

Public Functions

RandomColor(float t_lb, float t_ub)

Constructor.

Example
/* Define operations */
auto decode_op = vision::Decode();
auto random_color_op = vision::RandomColor(5.0, 50.0);

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

参数
  • t_lb[in] Lower bound random weights.

  • t_ub[in] Upper bound random weights.

~RandomColor() = default

Destructor.