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.

Parameters

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}).

Example
/* 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() override = default

Destructor.