Shortcuts

RescaleToHeight

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

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

参数
  • 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.

返回类型

None

transform(results)[源代码]

Transform function to resize images, bounding boxes and polygons.

参数

results (dict) – Result dict from loading pipeline.

返回

Resized 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.