Shortcuts

ImgAugWrapper

class mmocr.datasets.transforms.ImgAugWrapper(args=None, fix_poly_trans={'type': 'FixInvalidPolygon'})[source]

A wrapper around imgaug https://github.com/aleju/imgaug.

Find available augmenters at https://imgaug.readthedocs.io/en/latest/source/overview_of_augmenters.html.

Required Keys:

  • img

  • gt_polygons (optional for text recognition)

  • gt_bboxes (optional for text recognition)

  • gt_bboxes_labels (optional for text recognition)

  • gt_ignored (optional for text recognition)

  • gt_texts (optional)

Modified Keys:

  • img

  • gt_polygons (optional for text recognition)

  • gt_bboxes (optional for text recognition)

  • gt_bboxes_labels (optional for text recognition)

  • gt_ignored (optional for text recognition)

  • img_shape (optional)

  • gt_texts (optional)

Parameters
  • args (list[list or dict]], optional) – The argumentation list. For details, please refer to imgaug document. Take args=[[‘Fliplr’, 0.5], dict(cls=’Affine’, rotate=[-10, 10]), [‘Resize’, [0.5, 3.0]]] as an example. The args horizontally flip images with probability 0.5, followed by random rotation with angles in range [-10, 10], and resize with an independent scale in range [0.5, 3.0] for each side of images. Defaults to None.

  • fix_poly_trans (dict) – The transform configuration to fix invalid polygons. Set it to None if no fixing is needed. Defaults to dict(type=’FixInvalidPolygon’).

Return type

None

transform(results)[source]

Transform the image and annotation data.

Parameters

results (dict) – Result dict containing the data to transform.

Returns

The transformed data.

Return type

dict

Read the Docs v: dev-1.x
Versions
latest
stable
v1.0.1
v1.0.0
0.x
v0.6.3
v0.6.2
v0.6.1
v0.6.0
v0.5.0
v0.4.1
v0.4.0
v0.3.0
v0.2.1
v0.2.0
v0.1.0
dev-1.x
Downloads
pdf
html
epub
On Read the Docs
Project Home
Builds

Free document hosting provided by Read the Docs.