code: def __init__(self, base_channel: int = 32, num_joints: int = 17):
      super().__init__()
      # Stem
      self.conv1 = nn.Conv2d(
          3, 64, kernel_size=3, stride=2, padding=1, bias=False
      )
      self.bn1 = nn.BatchNorm2d(64, momentum=BN_MOMENTUM)
      self.conv2 = nn.Conv2d(
          64, 64, kernel_size=3, stride=2, padding=1, bias=False
      )
      self.bn2 = nn.BatchNorm2d(64, momentum=BN_MOMENTUM)
      self.relu = nn.ReLU(inplace=True)
  
      # Stage1
      downsample = nn.Sequential(
          nn.Conv2d(64, 256, kernel_size=1, stride=1, bias=False),
          nn.BatchNorm2d(256, momentum=BN_MOMENTUM),
      )
      self.layer1 = nn.Sequential(
          Bottleneck(64, 64, downsample=downsample),
          Bottleneck(256, 64),
          Bottleneck(256, 64),
          Bottleneck(256, 64),
      )
  
      self.transition1 = nn.ModuleList(
          [
              nn.Sequential(
                  nn.Conv2d(
                      256,
                      base_channel,
                      kernel_size=3,
                      stride=1,
                      padding=1,
                      bias=False,
                  ),
                  nn.BatchNorm2d(base_channel, momentum=BN_MOMENTUM),
                  nn.ReLU(inplace=True),
              ),
              nn.Sequential(
                  nn.Sequential(  # 这里又使用一次Sequential是为了适配原项目中提供的权重
                      nn.Conv2d(
                          256,
                          base_channel * 2,
                          kernel_size=3,
                          stride=2,
                          padding=1,
                          bias=False,
                      ),
                      nn.BatchNorm2d(
                          base_channel * 2, momentum=BN_MOMENTUM
                      ),
                      nn.ReLU(inplace=True),
                  )
              ),
          ]
      )
  
      # Stage2
      self.stage2 = nn.Sequential(
          StageModule(
              input_branches=2, output_branches=2, c=base_channel
          )
      )
  
      # transition2
      self.transition2 = nn.ModuleList(
          [
              nn.Identity(),  # None,  - Used in place of "None" because it is callable
              nn.Identity(),  # None,  - Used in place of "None" because it is callable
              nn.Sequential(
                  nn.Sequential(
                      nn.Conv2d(
                          base_channel * 2,
                          base_channel * 4,
                          kernel_size=3,
                          stride=2,
                          padding=1,
                          bias=False,
                      ),
                      nn.BatchNorm2d(
                          base_channel * 4, momentum=BN_MOMENTUM
                      ),
                      nn.ReLU(inplace=True),
                  )
              ),
          ]
      )
  
      # Stage3
      self.stage3 = nn.Sequential(
          StageModule(
              input_branches=3, output_branches=3, c=base_channel
          ),
          StageModule(
              input_branches=3, output_branches=3, c=base_channel
          ),
          StageModule(
              input_branches=3, output_branches=3, c=base_channel
          ),
          StageModule(
              input_branches=3, output_branches=3, c=base_channel
          ),
      )
  
      # transition3
      self.transition3 = nn.ModuleList(
          [
              nn.Identity(),  # None,  - Used in place of "None" because it is callable
              nn.Identity(),  # None,  - Used in place of "None" because it is callable
              nn.Identity(),  # None,  - Used in place of "None" because it is callable
              nn.Sequential(
                  nn.Sequential(
                      nn.Conv2d(
                          base_channel * 4,
                          base_channel * 8,
                          kernel_size=3,
                          stride=2,
                          padding=1,
                          bias=False,
                      ),
                      nn.BatchNorm2d(
                          base_channel * 8, momentum=BN_MOMENTUM
                      ),
                      nn.ReLU(inplace=True),
                  )
              ),
          ]
      )
  
      # Stage4
      # 注意，最后一个StageModule只输出分辨率最高的特征层
      self.stage4 = nn.Sequential(
          StageModule(
              input_branches=4, output_branches=4, c=base_channel
          ),
          StageModule(
              input_branches=4, output_branches=4, c=base_channel
          ),
          StageModule(
              input_branches=4, output_branches=1, c=base_channel
          ),
      )
  
      # Final layer
      self.final_layer = nn.Conv2d(
          base_channel, num_joints, kernel_size=1, stride=1
      )
  
file_path: deep-learning-for-image-processing/pytorch_keypoint/HRNet/model/hrnet.py
imports: import torch.nn
label_desc: Use image node_id 1 to create a new HighResolutionNet object from inherited base classes: nn with example: obj = HighResolutionNet(base_channel, num_joints)