Shortcuts

PyramidRescale

class mmocr.datasets.transforms.PyramidRescale(factor=4, base_shape=(128, 512), randomize_factor=True)[源代码]

Resize the image to the base shape, downsample it with gaussian pyramid, and rescale it back to original size.

Adapted from https://github.com/FangShancheng/ABINet.

Required Keys:

  • img (ndarray)

Modified Keys:

  • img (ndarray)

参数
  • factor (int) – The decay factor from base size, or the number of downsampling operations from the base layer.

  • base_shape (tuple[int, int]) – The shape (width, height) of the base layer of the pyramid.

  • randomize_factor (bool) – If True, the final factor would be a random integer in [0, factor].

返回类型

None

transform(results)[源代码]

Applying pyramid rescale 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.