code: def fcn_resnet50(aux, num_classes=21, pretrain_backbone=False):
      # 'resnet50_imagenet': 'https://download.pytorch.org/models/resnet50-0676ba61.pth'
      # 'fcn_resnet50_coco': 'https://download.pytorch.org/models/fcn_resnet50_coco-1167a1af.pth'
      backbone = resnet50(
          replace_stride_with_dilation=[False, True, True]
      )
  
      if pretrain_backbone:
          # 载入resnet50 backbone预训练权重
          backbone.load_state_dict(
              torch.load("resnet50.pth", map_location="cpu")
          )
  
      out_inplanes = 2048
      aux_inplanes = 1024
  
      return_layers = {"layer4": "out"}
      if aux:
          return_layers["layer3"] = "aux"
      backbone = IntermediateLayerGetter(
          backbone, return_layers=return_layers
      )
  
      aux_classifier = None
      # why using aux: https://github.com/pytorch/vision/issues/4292
      if aux:
          aux_classifier = FCNHead(aux_inplanes, num_classes)
  
      classifier = FCNHead(out_inplanes, num_classes)
  
      model = FCN(backbone, classifier, aux_classifier)
  
      return model
  
file_path: deep-learning-for-image-processing/pytorch_segmentation/fcn/src/fcn_model.py
imports: from collections import OrderedDict
  from typing import Dict
  import torch
  from torch import nn, Tensor
  from torch.nn import functional
  from .backbone import resnet50, resnet101
label_desc: Use image node_id 1 for calling a global function with example usage: fcn_resnet50(aux, num_classes, pretrain_backbone) and returns: model