code: def run(FLAGS, cfg):
      # build Tracker
      tracker = Tracker(cfg, mode="test")
  
      # load weights
      if cfg.architecture in ["DeepSORT", "ByteTrack"]:
          tracker.load_weights_sde(cfg.det_weights, cfg.reid_weights)
      else:
          tracker.load_weights_jde(cfg.weights)
  
      # inference
      tracker.mot_predict_seq(
          video_file=FLAGS.video_file,
          frame_rate=FLAGS.frame_rate,
          image_dir=FLAGS.image_dir,
          data_type=cfg.metric.lower(),
          model_type=cfg.architecture,
          output_dir=FLAGS.output_dir,
          save_images=FLAGS.save_images,
          save_videos=FLAGS.save_videos,
          show_image=FLAGS.show_image,
          scaled=FLAGS.scaled,
          det_results_dir=FLAGS.det_results_dir,
          draw_threshold=FLAGS.draw_threshold,
      )
  
file_path: PaddleDetection/tools/infer_mot.py
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import os
  import sys
  import warnings
  import paddle
  from ppdet.core.workspace import load_config, merge_config
  from ppdet.engine import Tracker
  from ppdet.utils.check import check_gpu, check_npu, check_xpu, check_mlu, check_version, check_config
  from ppdet.utils.cli import ArgsParser
label_desc: Use image node_id 2 for calling a global function with example usage: run(FLAGS, cfg) without return types