示例#1
0
    def __init__(self,
                 dataset_path,
                 batch_size,
                 mode,
                 x_keys,
                 y_keys,
                 split_name,
                 valid_split_number=0,
                 p=None):

        # Setting the random generator seed
        np.random.seed(cfg.RANDOM_SEED)

        self.images_path = os.path.join(dataset_path, 'images')
        if p is None:
            self.annotations_path = os.path.join(dataset_path, 'annotations',
                                                 '100')
            self.missing_annotations_path = os.path.join(
                dataset_path, 'missing_organs', '100')
        else:
            self.annotations_path = os.path.join(dataset_path, 'annotations',
                                                 str(p))
            self.missing_annotations_path = os.path.join(
                dataset_path, 'missing_organs', str(p))

        self.valid_split_number = valid_split_number
        self.split_name = split_name

        Dataset.__init__(self, dataset_path, batch_size, mode, x_keys, y_keys,
                         p)
示例#2
0
    def __init__(self,
                 dataset_path,
                 batch_size,
                 mode,
                 x_keys,
                 y_keys,
                 year='2014',
                 p=None):

        assert year in [
            '2014', '2017'
        ], 'Invalid Coco year %s (accepted years 2014 and 2017)' % year
        self.year = year

        self.images_path = os.path.join(dataset_path,
                                        '%s%s' % (mode, self.year))

        Dataset.__init__(self, dataset_path, batch_size, mode, x_keys, y_keys,
                         p)
示例#3
0
    def __init__(self, dataset_path, batch_size, mode, x_keys, y_keys, p=None):

        self.images_path = os.path.join(dataset_path, 'images')

        Dataset.__init__(self, dataset_path, batch_size, mode, x_keys, y_keys,
                         p)