RandomCrop

class RandomCrop(output_size, padding_size=0, padding_value=[0, 0, 0], padding_maskvalue=0, *, order=None)[source]

Crop the input data randomly. Before applying the crop transform, pad the image first. If target size is still bigger than the size of padded image, pad the image size to target size.

Parameters
  • output_size – target size of output image, with (height, width) shape.

  • padding_size – the same with size in Pad.

  • padding_value – the same with value in Pad.

  • order – the same with VisionTransform.

apply(input)[source]

Apply transform on single input data.