Preprocessing

utils.data.augmentation.get_random_pos(img, window_shape)

Extract of 2D random patch of shape window_shape in the image

utils.data.augmentation.pad_tensor(image_tensor: torch.Tensor, pad_size: int = 32)

Pads input tensor to make it’s height and width dividable by @pad_size

Parameters
  • image_tensor – Input tensor of shape NxCxHxW

  • pad_size – Pad size

Returns

Tuple of output tensor and pad params. Second argument can be used to reverse pad operation of metrics output

utils.data.augmentation.rm_pad_tensor(image_tensor, pad)

Remove padding from a tensor

Parameters
  • image_tensor

  • pad

Returns