code: def onnx_inference(onnx_path: str, image: np.ndarray):
      # load onnx model
      ort_session = onnxruntime.InferenceSession(onnx_path)
  
      # compute onnx Runtime output prediction
      ort_inputs = {ort_session.get_inputs()[0].name: image}
      res_onnx = ort_session.run(None, ort_inputs)[0]
      return res_onnx
  
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 2 for calling a global function with example usage: onnx_inference(onnx_path, image) and returns: res_onnx