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)[source]

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

Parameters
  • 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.

Return type

None

transform(results)[source]

Applying random crop flip on results.

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.