Shortcuts

NRTRModalityTransform

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

Modality transform in NRTR.

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

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

Return type

None

forward(x)[source]

Backbone forward.

Parameters

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

Returns

Output tensor.

Return type

Tensor