cerebras.modelzoo.data.vision.segmentation.preprocessing_utils.resize_image_with_crop_or_pad_transform#

cerebras.modelzoo.data.vision.segmentation.preprocessing_utils.resize_image_with_crop_or_pad_transform(img, target_height, target_width)[source]#

Function equivalent to tf.image.resize_with_crop_or_pad :params img: torch.Tensor of shape (C, H, W) or (H, W) :params target_height: int value representing output image height :params target_width: int value representing output image width :returns torch.Tensor of shape (C, target_height, target_width)