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"]
code: def __init__(
      self,
      model_dir,
      device="CPU",
      run_mode="paddle",
      batch_size=1,
      trt_min_shape=1,
      trt_max_shape=1280,
      trt_opt_shape=640,
      trt_calib_mode=False,
      cpu_threads=1,
      enable_mkldnn=False,
      output_dir="output",
      threshold=0.5,
      use_dark=True,
  ):
      super(KeyPointDetector, 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.use_dark = use_dark
  
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 1 to create a new KeyPointDetector object from inherited base classes: Detector with example: obj = KeyPointDetector(model_dir, device, run_mode, batch_size, trt_min_shape, trt_max_shape, trt_opt_shape, trt_calib_mode, cpu_threads, enable_mkldnn, output_dir, threshold, use_dark)