build_backbone

lightning_pose.models.backbones.torchvision.build_backbone(backbone_arch: Literal['resnet18', 'resnet34', 'resnet50', 'resnet101', 'resnet152', 'resnet50_contrastive', 'resnet50_animal_apose', 'resnet50_animal_ap10k', 'resnet50_human_jhmdb', 'resnet50_human_res_rle', 'resnet50_human_top_res', 'resnet50_human_hand', 'efficientnet_b0', 'efficientnet_b1', 'efficientnet_b2', 'vit_b_sam'], pretrained: bool = True, model_type: str = 'heatmap', **kwargs) Tuple[source]

Load backbone weights for resnets, efficientnets, and other models from torchvision.

Parameters:
  • backbone_arch – which backbone version/weights to use

  • pretrained – True to load weights pretrained on imagenet

  • model_type – “heatmap” or “regression”

Returns:

tuple
  • backbone: pytorch model

  • num_fc_input_features (int): number of input features to fully connected layer