code: def generate_jit_model(index):
      model_funcs = [
          torchvision.models.detection.fasterrcnn_resnet50_fpn,
          torchvision.models.detection.maskrcnn_resnet50_fpn,
      ]
  
      model_func = model_funcs[index]
      model = TraceWrapper(
          model_func(pretrained=True, rpn_pre_nms_top_n_test=1000)
      )
  
      model.eval()
      inp = torch.Tensor(
          np.random.uniform(0.0, 250.0, size=(1, 3, in_size, in_size))
      )
  
      with torch.no_grad():
          out = model(inp)
  
          script_module = do_trace(model, inp)
          script_out = script_module(inp)
  
          assert len(out[0]) > 0 and len(script_out[0]) > 0
          return script_module
  
file_path: tvm/tests/python/frontend/pytorch/test_object_detection.py
imports: import numpy
  import cv2
  import torch
  import torchvision
  import tvm
  import tvm.testing
  from tvm import relay
  from tvm.runtime.vm import VirtualMachine
  from tvm.relay.frontend.pytorch_utils import rewrite_nms_to_batched_nms, rewrite_batched_nms_with_max_out_size, rewrite_scatter_to_gather
  from tvm.contrib.download import download
label_desc: Use image node_id 4 for calling a global function with example usage: generate_jit_model(index) and returns: script_module