Shortcuts

NRTRModalityTransform

class mmocr.models.textrecog.NRTRModalityTransform(in_channels=3, init_cfg=[{'type': 'Kaiming', 'layer': 'Conv2d'}, {'type': 'Uniform', 'layer': 'BatchNorm2d'}])[源代码]

Modality transform in NRTR.

参数
  • in_channels (int) – Input channel of image. Defaults to 3.

  • init_cfg (dict or list[dict], optional) – Initialization configs.

返回类型

None

forward(x)[源代码]

Backbone forward.

参数

x (torch.Tensor) – Image tensor of shape \((N, C, W, H)\). W, H is the width and height of image.

返回

Output tensor.

返回类型

Tensor