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
orwidth_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
.
- 返回类型