Class CutOut

Inheritance Relationships

Base Type

Class Documentation

class CutOut : public mindspore::dataset::TensorTransform

Randomly cut (mask) out a given number of square patches from the input image.

Public Functions

explicit CutOut(int32_t length, int32_t num_patches = 1)

Constructor.

Parameters
  • length[in] Integer representing the side length of each square patch.

  • num_patches[in] Integer representing the number of patches to be cut out of an image.

Example
/* dataset is an instance of Dataset object */
dataset = dataset->Map({std::make_shared<vision::Decode>(),
                        std::make_shared<vision::CutOut>(1, 4)}, // operations
                       {"image"});                               // input columns
~CutOut() = default

Destructor.