Class RandomPosterize

Inheritance Relationships

Base Type

Class Documentation

class RandomPosterize : public mindspore::dataset::TensorTransform

Reduce the number of bits for each color channel randomly.

Public Functions

explicit RandomPosterize(const std::vector<uint8_t> &bit_range = {4, 8})

Constructor.

参数

bit_range[in] Range of random posterize to compress image. uint8_t vector representing the minimum and maximum bit in range of [1,8] (Default={4, 8}).

样例
/* Define operations */
auto decode_op = vision::Decode();
auto random_op = vision::RandomPosterize({4, 8});

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

Destructor.