Shortcuts

PANHead

class mmocr.models.textdet.PANHead(in_channels, hidden_dim, out_channel, module_loss={'type': 'PANModuleLoss'}, postprocessor={'text_repr_type': 'poly', 'type': 'PANPostprocessor'}, init_cfg=[{'type': 'Normal', 'mean': 0, 'std': 0.01, 'layer': 'Conv2d'}, {'type': 'Constant', 'val': 1, 'bias': 0, 'layer': 'BN'}])[source]

The class for PANet head.

Parameters
  • in_channels (list[int]) – A list of 4 numbers of input channels.

  • hidden_dim (int) – The hidden dimension of the first convolutional layer.

  • out_channel (int) – Number of output channels.

  • module_loss (dict) – Configuration dictionary for loss type. Defaults to dict(type=’PANModuleLoss’)

  • postprocessor (dict) – Config of postprocessor for PANet. Defaults to dict(type=’PANPostprocessor’, text_repr_type=’poly’).

  • init_cfg (list[dict]) –

    Initialization configs. Defaults to [dict(type=’Normal’, mean=0, std=0.01, layer=’Conv2d’),

    dict(type=’Constant’, val=1, bias=0, layer=’BN’)]

Return type

None

forward(inputs, data_samples=None)[source]

PAN head forward. :param inputs: Each tensor has the shape of

\((N, C_i, W, H)\), where \(\sum_iC_i=C_{in}\) and \(C_{in}\) is input_channels.

Parameters
  • data_samples (list[TextDetDataSample], optional) – A list of data samples. Defaults to None.

  • inputs (list[Tensor] | Tensor) –

Returns

A tensor of shape \((N, C_{out}, W, H)\) where \(C_{out}\) is output_channels.

Return type

Tensor

Read the Docs v: dev-1.x
Versions
latest
stable
v1.0.1
v1.0.0
0.x
v0.6.3
v0.6.2
v0.6.1
v0.6.0
v0.5.0
v0.4.1
v0.4.0
v0.3.0
v0.2.1
v0.2.0
v0.1.0
dev-1.x
Downloads
pdf
html
epub
On Read the Docs
Project Home
Builds

Free document hosting provided by Read the Docs.