Shortcuts

BoundedScaleAspectJitter

class mmocr.datasets.transforms.BoundedScaleAspectJitter(long_size_bound, short_size_bound, ratio_range=(0.7, 1.3), aspect_ratio_range=(0.9, 1.1), resize_type='Resize', **resize_kwargs)[源代码]

First randomly rescale the image so that the longside and shortside of the image are around the bound; then jitter its aspect ratio.

Required Keys:

  • img

  • img_shape

  • gt_bboxes (optional)

  • gt_polygons (optional)

Modified Keys:

  • img

  • img_shape

  • gt_bboxes (optional)

  • gt_polygons (optional)

Added Keys:

  • scale

  • scale_factor

  • keep_ratio

参数
  • long_size_bound (int) – The approximate bound for long size.

  • short_size_bound (int) – The approximate bound for short size.

  • size_jitter_range (tuple(float, float)) – Range of the ratio used to jitter the size. Defaults to (0.7, 1.3).

  • aspect_ratio_jitter_range (tuple(float, float)) – Range of the ratio used to jitter its aspect ratio. Defaults to (0.9, 1.1).

  • resize_type (str) – The type of resize class to use. Defaults to “Resize”.

  • **resize_kwargs – Other keyword arguments for the resize_type.

  • ratio_range (Tuple[float, float]) –

  • aspect_ratio_range (Tuple[float, float]) –

返回类型

None

transform(results)[源代码]

The transform function. All subclass of BaseTransform should override this method.

This function takes the result dict as the input, and can add new items to the dict or modify existing items in the dict. And the result dict will be returned in the end, which allows to concate multiple transforms into a pipeline.

参数

results (dict) – The result dict.

返回

The result dict.

返回类型

dict

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

Free document hosting provided by Read the Docs.