TorchVisionWrapper¶
- class mmocr.datasets.transforms.TorchVisionWrapper(op, **kwargs)[源代码]¶
A wrapper around torchvision transforms. It applies specific transform to
img
and updatesheight
andwidth
accordingly.Required Keys:
img (ndarray): The input image.
Modified Keys:
img (ndarray): The modified image.
img_shape (tuple(int, int)): The shape of the image in (height, width).
警告
This transform only affects the image but not its associated annotations, such as word bounding boxes and polygons. Therefore, it may only be applicable to text recognition tasks.
- 参数
op (str) – The name of any transform class in
torchvision.transforms()
.**kwargs – Arguments that will be passed to initializer of torchvision transform.
- 返回类型