ChannelReductionEncoder¶
- class mmocr.models.textrecog.ChannelReductionEncoder(in_channels, out_channels, init_cfg={'layer': 'Conv2d', 'type': 'Xavier'})[source]¶
Change the channel number with a one by one convoluational layer.
- Parameters
- Return type
- forward(feat, data_samples=None)[source]¶
- Parameters
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.
- Returns
A tensor of shape \((N, C_{out}, H, W)\).
- Return type
Tensor