code: def get_test_images(infer_dir, infer_img):
      """
      Get image path list in TEST mode
      """
      assert (
          infer_img is not None or infer_dir is not None
      ), "--infer_img or --infer_dir should be set"
      assert infer_img is None or os.path.isfile(
          infer_img
      ), "{} is not a file".format(infer_img)
      assert infer_dir is None or os.path.isdir(
          infer_dir
      ), "{} is not a directory".format(infer_dir)
  
      # infer_img has a higher priority
      if infer_img and os.path.isfile(infer_img):
          return [infer_img]
  
      images = set()
      infer_dir = os.path.abspath(infer_dir)
      assert os.path.isdir(
          infer_dir
      ), "infer_dir {} is not a directory".format(infer_dir)
      exts = ["jpg", "jpeg", "png", "bmp"]
      exts += [ext.upper() for ext in exts]
      for ext in exts:
          images.update(glob.glob("{}/*.{}".format(infer_dir, ext)))
      images = list(images)
  
      assert len(images) > 0, "no image found in {}".format(infer_dir)
      print("Found {} inference images in total.".format(len(images)))
  
      return images
  
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 4 for calling a global function with example usage: get_test_images(infer_dir, infer_img) and returns: images, list