code: def inference(video_frames, tracker, opt):
      """
      Predict with a SiamRPN and make inference
      --------------------
  
      this function returns a dictionaries result. which has two keys. one is bbox,
      which represents the coordinates of the predicted frame,
      the other is best_score, which records everyframe best_score.
      Save output in current path
      """
      scores = []
      pred_bboxes = []
      gt_bbox = list(map(int, opt.gt_bbox))
      if not os.path.exists(opt.save_dir):
          os.makedirs(opt.save_dir)
      for ind, frame in enumerate(video_frames):
          if ind == 0:
              cx, cy, w, h = get_axis_aligned_bbox(np.array(gt_bbox))
              gt_bbox_ = [cx - (w - 1) / 2, cy - (h - 1) / 2, w, h]
              tracker.init(frame, gt_bbox_, ctx=mx.cpu())
              pred_bbox = gt_bbox_
              scores.append(None)
              pred_bboxes.append(pred_bbox)
          else:
              outputs = tracker.track(frame, ctx=mx.cpu())
              pred_bbox = outputs["bbox"]
              pred_bboxes.append(pred_bbox)
              scores.append(outputs["best_score"])
          pred_bbox = list(map(int, pred_bbox))
          cv2.rectangle(
              frame,
              (pred_bbox[0], pred_bbox[1]),
              (
                  pred_bbox[0] + pred_bbox[2],
                  pred_bbox[1] + pred_bbox[3],
              ),
              (0, 255, 255),
              3,
          )
          cv2.imwrite(
              os.path.join(opt.save_dir, "%04d.jpg" % (ind + 1)), frame
          )
  
file_path: gluon-cv/scripts/tracking/siamrpn/demo.py
imports: import os
  import argparse
  import matplotlib.pyplot
  import numpy
  import mxnet
  from gluoncv import model_zoo, utils
  from gluoncv.model_zoo.siamrpn.siamrpn_tracker import SiamRPNTracker
  from gluoncv.model_zoo.siamrpn.siamrpn_tracker import get_axis_aligned_bbox
  from gluoncv.utils.filesystem import try_import_cv2
label_desc: Use image node_id 3 for calling a global function with example usage: inference(video_frames, tracker, opt) without return types