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
  import json
  from pathlib import Path
  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, WarpAffine, Pad, decode_image, CULaneResize
  from keypoint_preprocess import EvalAffine, TopDownEvalAffine, expand_crop
  from clrnet_postprocess import CLRNetPostProcess
  from visualize import visualize_box_mask, imshow_lanes
  from utils import argsparser, Timer, get_current_memory_mb, multiclass_nms, coco_clsid2catid
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