Shortcuts

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.

transform(results)[source]

Transform function to randomly resized crop images.

Parameters

results (dict) – Result dict from loading pipeline.

Returns

EfficientNet style center cropped results, ‘img_shape’

key in result dict is updated according to crop size.

Return type

dict

Read the Docs v: 1.x
Versions
master
latest
1.x
dev-1.x
Downloads
html
epub
On Read the Docs
Project Home
Builds

Free document hosting provided by Read the Docs.