Class RandomColor
Defined in File vision.h
Inheritance Relationships
Base Type
public mindspore::dataset::TensorTransform
(Class TensorTransform)
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.
- Parameters
t_lb – [in] Lower bound random weights.
t_ub – [in] Upper bound random weights.
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
-
~RandomColor() = default
Destructor.
-
RandomColor(float t_lb, float t_ub)