Shortcuts

ShortScaleAspectJitter

class mmocr.datasets.transforms.ShortScaleAspectJitter(short_size=736, ratio_range=(0.7, 1.3), aspect_ratio_range=(0.9, 1.1), scale_divisor=1, resize_type='Resize', **resize_kwargs)[源代码]

First rescale the image for its shorter side to reach the short_size and then jitter its aspect ratio, final rescale the shape guaranteed to be divided by scale_divisor.

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

参数
  • short_size (int) – Target shorter size before jittering the aspect ratio. Defaults to 736.

  • short_size_jitter_range (tuple(float, float)) – Range of the ratio used to jitter the target shorter 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).

  • scale_divisor (int) – The scale divisor. Defaults to 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)[源代码]

Short Scale Aspect Jitter. :param results: Result dict containing the data to transform. :type results: dict

返回

The transformed data.

返回类型

dict

参数

results (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.