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"]
code: def __init__(
      self,
      model_dir,
      tracker_config=None,
      device="CPU",
      run_mode="paddle",
      batch_size=1,
      trt_min_shape=1,
      trt_max_shape=1088,
      trt_opt_shape=608,
      trt_calib_mode=False,
      cpu_threads=1,
      enable_mkldnn=False,
      output_dir="output",
      threshold=0.5,
      save_images=False,
      save_mot_txts=False,
  ):
      super(JDE_Detector, self).__init__(
          model_dir=model_dir,
          device=device,
          run_mode=run_mode,
          batch_size=batch_size,
          trt_min_shape=trt_min_shape,
          trt_max_shape=trt_max_shape,
          trt_opt_shape=trt_opt_shape,
          trt_calib_mode=trt_calib_mode,
          cpu_threads=cpu_threads,
          enable_mkldnn=enable_mkldnn,
          output_dir=output_dir,
          threshold=threshold,
      )
      self.save_images = save_images
      self.save_mot_txts = save_mot_txts
      assert batch_size == 1, "MOT model only supports batch_size=1."
      self.det_times = Timer(with_tracker=True)
      self.num_classes = len(self.pred_config.labels)
  
      # tracker config
      assert (
          self.pred_config.tracker
      ), "The exported JDE Detector model should have tracker."
      cfg = self.pred_config.tracker
      min_box_area = cfg.get("min_box_area", 0.0)
      vertical_ratio = cfg.get("vertical_ratio", 0.0)
      conf_thres = cfg.get("conf_thres", 0.0)
      tracked_thresh = cfg.get("tracked_thresh", 0.7)
      metric_type = cfg.get("metric_type", "euclidean")
  
      self.tracker = JDETracker(
          num_classes=self.num_classes,
          min_box_area=min_box_area,
          vertical_ratio=vertical_ratio,
          conf_thres=conf_thres,
          tracked_thresh=tracked_thresh,
          metric_type=metric_type,
      )
  
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 1 to create a new JDE_Detector object from inherited base classes: Detector with example: obj = JDE_Detector(model_dir, tracker_config, device, run_mode, batch_size, trt_min_shape, trt_max_shape, trt_opt_shape, trt_calib_mode, cpu_threads, enable_mkldnn, output_dir, threshold, save_images, save_mot_txts)