Shortcuts

EfficientNetCenterCrop

class mmpretrain.datasets.transforms.EfficientNetCenterCrop(crop_size, crop_padding=32, interpolation='bicubic', backend='cv2')[源代码]

EfficientNet 风格的中心裁剪

Required Keys:

  • img

Modified Keys:

  • img

  • img_shape

参数:
  • crop_size (int) – Expected size after cropping with the format of (h, w).

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

  • interpolation (str) – Interpolation method, accepted values are ‘nearest’, ‘bilinear’, ‘bicubic’, ‘area’, ‘lanczos’. Only valid if efficientnet_style is True. Defaults to ‘bicubic’.

  • backend (str) – The image resize backend type, accepted values are cv2 and pillow. Only valid if efficientnet style is True. Defaults to cv2.

备注

  • If the image is smaller than the crop size, return the original image.

  • The pipeline will be to first to perform the center crop with the crop_size_ as:

\[\text{crop_size_} = \frac{\text{crop_size}}{\text{crop_size} + \text{crop_padding}} \times \text{short_edge}\]

And then the pipeline resizes the img to the input crop size.

transform(results)[源代码]

Transform function to randomly resized crop images.

参数:

results (dict) – Result dict from loading pipeline.

返回:

EfficientNet style center 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.