code: def main():
      """SiamRPN benchmark.
      evaluation according to txt of test result.now supports benchmark is Success and Precision
      Currently only supports test OTB 2015 dataset.
  
      Parameters
      ----------
      tracker_path : str, txt of test result path.
      tracker_prefix : str, model name.
      test_dataset : str, Path to test label json.
      """
      opt = parse_args()
      tracker_dir = os.path.join(opt.tracker_path, opt.dataset)
      trackers = glob(
          os.path.join(
              opt.tracker_path, opt.dataset, opt.tracker_prefix + "*"
          )
      )
      trackers = [x.split("/")[-1] for x in trackers]
      assert len(trackers) > 0
      opt.num = min(opt.num, len(trackers))
      dataset = OTBDataset(
          name=opt.dataset,
          dataset_root=opt.test_dataset,
          load_img=False,
      )
      dataset.set_tracker(tracker_dir, trackers)
      benchmark = OPEBenchmark(dataset)
      success_ret = {}
      with Pool(processes=opt.num) as pool:
          for ret in tqdm(
              pool.imap_unordered(benchmark.eval_success, trackers),
              desc="eval success",
              total=len(trackers),
              ncols=100,
          ):
              success_ret.update(ret)
      precision_ret = {}
      with Pool(processes=opt.num) as pool:
          for ret in tqdm(
              pool.imap_unordered(benchmark.eval_precision, trackers),
              desc="eval precision",
              total=len(trackers),
              ncols=100,
          ):
              precision_ret.update(ret)
      benchmark.show_result(
          success_ret,
          precision_ret,
          show_video_level=opt.show_video_level,
      )
  
file_path: gluon-cv/scripts/tracking/siamrpn/benchmark.py
imports: from glob import glob
  import argparse
  import os
  from multiprocessing import Pool
  from tqdm import tqdm
  from gluoncv.utils.metrics.tracking import OPEBenchmark
  from gluoncv.data.otb.tracking import OTBTracking
label_desc: Use image node_id 2 for calling a global function with example usage: main() without return types