def __init__(self, args, base_dir=Path.db_root_dir('pascal'), split='train'):
    '\n        :param base_dir: path to VOC dataset directory\n        :param split: train/val\n        :param transform: transform to apply\n        '
    super().__init__()
    self._base_dir = base_dir
    self._image_dir = os.path.join(self._base_dir, 'JPEGImages')
    self._cat_dir = os.path.join(self._base_dir, 'SegmentationClass')
    self._sp_dir = os.path.join(self._base_dir, 'super_pixel')
    if isinstance(split, str):
        self.split = [split]
    else:
        split.sort()
        self.split = split
    self.args = args
    _splits_dir = os.path.join(self._base_dir, 'ImageSets', 'Segmentation')
    self.im_ids = []
    self.images = []
    self.categories = []
    self.super_pixel = []
    for splt in self.split:
        with open(os.path.join(os.path.join(_splits_dir, (splt + '.txt'))), 'r') as f:
            lines = f.read().splitlines()
        for (ii, line) in enumerate(lines):
            _image = os.path.join(self._image_dir, (line + '.jpg'))
            _cat = os.path.join(self._cat_dir, (line + '.png'))
            _sp = os.path.join(self._sp_dir, (line + '.ppm.jpg'))
            assert os.path.isfile(_image)
            assert os.path.isfile(_cat)
            assert os.path.isfile(_sp)
            self.im_ids.append(line)
            self.images.append(_image)
            self.categories.append(_cat)
            self.super_pixel.append(_sp)
    assert (len(self.images) == len(self.categories))
    print('Number of images in {}: {:d}'.format(split, len(self.images)))
:param base_dir: path to VOC dataset directory
:param split: train/val
:param transform: transform to apply
def __init__(self, args, base_dir=Path.db_root_dir('pascal'), split='train'):
    '\n        :param base_dir: path to VOC dataset directory\n        :param split: train/val\n        :param transform: transform to apply\n        '
    super().__init__()
    self._base_dir = base_dir
    self._image_dir = os.path.join(self._base_dir, 'JPEGImages')
    self._cat_dir = os.path.join(self._base_dir, 'SegmentationClass')
    self._sp_dir = os.path.join(self._base_dir, 'super_pixel')
    if isinstance(split, str):
        self.split = [split]
    else:
        split.sort()
        self.split = split
    self.args = args
    _splits_dir = os.path.join(self._base_dir, 'ImageSets', 'Segmentation')
    self.im_ids = []
    self.images = []
    self.categories = []
    self.super_pixel = []
    for splt in self.split:
        with open(os.path.join(os.path.join(_splits_dir, (splt + '.txt'))), 'r') as f:
            lines = f.read().splitlines()
        for (ii, line) in enumerate(lines):
            _image = os.path.join(self._image_dir, (line + '.jpg'))
            _cat = os.path.join(self._cat_dir, (line + '.png'))
            _sp = os.path.join(self._sp_dir, (line + '.ppm.jpg'))
            assert os.path.isfile(_image)
            assert os.path.isfile(_cat)
            assert os.path.isfile(_sp)
            self.im_ids.append(line)
            self.images.append(_image)
            self.categories.append(_cat)
            self.super_pixel.append(_sp)
    assert (len(self.images) == len(self.categories))
    print('Number of images in {}: {:d}'.format(split, len(self.images)))