code: def load_infer(args):
      # Load the ONNX model and infer it by TRT
  
      input_shape = [1, 3, args.height, args.width]
      print("input shape:", input_shape)
      input_data = np.random.random(input_shape).astype("float32")
  
      # 1. check and run onnx
      onnx_model_path = args.onnx_model_path
      onnx_out = check_and_run_onnx(onnx_model_path, input_data)
      print("output shape:", onnx_out.shape, "\n")
  
      # 2. run and check trt
      assert args.trt_version in (5, 7), "trt_version should be 5 or 7"
      if args.trt_version == 5:
          trt_out, latency = TRTPredictorV2().trt5_run(
              args, onnx_model_path, input_data
          )
      elif args.trt_version == 7:
          trt_out, latency = TRTPredictorV2().trt7_run(
              args, onnx_model_path, input_data
          )
      print("trt avg latency: {:.3f} ms".format(latency))
  
      trt_out = trt_out.reshape(onnx_out.shape)
      np.testing.assert_allclose(trt_out, onnx_out, rtol=0, atol=1e-03)
      print("The onnx and trt models have the same outputs.\n")
  
imports: import argparse
  import os
  import time
  import numpy
  import paddle
  import tensorrt
  import pycuda.driver
  import pycuda.autoinit
  import onnx
  import onnxruntime
  from paddleseg.cvlibs import Config, SegBuilder
  from paddleseg.utils import logger, utils
label_desc: Use image node_id 5 for calling a global function with example usage: load_infer(args) without return types