code: def create_model(num_joints, load_pretrain_weights=True):
      model = HighResolutionNet(base_channel=32, num_joints=num_joints)
  
      if load_pretrain_weights:
          # 载入预训练模型权重
          # 链接:https://pan.baidu.com/s/1Lu6mMAWfm_8GGykttFMpVw 提取码:f43o
          weights_dict = torch.load(
              "./hrnet_w32.pth", map_location="cpu"
          )
  
          for k in list(weights_dict.keys()):
              # 如果载入的是imagenet权重，就删除无用权重
              if ("head" in k) or ("fc" in k):
                  del weights_dict[k]
  
              # 如果载入的是coco权重，对比下num_joints，如果不相等就删除
              if "final_layer" in k:
                  if weights_dict[k].shape[0] != num_joints:
                      del weights_dict[k]
  
          missing_keys, unexpected_keys = model.load_state_dict(
              weights_dict, strict=False
          )
          if len(missing_keys) != 0:
              print("missing_keys: ", missing_keys)
  
      return model
  
file_path: deep-learning-for-image-processing/pytorch_keypoint/HRNet/train.py
imports: import json
  import os
  import datetime
  import torch
  from torch.utils import data
  import numpy
  import transforms
  from model import HighResolutionNet
  from my_dataset_coco import CocoKeypoint
  from train_utils import train_eval_utils
label_desc: Use image node_id 1 for calling a global function with example usage: create_model(num_joints, load_pretrain_weights) and returns: model