TextDetRandomCropFlip¶
- class mmocr.datasets.transforms.TextDetRandomCropFlip(pad_ratio=0.1, crop_ratio=0.5, iter_num=1, min_area_ratio=0.2, epsilon=0.01)[源代码]¶
Random crop and flip a patch in the image. Only used in text detection task.
Required Keys:
img
gt_bboxes
gt_polygons
Modified Keys:
img
gt_bboxes
gt_polygons
- 参数
pad_ratio (float) – The ratio of padding. Defaults to 0.1.
crop_ratio (float) – The ratio of cropping. Defaults to 0.5.
iter_num (int) – Number of operations. Defaults to 1.
min_area_ratio (float) – Minimal area ratio between cropped patch and original image. Defaults to 0.2.
epsilon (float) – The threshold of polygon IoU between cropped area and polygon, which is used to avoid cropping text instances. Defaults to 0.01.
- 返回类型