BEiTMaskGenerator¶
- class mmpretrain.datasets.transforms.BEiTMaskGenerator(input_size, num_masking_patches, min_num_patches=4, max_num_patches=None, min_aspect=0.3, max_aspect=None)[source]¶
Generate mask for image.
Added Keys:
mask
This module is borrowed from https://github.com/microsoft/unilm/tree/master/beit
- Parameters:
input_size (int) – The size of input image.
num_masking_patches (int) – The number of patches to be masked.
min_num_patches (int) – The minimum number of patches to be masked in the process of generating mask. Defaults to 4.
max_num_patches (int, optional) – The maximum number of patches to be masked in the process of generating mask. Defaults to None.
min_aspect (float, optional) – The minimum aspect ratio of mask blocks. Defaults to 0.3.
min_aspect – The minimum aspect ratio of mask blocks. Defaults to None.