code: def visualize(image_list, batch_res, output_dir="output"):
      # visualize the predict result
      batch_res = batch_res["output"]
      for image_file, res in zip(image_list, batch_res):
          im = visualize_attr(image_file, [res])
          if not os.path.exists(output_dir):
              os.makedirs(output_dir)
          img_name = os.path.split(image_file)[-1]
          out_path = os.path.join(output_dir, img_name)
          cv2.imwrite(out_path, im)
          print("save result to: " + out_path)
  
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 python.benchmark_utils import PaddleInferBenchmark
  from python.preprocess import preprocess, Resize, NormalizeImage, Permute, PadStride, LetterBoxResize, WarpAffine
  from python.visualize import visualize_attr
  from python.utils import argsparser, Timer, get_current_memory_mb
  from python.infer import Detector, get_test_images, print_arguments, load_predictor
  from PIL import Image, ImageDraw, ImageFont
label_desc: Use image node_id 1 for calling a global function with example usage: visualize(image_list, batch_res, output_dir) without return types