PadToWidth¶ class mmocr.datasets.transforms.PadToWidth(width, pad_cfg={'type': 'Pad'})[源代码]¶ Only pad the image’s width. Required Keys: img Modified Keys: img img_shape Added Keys: pad_shape pad_fixed_size pad_size_divisor valid_ratio 参数 width (int) – Target width of padded image. Defaults to None. pad_cfg (dict) – Config to construct the Resize transform. Refer to Pad for detail. Defaults to dict(type='Pad'). 返回类型 None transform(results)[源代码]¶ Call function to pad images. 参数 results (dict) – Result dict from loading pipeline. 返回 Updated result dict. 返回类型 dict