code: def get_voc_images_labels_info(split, data_source_dir):
      assert g_pathmgr.exists(
          data_source_dir
      ), "Data source NOT found. Abort"
      data_files = get_data_files(split, data_source_dir)
      # we will construct a map for image name to the vector of -1, 0, 1
      # we sort the data_files which gives sorted class names as well
      img_labels_map = {}
      for cls_num, data_path in enumerate(sorted(data_files)):
          # for this class, we have images and each image will have label
          # 1, -1, 0 -> present, not present, ignore respectively as in VOC data.
          with g_pathmgr.open(data_path, "r") as fopen:
              for line in fopen:
                  try:
                      img_name, orig_label = line.strip().split()
                      if img_name not in img_labels_map:
                          img_labels_map[img_name] = -(
                              np.ones(len(data_files), dtype=np.int32)
                          )
                      orig_label = int(orig_label)
                      # in VOC data, -1 (not present), set it to 0 as train target
                      if orig_label == -1:
                          orig_label = 0
                      # in VOC data, 0 (ignore), set it to -1 as train target
                      elif orig_label == 0:
                          orig_label = -1
                      img_labels_map[img_name][cls_num] = orig_label
                  except Exception:
                      logging.info(
                          "Error processing: {} data_path: {}".format(
                              line, data_path
                          )
                      )
      img_paths, img_labels = [], []
      for item in sorted(img_labels_map.keys()):
          img_paths.append(f"{data_source_dir}/JPEGImages/{item}.jpg")
          img_labels.append(img_labels_map[item])
  
      # save to the datasets folder and return the path
      output_dir = get_output_dir()
      img_info_out_path = f"{output_dir}/{split}_images.npy"
      label_info_out_path = f"{output_dir}/{split}_labels.npy"
      save_file(np.array(img_paths), img_info_out_path)
      save_file(np.array(img_labels), label_info_out_path)
      return [img_info_out_path, label_info_out_path]
  
file_path: vissl/vissl/data/datasets/pascal_voc.py
imports: import logging
  import os
  from glob import glob
  import numpy
  from iopath.common.file_io import g_pathmgr
  from vissl.utils.io import makedir, save_file
label_desc: Use image node_id 4 for calling a global function with example usage: get_voc_images_labels_info(split, data_source_dir) and returns: list