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, bool is_hwc = true)

Constructor.

参数
  • 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.

  • is_hwc[in] A boolean to indicate whether the input image is in HWC format (true) or CHW format (false) (default = true).

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

Destructor.