Shortcuts

RandomCrop

class mmocr.datasets.transforms.RandomCrop(min_side_ratio=0.4)[source]

Randomly crop images and make sure to contain at least one intact instance.

Required Keys:

  • img

  • gt_polygons

  • gt_bboxes

  • gt_bboxes_labels

  • gt_ignored

  • gt_texts (optional)

Modified Keys:

  • img

  • img_shape

  • gt_polygons

  • gt_bboxes

  • gt_bboxes_labels

  • gt_ignored

  • gt_texts (optional)

Parameters

min_side_ratio (float) – The ratio of the shortest edge of the cropped image to the original image size.

Return type

None

transform(results)[source]

Applying random crop on results. :param results: Result dict contains the data to transform. :type results: dict

Returns

The transformed data.

Return type

dict

Parameters

results (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.