code: def __init__(self, voc_path, annotation_path):
      self.voc_path = voc_path
      self.annotation_path = annotation_path
      self.label_dir = os.path.join(self.voc_path, "Context")
      self._image_dir = os.path.join(self.voc_path, "JPEGImages")
      self.annFile = os.path.join(
          self.annotation_path, "trainval_merged.json"
      )
  
      self._mapping = np.sort(
          np.array(
              [
                  0,
                  2,
                  259,
                  260,
                  415,
                  324,
                  9,
                  258,
                  144,
                  18,
                  19,
                  22,
                  23,
                  397,
                  25,
                  284,
                  158,
                  159,
                  416,
                  33,
                  162,
                  420,
                  454,
                  295,
                  296,
                  427,
                  44,
                  45,
                  46,
                  308,
                  59,
                  440,
                  445,
                  31,
                  232,
                  65,
                  354,
                  424,
                  68,
                  326,
                  72,
                  458,
                  34,
                  207,
                  80,
                  355,
                  85,
                  347,
                  220,
                  349,
                  360,
                  98,
                  187,
                  104,
                  105,
                  366,
                  189,
                  368,
                  113,
                  115,
              ]
          )
      )
      self._key = np.array(range(len(self._mapping))).astype("uint8")
  
      self.train_detail = Detail(self.annFile, self._image_dir, "train")
      self.train_ids = self.train_detail.getImgs()
      self.val_detail = Detail(self.annFile, self._image_dir, "val")
      self.val_ids = self.val_detail.getImgs()
  
      if not os.path.exists(self.label_dir):
          os.makedirs(self.label_dir)
  
file_path: PaddleSeg/tools/data/convert_voc2010.py
imports: import argparse
  import os
  import tqdm
  import numpy
  from detail import Detail
  from PIL import Image
label_desc: Use image node_id 1 to create a new PascalContextGenerator object from inherited base classes: object with example: obj = PascalContextGenerator(voc_path, annotation_path)