code: def test():
      path = "/Users/liliulei/Downloads/IDD_Detection/JPEGImages/frontNear/"
      image_list, image_dir = get_image_list(path)
  
      for ii in image_list:
          name_xml = (
              "/Users/liliulei/Downloads/IDD_Detection/Annotations/frontNear/"
              + ii[:-3]
              + "xml"
          )
          image = cv2.imread(path + ii)
          # print(image.shape)
          (h, w) = image.shape[0:2]
  
          pred = np.zeros_like(image)
  
          dom = xml.dom.minidom.parse(name_xml)
          root = dom.documentElement
          objects = root.getElementsByTagName("object")
          for item in objects:
              name = item.getElementsByTagName("name")[0]
              print(name.firstChild.data)
              if (
                  name.firstChild.data == "traffic sign"
                  or name.firstChild.data == "traffic light"
              ):
                  xmin = int(
                      item.getElementsByTagName("bndbox")[0]
                      .getElementsByTagName("xmin")[0]
                      .firstChild.data
                  )
                  ymin = int(
                      item.getElementsByTagName("bndbox")[0]
                      .getElementsByTagName("ymin")[0]
                      .firstChild.data
                  )
                  xmax = int(
                      item.getElementsByTagName("bndbox")[0]
                      .getElementsByTagName("xmax")[0]
                      .firstChild.data
                  )
                  ymax = int(
                      item.getElementsByTagName("bndbox")[0]
                      .getElementsByTagName("ymax")[0]
                      .firstChild.data
                  )
                  if name.firstChild.data == "traffic sign":
                      pred[ymin:ymax, xmin:xmax, 0] = 255
                  elif name.firstChild.data == "traffic light":
                      pred[ymin:ymax, xmin:xmax, 1] = 255
  
          new_im = image * 0.5 + pred * 0.5
  
          cv2.imwrite(ii.split("/")[-1][:-3] + "png", new_im)
  
file_path: PaddleSeg/contrib/AutoNUE/tools/IDD_labeling.py
imports: import os
  import numpy
  import cv2
  from PIL import Image
  from paddleseg import utils
  import xml.dom.minidom
label_desc: Use image node_id 4 for calling a global function with example usage: test() without return types