Shortcuts

ShallowCNN

class mmocr.models.textrecog.ShallowCNN(input_channels=1, hidden_dim=512, init_cfg=[{'type': 'Kaiming', 'layer': 'Conv2d'}, {'type': 'Uniform', 'layer': 'BatchNorm2d'}])[源代码]

Implement Shallow CNN block for SATRN.

SATRN: On Recognizing Texts of Arbitrary Shapes with 2D Self-Attention.

参数
  • input_channels (int) – Number of channels of input image tensor \(D_i\). Defaults to 1.

  • hidden_dim (int) – Size of hidden layers of the model \(D_m\). Defaults to 512.

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

返回类型

None

forward(x)[源代码]
参数

x (Tensor) – Input image feature \((N, D_i, H, W)\).

返回

A tensor of shape \((N, D_m, H/4, W/4)\).

返回类型

Tensor

Read the Docs v: latest
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.