ml.utils.augmentation

Augmentation utilities for image data.

ml.utils.augmentation.get_image_mask(image: Tensor, *, min_prct: float = 0.2, max_prct: float = 0.5) Tensor[source]

Gets a random mask for the image.

Parameters:
  • image – The image to mask, with shape (…, H, W)

  • min_prct – Minimum percent of image to mask in either dimension

  • max_prct – Maximum percent of image to mask in either dimension

Returns:

An image mask, with shape (…, H, W) matching the original image shape