TorchVisionWrapper¶
- class mmocr.datasets.transforms.TorchVisionWrapper(op, **kwargs)[source]¶
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).
Warning
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.
- Parameters
op (str) – The name of any transform class in
torchvision.transforms()
.**kwargs – Arguments that will be passed to initializer of torchvision transform.
- Return type