Class RandomResize

Inheritance Relationships

Base Type

Class Documentation

class RandomResize : public mindspore::dataset::TensorTransform

Resize the input image using a randomly selected interpolation mode.

Public Functions

explicit RandomResize(const std::vector<int32_t> &size)

Constructor.

Parameters

size[in] A vector representing the output size of the resized image. If the size is a single value, the smaller edge of the image will be resized to this value with the same image aspect ratio. If the size has 2 values, it should be (height, width).

Example
/* Define operations */
auto decode_op = vision::Decode();
auto random_op = vision::RandomResize({32, 32});

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

Destructor.