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
      ), "--image_file or --image_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 glob
  import json
  import math
  import os
  from pathlib import Path
  import cv2
  import numpy
  import yaml
  from paddle.inference import Config
  from paddle.inference import create_predictor
  from .keypoint_preprocess import EvalAffine
  from .keypoint_preprocess import expand_crop
  from .keypoint_preprocess import TopDownEvalAffine
  from .preprocess import decode_image
  from .preprocess import LetterBoxResize
  from .preprocess import NormalizeImage
  from .preprocess import Pad
  from .preprocess import PadStride
  from .preprocess import Permute
  from .preprocess import preprocess
  from .preprocess import Resize
  from .preprocess import WarpAffine
  from .visualize import visualize_box
label_desc: Use image node_id 3 for calling a global function with example usage: get_test_images(infer_dir, infer_img) and returns: images, list