composer.algorithms.functional.colout

composer.algorithms.functional.colout(img: Union[torch.Tensor, PIL.Image.Image], p_row: float, p_col: float) Union[torch.Tensor, PIL.Image.Image][source]

Drops random rows and columns from a single image.

Parameters
  • img (torch.Tensor or PIL Image) – An input image as a torch.Tensor or PIL image

  • p_row (float) – Fraction of rows to drop (drop along H).

  • p_col (float) – Fraction of columns to drop (drop along W).

Returns

torch.Tensor or PIL Image – A smaller image with rows and columns dropped