Shortcuts

TorchVisionWrapper

class mmocr.datasets.transforms.TorchVisionWrapper(op, **kwargs)[源代码]

A wrapper around torchvision transforms. It applies specific transform to img and updates height and width 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.

返回类型

None

transform(results)[源代码]

Transform the image.

参数

results (dict) – Result dict from the data loader.

返回

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