Shortcuts

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)[源代码]

Generate mask for image.

Added Keys:

  • mask

This module is borrowed from https://github.com/microsoft/unilm/tree/master/beit

参数:
  • 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.

transform(results)[源代码]

Method to generate random block mask for each Image in BEiT.

参数:

results (dict) – Result dict from previous pipeline.

返回:

Result dict with added key mask.

返回类型:

dict

Read the Docs v: latest
Versions
latest
stable
mmcls-1.x
mmcls-0.x
dev
Downloads
epub
On Read the Docs
Project Home
Builds

Free document hosting provided by Read the Docs.