docstr: Construct PaddleInferBenchmark Class to format logs.
  args:
      config(paddle.inference.Config): paddle inference config
      model_info(dict): basic model info
          {'model_name': 'resnet50'
           'precision': 'fp32'}
      data_info(dict): input data info
          {'batch_size': 1
           'shape': '3,224,224'
           'data_num': 1000}
      perf_info(dict): performance result
          {'preprocess_time_s': 1.0
          'inference_time_s': 2.0
          'postprocess_time_s': 1.0
          'total_time_s': 4.0}
      resource_info(dict): 
          cpu and gpu resources
          {'cpu_rss': 100
           'gpu_rss': 100
           'gpu_util': 60}
docstr_tok: ["Construct","PaddleInferBenchmark","Class","to","format","logs",".","args",":","config","(","paddle.inference.Config",")",":","paddle","inference","config","model_info","(","dict",")",":","basic","model","info","{","'model_name","'",":","'resnet50'","'precision","'",":","'fp32","'","}","data_info","(","dict",")",":","input","data","info","{","'batch_size","'",":","1","'shape","'",":","'","3,224,224'","'data_num","'",":","1000","}","perf_info","(","dict",")",":","performance","result","{","'preprocess_time_s","'",":","1.0","'inference_time_s","'",":","2.0","'postprocess_time_s","'",":","1.0","'total_time_s","'",":","4.0","}","resource_info","(","dict",")",":","cpu","and","gpu","resources","{","'cpu_rss","'",":","100","'gpu_rss","'",":","100","'gpu_util","'",":","60","}"]
code: def __init__(
      self,
      config,
      model_info: dict = {},
      data_info: dict = {},
      perf_info: dict = {},
      resource_info: dict = {},
      **kwargs,
  ):
      """
      Construct PaddleInferBenchmark Class to format logs.
      args:
          config(paddle.inference.Config): paddle inference config
          model_info(dict): basic model info
              {'model_name': 'resnet50'
               'precision': 'fp32'}
          data_info(dict): input data info
              {'batch_size': 1
               'shape': '3,224,224'
               'data_num': 1000}
          perf_info(dict): performance result
              {'preprocess_time_s': 1.0
              'inference_time_s': 2.0
              'postprocess_time_s': 1.0
              'total_time_s': 4.0}
          resource_info(dict):
              cpu and gpu resources
              {'cpu_rss': 100
               'gpu_rss': 100
               'gpu_util': 60}
      """
      # PaddleInferBenchmark Log Version
      self.log_version = "1.0.3"
  
      # Paddle Version
      self.paddle_version = paddle.__version__
      self.paddle_commit = paddle.__git_commit__
      paddle_infer_info = paddle_infer.get_version()
      self.paddle_branch = paddle_infer_info.strip().split(": ")[-1]
  
      # model info
      self.model_info = model_info
  
      # data info
      self.data_info = data_info
  
      # perf info
      self.perf_info = perf_info
  
      try:
          # required value
          self.model_name = model_info["model_name"]
          self.precision = model_info["precision"]
  
          self.batch_size = data_info["batch_size"]
          self.shape = data_info["shape"]
          self.data_num = data_info["data_num"]
  
          self.inference_time_s = round(
              perf_info["inference_time_s"], 4
          )
      except:
          self.print_help()
          raise ValueError(
              "Set argument wrong, please check input argument and its type"
          )
  
      self.preprocess_time_s = perf_info.get("preprocess_time_s", 0)
      self.postprocess_time_s = perf_info.get("postprocess_time_s", 0)
      self.with_tracker = (
          True if "tracking_time_s" in perf_info else False
      )
      self.tracking_time_s = perf_info.get("tracking_time_s", 0)
      self.total_time_s = perf_info.get("total_time_s", 0)
  
      self.inference_time_s_90 = perf_info.get(
          "inference_time_s_90", ""
      )
      self.inference_time_s_99 = perf_info.get(
          "inference_time_s_99", ""
      )
      self.succ_rate = perf_info.get("succ_rate", "")
      self.qps = perf_info.get("qps", "")
  
      # conf info
      self.config_status = self.parse_config(config)
  
      # mem info
      if isinstance(resource_info, dict):
          self.cpu_rss_mb = int(resource_info.get("cpu_rss_mb", 0))
          self.cpu_vms_mb = int(resource_info.get("cpu_vms_mb", 0))
          self.cpu_shared_mb = int(
              resource_info.get("cpu_shared_mb", 0)
          )
          self.cpu_dirty_mb = int(resource_info.get("cpu_dirty_mb", 0))
          self.cpu_util = round(resource_info.get("cpu_util", 0), 2)
  
          self.gpu_rss_mb = int(resource_info.get("gpu_rss_mb", 0))
          self.gpu_util = round(resource_info.get("gpu_util", 0), 2)
          self.gpu_mem_util = round(
              resource_info.get("gpu_mem_util", 0), 2
          )
      else:
          self.cpu_rss_mb = 0
          self.cpu_vms_mb = 0
          self.cpu_shared_mb = 0
          self.cpu_dirty_mb = 0
          self.cpu_util = 0
  
          self.gpu_rss_mb = 0
          self.gpu_util = 0
          self.gpu_mem_util = 0
  
      # init benchmark logger
      self.benchmark_logger()
  
file_path: PaddleDetection/deploy/pptracking/python/benchmark_utils.py
imports: import os
  import logging
  import paddle
  import paddle.inference
  from pathlib import Path
label_desc: Use image node_id 1 to create a new PaddleInferBenchmark object from inherited base classes: object with example: obj = PaddleInferBenchmark(config, model_info, data_info, perf_info, resource_info)