Shortcuts

RandomCrop

class mmocr.datasets.transforms.RandomCrop(min_side_ratio=0.4)[源代码]

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)

参数

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

返回类型

None

transform(results)[源代码]

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

返回

The transformed data.

返回类型

dict

参数

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