Shortcuts

PyramidRescale

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

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)

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

Return type

None

transform(results)[source]

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