ChannelReductionEncoder¶
- class mmocr.models.textrecog.ChannelReductionEncoder(in_channels, out_channels, init_cfg={'layer': 'Conv2d', 'type': 'Xavier'})[源代码]¶
Change the channel number with a one by one convoluational layer.
- 参数
- 返回类型
- forward(feat, data_samples=None)[源代码]¶
- 参数
feat (Tensor) – Image features with the shape of \((N, C_{in}, H, W)\).
data_samples (list[TextRecogDataSample], optional) – Batch of TextRecogDataSample, containing valid_ratio information. Defaults to None.
- 返回
A tensor of shape \((N, C_{out}, H, W)\).
- 返回类型
Tensor