Shortcuts

Note

You are reading the documentation for MMClassification 0.x, which will soon be deprecated at the end of 2022. We recommend you upgrade to MMClassification 1.0 to enjoy fruitful new features and better performance brought by OpenMMLab 2.0. Check the installation tutorial, migration tutorial and changelog for more details.

TIMMBackbone

class mmcls.models.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.

forward(x)[source]

Forward computation.

Parameters

x (tensor | tuple[tensor]) – x could be a Torch.tensor or a tuple of Torch.tensor, containing input data for forward computation.

Read the Docs v: master
Versions
master
latest
1.x
dev-1.x
Downloads
html
epub
On Read the Docs
Project Home
Builds

Free document hosting provided by Read the Docs.