ImgAugWrapper¶
- class mmocr.datasets.transforms.ImgAugWrapper(args=None, fix_poly_trans={'type': 'FixInvalidPolygon'})[源代码]¶
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)
- 参数
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’).
- 返回类型