code: def bench_log(
      detector, img_list, model_info, batch_size=1, name=None
  ):
      mems = {
          "cpu_rss_mb": detector.cpu_mem / len(img_list),
          "gpu_rss_mb": detector.gpu_mem / len(img_list),
          "gpu_util": detector.gpu_util * 100 / len(img_list),
      }
      perf_info = detector.det_times.report(average=True)
      data_info = {
          "batch_size": batch_size,
          "shape": "dynamic_shape",
          "data_num": perf_info["img_num"],
      }
      log = PaddleInferBenchmark(
          detector.config, model_info, data_info, perf_info, mems
      )
      log(name)
  
imports: import os
  import yaml
  import glob
  from functools import reduce
  import cv2
  import numpy
  import math
  import paddle
  from paddle.inference import Config
  from paddle.inference import create_predictor
  import sys
  from benchmark_utils import PaddleInferBenchmark
  from picodet_postprocess import PicoDetPostProcess
  from preprocess import preprocess, Resize, NormalizeImage, Permute, PadStride, LetterBoxResize, Pad, decode_image
  from mot.visualize import visualize_box_mask
  from mot_utils import argsparser, Timer, get_current_memory_mb
label_desc: Use image node_id 1 for calling a global function with example usage: bench_log(detector, img_list, model_info, batch_size, name) without return types