Shortcuts

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.

返回类型

None

transform(results)[源代码]

Applying random crop flip on results.

参数

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

返回

The transformed data

返回类型

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.