FCEHead¶
- class mmocr.models.textdet.FCEHead(in_channels, fourier_degree=5, module_loss={'num_sample': 50, 'type': 'FCEModuleLoss'}, postprocessor={'alpha': 1.0, 'beta': 2.0, 'num_reconstr_points': 50, 'score_thr': 0.3, 'text_repr_type': 'poly', 'type': 'FCEPostprocessor'}, init_cfg={'mean': 0, 'override': [{'name': 'out_conv_cls'}, {'name': 'out_conv_reg'}], 'std': 0.01, 'type': 'Normal'})[source]¶
The class for implementing FCENet head.
FCENet(CVPR2021): Fourier Contour Embedding for Arbitrary-shaped Text Detection
- Parameters
in_channels (int) – The number of input channels.
fourier_degree (int) – The maximum Fourier transform degree k. Defaults to 5.
module_loss (dict) – Config of loss for FCENet. Defaults to
dict(type='FCEModuleLoss', num_sample=50)
.postprocessor (dict) – Config of postprocessor for FCENet.
init_cfg (dict, optional) – Initialization configs.
- Return type
- forward(inputs, data_samples=None)[source]¶
- Parameters
inputs (List[Tensor]) – Each tensor has the shape of \((N, C_i, H_i, W_i)\).
data_samples (list[TextDetDataSample], optional) – A list of data samples. Defaults to None.
- Returns
A list of dict with keys of
cls_res
,reg_res
corresponds to the classification result and regression result computed from the input tensor with the same index. They have the shapes of \((N, C_{cls,i}, H_i, W_i)\) and \((N, C_{out,i}, H_i, W_i)\).- Return type
- forward_single(x)[source]¶
Forward function for a single feature level.
- Parameters
x (Tensor) – The input tensor with the shape of \((N, C_i, H_i, W_i)\).
- Returns
The classification and regression result with the shape of \((N, C_{cls,i}, H_i, W_i)\) and \((N, C_{out,i}, H_i, W_i)\).
- Return type
Tensor