Shortcuts

EfficientNetRandomCrop

class mmpretrain.datasets.transforms.EfficientNetRandomCrop(scale, min_covered=0.1, crop_padding=32, interpolation='bicubic', **kwarg)[源代码]

EfficientNet 风格的随机缩放裁剪

Required Keys:

  • img

Modified Keys:

  • img

  • img_shape

参数:
  • scale (int) – Desired output scale of the crop. Only int size is accepted, a square crop (size, size) is made.

  • min_covered (Number) – Minimum ratio of the cropped area to the original area. Defaults to 0.1.

  • crop_padding (int) – The crop padding parameter in efficientnet style center crop. Defaults to 32.

  • crop_ratio_range (tuple) – Range of the random size of the cropped image compared to the original image. Defaults to (0.08, 1.0).

  • aspect_ratio_range (tuple) – Range of the random aspect ratio of the cropped image compared to the original image. Defaults to (3. / 4., 4. / 3.).

  • max_attempts (int) – Maximum number of attempts before falling back to Central Crop. Defaults to 10.

  • interpolation (str) – Interpolation method, accepted values are ‘nearest’, ‘bilinear’, ‘bicubic’, ‘area’, ‘lanczos’. Defaults to ‘bicubic’.

  • backend (str) – The image resize backend type, accepted values are ‘cv2’ and ‘pillow’. Defaults to ‘cv2’.

transform(results)

Transform function to randomly resized crop images.

参数:

results (dict) – Result dict from loading pipeline.

返回:

Randomly resized cropped results, ‘img_shape’

key in result dict is updated according to crop size.

返回类型:

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.