class_docstr: Args:
      model_dir (str): root path of model.pdiparams, model.pdmodel and infer_cfg.yml
      device (str): Choose the device you want to run, it can be: CPU/GPU/XPU/NPU, default is CPU
      run_mode (str): mode of running(paddle/trt_fp32/trt_fp16)
      batch_size (int): size of pre batch in inference
      trt_min_shape (int): min shape for dynamic shape in trt
      trt_max_shape (int): max shape for dynamic shape in trt
      trt_opt_shape (int): opt shape for dynamic shape in trt
      trt_calib_mode (bool): If the model is produced by TRT offline quantitative
          calibration, trt_calib_mode need to set True
      cpu_threads (int): cpu threads
      enable_mkldnn (bool): whether to open MKLDNN
      output_dir (string): The path of output, default as 'output'
      threshold (float): Score threshold of the detected bbox, default as 0.5
      save_images (bool): Whether to save visualization image results, default as False
      save_mot_txts (bool): Whether to save tracking results (txt), default as False
class_docstr_tok: ["Args",":","model_dir","(","str",")",":","root","path","of","model.pdiparams",",","model.pdmodel","and","infer_cfg.yml","device","(","str",")",":","Choose","the","device","you","want","to","run",",","it","can","be",":","CPU\/GPU\/XPU\/NPU",",","default","is","CPU","run_mode","(","str",")",":","mode","of","running","(","paddle\/trt_fp32\/trt_fp16",")","batch_size","(","int",")",":","size","of","pre","batch","in","inference","trt_min_shape","(","int",")",":","min","shape","for","dynamic","shape","in","trt","trt_max_shape","(","int",")",":","max","shape","for","dynamic","shape","in","trt","trt_opt_shape","(","int",")",":","opt","shape","for","dynamic","shape","in","trt","trt_calib_mode","(","bool",")",":","If","the","model","is","produced","by","TRT","offline","quantitative","calibration",",","trt_calib_mode","need","to","set","True","cpu_threads","(","int",")",":","cpu","threads","enable_mkldnn","(","bool",")",":","whether","to","open","MKLDNN","output_dir","(","string",")",":","The","path","of","output",",","default","as","'output'","threshold","(","float",")",":","Score","threshold","of","the","detected","bbox",",","default","as","0.5","save_images","(","bool",")",":","Whether","to","save","visualization","image","results",",","default","as","False","save_mot_txts","(","bool",")",":","Whether","to","save","tracking","results","(","txt",")",",","default","as","False"]
docstr: Args:
      repeats (int): repeats number for prediction
  Returns:
      result (dict): include 'pred_dets': np.ndarray: shape:[N,6], N: number of box,
                      matix element:[class, score, x_min, y_min, x_max, y_max]
                      FairMOT(JDE)'s result include 'pred_embs': np.ndarray:
                      shape: [N, 128]
docstr_tok: ["Args",":","repeats","(","int",")",":","repeats","number","for","prediction","Returns",":","result","(","dict",")",":","include","'pred_dets","'",":","np.ndarray",":","shape",":","[","N,6","]",",","N",":","number","of","box",",","matix","element",":","[","class",",","score",",","x_min",",","y_min",",","x_max",",","y_max","]","FairMOT","(","JDE",")","'s","result","include","'pred_embs","'",":","np.ndarray",":","shape",":","[","N",",","128","]"]
code: def predict(self, repeats=1):
      """
      Args:
          repeats (int): repeats number for prediction
      Returns:
          result (dict): include 'pred_dets': np.ndarray: shape:[N,6], N: number of box,
                          matix element:[class, score, x_min, y_min, x_max, y_max]
                          FairMOT(JDE)'s result include 'pred_embs': np.ndarray:
                          shape: [N, 128]
      """
      # model prediction
      np_pred_dets, np_pred_embs = None, None
      for i in range(repeats):
          self.predictor.run()
          output_names = self.predictor.get_output_names()
          boxes_tensor = self.predictor.get_output_handle(
              output_names[0]
          )
          np_pred_dets = boxes_tensor.copy_to_cpu()
          embs_tensor = self.predictor.get_output_handle(
              output_names[1]
          )
          np_pred_embs = embs_tensor.copy_to_cpu()
  
      result = dict(pred_dets=np_pred_dets, pred_embs=np_pred_embs)
      return result
  
imports: import os
  import time
  import yaml
  import cv2
  import numpy
  from collections import defaultdict
  import paddle
  from benchmark_utils import PaddleInferBenchmark
  from preprocess import decode_image
  from utils import argsparser, Timer, get_current_memory_mb
  from infer import Detector, get_test_images, print_arguments, bench_log, PredictConfig
  import sys
  from pptracking.python.mot import JDETracker
  from pptracking.python.mot.utils import MOTTimer, write_mot_results
  from pptracking.python.mot.visualize import plot_tracking_dict
label_desc: Use image node_id 4 for calling the JDE_Detector obj's underlying member method code with example usage: obj.predict(repeats) and returns: result