HybridEmbed¶
- class mmpretrain.models.utils.HybridEmbed(backbone, img_size=224, feature_size=None, in_channels=3, embed_dims=768, conv_cfg=None, init_cfg=None)[source]¶
CNN Feature Map Embedding.
Extract feature map from CNN, flatten, project to embedding dim.
- Parameters:
backbone (nn.Module) – CNN backbone
img_size (int | tuple) – The size of input image. Default: 224
feature_size (int | tuple, optional) – Size of feature map extracted by CNN backbone. Default: None
in_channels (int) – The num of input channels. Default: 3
embed_dims (int) – The dimensions of embedding. Default: 768
conv_cfg (dict, optional) – The config dict for conv layers. Default: None.
init_cfg (mmcv.ConfigDict, optional) – The Config for initialization. Default: None.