Shortcuts

TIMMBackbone

class mmpretrain.models.backbones.TIMMBackbone(model_name, features_only=False, pretrained=False, checkpoint_path='', in_channels=3, init_cfg=None, **kwargs)[source]

Wrapper to use backbones from timm library.

More details can be found in timm. See especially the document for feature extraction.

Parameters:
  • model_name (str) – Name of timm model to instantiate.

  • features_only (bool) – Whether to extract feature pyramid (multi-scale feature maps from the deepest layer at each stride). For Vision Transformer models that do not support this argument, set this False. Defaults to False.

  • pretrained (bool) – Whether to load pretrained weights. Defaults to False.

  • checkpoint_path (str) – Path of checkpoint to load at the last of timm.create_model. Defaults to empty string, which means not loading.

  • in_channels (int) – Number of input image channels. Defaults to 3.

  • init_cfg (dict or list[dict], optional) – Initialization config dict of OpenMMLab projects. Defaults to None.

  • **kwargs – Other timm & model specific arguments.