FPEM_FFM¶
- class mmocr.models.textdet.FPEM_FFM(in_channels, conv_out=128, fpem_repeat=2, align_corners=False, init_cfg={'distribution': 'uniform', 'layer': 'Conv2d', 'type': 'Xavier'})[source]¶
This code is from https://github.com/WenmuZhou/PAN.pytorch.
- Parameters
in_channels (list[int]) – A list of 4 numbers of input channels.
conv_out (int) – Number of output channels.
fpem_repeat (int) – Number of FPEM layers before FFM operations.
align_corners (bool) – The interpolation behaviour in FFM operation, used in
torch.nn.functional.interpolate()
.init_cfg (dict or list[dict], optional) – Initialization configs.
- Return type
- forward(x)[source]¶
- Parameters
x (list[Tensor]) – A list of four tensors of shape \((N, C_i, H_i, W_i)\), representing C2, C3, C4, C5 features respectively. \(C_i\) should matches the number in
in_channels
.- Returns
Four tensors of shape \((N, C_{out}, H_0, W_0)\) where \(C_{out}\) is
conv_out
.- Return type
tuple[Tensor]