code: def test_action_recognition(model):
      onnx_session = rt.InferenceSession(model.onnx_model, None)
      input_name = onnx_session.get_inputs()[0].name
  
      if not model.is_3D():
          test_img_file = os.path.join("test_imgs", "ThrowDiscus.png")
          img = mx.image.imread(test_img_file)
          img, _ = mx.image.center_crop(
              img, size=(model.input_shape[1], model.input_shape[2])
          )
          img = img.expand_dims(0).astype("float32")
  
          gluon_result = model.predict(img)
          onnx_result = onnx_session.run(
              [], {input_name: img.asnumpy()}
          )[0]
          assert_almost_equal(
              gluon_result.asnumpy(), onnx_result, decimal=3
          )
      else:
          from gluoncv.utils.filesystem import try_import_decord
  
          decord = try_import_decord()
          video_fname = os.path.join(
              "test_videos", "abseiling_k400.mp4"
          )
          vr = decord.VideoReader(video_fname)
          frame_id_list = None
          if "slowfast" in model.model_name:
              fast_frame_id_list = range(0, 64, 2)
              slow_frame_id_list = (
                  range(0, 64, 16)
                  if "4x16" in model.model_name
                  else range(0, 64, 8)
              )
              frame_id_list = list(fast_frame_id_list) + list(
                  slow_frame_id_list
              )
          else:
              frame_id_list = list(range(0, 64, 2))
          num_frames = len(frame_id_list)
          video_data = vr.get_batch(frame_id_list).asnumpy()
          clip_input = [
              video_data[vid, :, :, :]
              for vid, _ in enumerate(frame_id_list)
          ]
          transform_fn = video.VideoGroupValTransform(
              size=model.input_shape[3],
              mean=[0.485, 0.456, 0.406],
              std=[0.229, 0.224, 0.225],
          )
          clip_input = transform_fn(clip_input)
          clip_input = np.stack(clip_input, axis=0)
          clip_input = clip_input.reshape(
              (-1,)
              + (
                  num_frames,
                  3,
                  model.input_shape[3],
                  model.input_shape[4],
              )
          )
          clip_input = np.transpose(clip_input, (0, 2, 1, 3, 4))
  
          gluon_result = model.predict(nd.array(clip_input)).asnumpy()
          onnx_result = onnx_session.run(
              [], {input_name: clip_input.astype("float32")}
          )[0]
          assert_almost_equal(gluon_result, onnx_result, decimal=3)
  
file_path: gluon-cv/tests/onnx/test_inference.py
label_desc: Use image node_id 6 for calling a global function with example usage: test_action_recognition(model) without return types