code: def _get_ade20k_pairs(folder, mode="train"):
      img_paths = []
      mask_paths = []
      if mode == "train":
          img_folder = os.path.join(folder, "images/training")
          mask_folder = os.path.join(folder, "annotations/training")
      else:
          img_folder = os.path.join(folder, "images/validation")
          mask_folder = os.path.join(folder, "annotations/validation")
      for filename in os.listdir(img_folder):
          basename, _ = os.path.splitext(filename)
          if filename.endswith(".jpg"):
              imgpath = os.path.join(img_folder, filename)
              maskname = basename + ".png"
              maskpath = os.path.join(mask_folder, maskname)
              if os.path.isfile(maskpath):
                  img_paths.append(imgpath)
                  mask_paths.append(maskpath)
              else:
                  print("cannot find the mask:", maskpath)
  
      return img_paths, mask_paths
  
file_path: gluon-cv/gluoncv/data/ade20k/segmentation.py
imports: import os
  from PIL import Image
  import numpy
  import mxnet
  from ..segbase import SegmentationDataset
label_desc: Use image node_id 1 for calling a global function with example usage: _get_ade20k_pairs(folder, mode) and returns: img_paths,  mask_paths