code: def create_model(num_classes):
      res50 = resnet50()
      backbone = create_feature_extractor(
          res50, return_nodes={"layer3": "0"}
      )
      backbone.out_channels = 1024
  
      anchor_generator = AnchorsGenerator(
          sizes=((32, 64, 128, 256, 512),),
          aspect_ratios=((0.5, 1.0, 2.0),),
      )
  
      roi_pooler = torchvision.ops.MultiScaleRoIAlign(
          featmap_names=["0"],  # 在哪些特征层上进行roi pooling
          output_size=[7, 7],  # roi_pooling输出特征矩阵尺寸
          sampling_ratio=2,
      )  # 采样率
  
      model = FasterRCNN(
          backbone=backbone,
          num_classes=num_classes,
          rpn_anchor_generator=anchor_generator,
          box_roi_pool=roi_pooler,
      )
  
      return model
  
file_path: deep-learning-for-image-processing/pytorch_object_detection/train_coco_dataset/predict.py
imports: import os
  import time
  import json
  import torch
  import torchvision
  from PIL import Image
  import matplotlib.pyplot
  from torchvision import transforms
  from torchvision.models.feature_extraction import create_feature_extractor
  from network_files import FasterRCNN, AnchorsGenerator
  from backbone import vgg, MobileNetV2, resnet50
  from draw_box_utils import draw_objs
label_desc: Use image node_id 1 for calling a global function with example usage: create_model(num_classes) and returns: model