EfficientNetCenterCrop¶
- class mmcls.datasets.transforms.EfficientNetCenterCrop(crop_size, crop_padding=32, interpolation='bicubic', backend='cv2')[source]¶
EfficientNet style center crop.
Required Keys:
img
Modified Keys:
img
img_shape
- Parameters
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.
Notes
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.