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, 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
      use_dark(bool): whether to use postprocess in DarkPose
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",",","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","use_dark","(","bool",")",":","whether","to","use","postprocess","in","DarkPose"]
docstr: Args:
      repeats (int): repeat number for prediction
  Returns:
      results (dict): include 'boxes': np.ndarray: shape:[N,6], N: number of box,
                      matix element:[class, score, x_min, y_min, x_max, y_max]
                      MaskRCNN's results include 'masks': np.ndarray:
                      shape: [N, im_h, im_w]
docstr_tok: ["Args",":","repeats","(","int",")",":","repeat","number","for","prediction","Returns",":","results","(","dict",")",":","include","'boxes","'",":","np.ndarray",":","shape",":","[","N,6","]",",","N",":","number","of","box",",","matix","element",":","[","class",",","score",",","x_min",",","y_min",",","x_max",",","y_max","]","MaskRCNN","'s","results","include","'masks","'",":","np.ndarray",":","shape",":","[","N",",","im_h",",","im_w","]"]
code: def predict(self, repeats=1):
      """
      Args:
          repeats (int): repeat number for prediction
      Returns:
          results (dict): include 'boxes': np.ndarray: shape:[N,6], N: number of box,
                          matix element:[class, score, x_min, y_min, x_max, y_max]
                          MaskRCNN's results include 'masks': np.ndarray:
                          shape: [N, im_h, im_w]
      """
      # model prediction
      np_heatmap, np_masks = None, None
      for i in range(repeats):
          self.predictor.run()
          output_names = self.predictor.get_output_names()
          heatmap_tensor = self.predictor.get_output_handle(
              output_names[0]
          )
          np_heatmap = heatmap_tensor.copy_to_cpu()
          if self.pred_config.tagmap:
              masks_tensor = self.predictor.get_output_handle(
                  output_names[1]
              )
              heat_k = self.predictor.get_output_handle(output_names[2])
              inds_k = self.predictor.get_output_handle(output_names[3])
              np_masks = [
                  masks_tensor.copy_to_cpu(),
                  heat_k.copy_to_cpu(),
                  inds_k.copy_to_cpu(),
              ]
      result = dict(heatmap=np_heatmap, masks=np_masks)
      return result
  
imports: import math
  import os
  import cv2
  import numpy
  import yaml
  from .infer import Detector
  from .keypoint_postprocess import HRNetPostProcess
  from .keypoint_preprocess import expand_crop
  from .visualize import visualize_pose
label_desc: Use image node_id 5 for calling the KeyPointDetector obj's underlying member method code with example usage: obj.predict(repeats) and returns: result