Shortcuts

RescaleToHeight

class mmocr.datasets.transforms.RescaleToHeight(height, min_width=None, max_width=None, width_divisor=1, resize_type='Resize', **resize_kwargs)[source]

Rescale the image to the height according to setting and keep the aspect ratio unchanged if possible. However, if any of min_width, max_width or width_divisor are specified, aspect ratio may still be changed to ensure the width meets these constraints.

Required Keys:

  • img

Modified Keys:

  • img

  • img_shape

Added Keys:

  • scale

  • scale_factor

  • keep_ratio

Parameters
  • height (int) – Height of rescaled image.

  • min_width (int, optional) – Minimum width of rescaled image. Defaults to None.

  • max_width (int, optional) – Maximum width of rescaled image. Defaults to None.

  • width_divisor (int) – The divisor of width size. Defaults to 1.

  • resize_type (str) – The type of resize class to use. Defaults to “Resize”.

  • **resize_kwargs – Other keyword arguments for the resize_type.

Return type

None

transform(results)[source]

Transform function to resize images, bounding boxes and polygons.

Parameters

results (dict) – Result dict from loading pipeline.

Returns

Resized results.

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.