class_docstr: Args:
      model_dir (str): root path of model.pdiparams, model.pdmodel and infer_cfg.yml
      tracker_config (str): tracker config path
      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
      reid_model_dir (str): reid model dir, default None for ByteTrack, but set for DeepSORT
class_docstr_tok: ["Args",":","model_dir","(","str",")",":","root","path","of","model.pdiparams",",","model.pdmodel","and","infer_cfg.yml","tracker_config","(","str",")",":","tracker","config","path","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","reid_model_dir","(","str",")",":","reid","model","dir",",","default","None","for","ByteTrack",",","but","set","for","DeepSORT"]
code: def reidprocess(self, det_results, repeats=1):
      pred_dets = det_results["boxes"]
      pred_xyxys = pred_dets[:, 2:6]
  
      ori_image = det_results["ori_image"]
      ori_image_shape = ori_image.shape[:2]
      pred_xyxys, keep_idx = clip_box(pred_xyxys, ori_image_shape)
  
      if len(keep_idx[0]) == 0:
          det_results["boxes"] = np.zeros((1, 6), dtype=np.float32)
          det_results["embeddings"] = None
          return det_results
  
      pred_dets = pred_dets[keep_idx[0]]
      pred_xyxys = pred_dets[:, 2:6]
  
      w, h = self.tracker.input_size
      crops = get_crops(pred_xyxys, ori_image, w, h)
  
      # to keep fast speed, only use topk crops
      crops = crops[:50]  # reid_batch_size
      det_results["crops"] = np.array(crops).astype("float32")
      det_results["boxes"] = pred_dets[:50]
  
      input_names = self.reid_predictor.get_input_names()
      for i in range(len(input_names)):
          input_tensor = self.reid_predictor.get_input_handle(
              input_names[i]
          )
          input_tensor.copy_from_cpu(det_results[input_names[i]])
  
      # model prediction
      for i in range(repeats):
          self.reid_predictor.run()
          output_names = self.reid_predictor.get_output_names()
          feature_tensor = self.reid_predictor.get_output_handle(
              output_names[0]
          )
          pred_embs = feature_tensor.copy_to_cpu()
  
      det_results["embeddings"] = pred_embs
      return det_results
  
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, load_predictor
  import sys
  from pptracking.python.mot import JDETracker, DeepSORTTracker
  from pptracking.python.mot.utils import MOTTimer, write_mot_results, get_crops, clip_box
  from pptracking.python.mot.visualize import plot_tracking, plot_tracking_dict
label_desc: Use image node_id 3 for calling the SDE_Detector obj's underlying member method code with example usage: obj.reidprocess(det_results, repeats) and returns: det_results, det_results