code: def main():
      image_h = 224
      image_w = 224
      onnx_path = "resnet34.onnx"
      trt_path = "trt_output/resnet34.trt"
  
      image = np.random.randn(image_h, image_w, 3)
      normalized_image = normalize(image)
  
      # Convert the resized images to network input shape
      # [h, w, c] -> [c, h, w] -> [1, c, h, w]
      normalized_image = np.expand_dims(
          np.transpose(normalized_image, (2, 0, 1)), 0
      )
  
      onnx_res = onnx_inference(onnx_path, normalized_image)
      ir_res = trt_inference(trt_path, normalized_image)
      np.testing.assert_allclose(
          onnx_res, ir_res, rtol=1e-03, atol=1e-05
      )
      print(
          "Exported model has been tested with TensorRT Runtime, and the result looks good!"
      )
  
file_path: deep-learning-for-image-processing/deploying_service/deploying_pytorch/convert_tensorrt/convert_resnet34/compare_onnx_and_trt.py
imports: import numpy
  import tensorrt
  import onnxruntime
  import pycuda.driver
  import pycuda.autoinit
label_desc: Use image node_id 4 for calling a global function with example usage: main() without return types