Пример #1
0
    def load_dataset(self):
        feeder_class = import_class(self.args.dataset)
        feeder = feeder_class(self.args.data_path,
                              num_points=self.args.num_points,
                              transform=None,
                              phase='train')
        train_data = DataLoader(dataset=feeder,
                                batch_size=self.args.train_batch_size,
                                shuffle=True,
                                num_workers=8)
        self.dataset['train'] = train_data

        self.shape_names = feeder.shape_names
        self.num_classes = feeder.num_classes
        self.num_parts = feeder.num_parts
        self.print_log(f'Train data loaded: {len(feeder)} samples.')

        if self.args.eval_model:
            feeder = feeder_class(self.args.data_path,
                                  num_points=self.args.num_points,
                                  transform=None,
                                  phase='test')
            test_data = DataLoader(dataset=feeder,
                                   batch_size=self.args.test_batch_size,
                                   shuffle=False,
                                   num_workers=8)
            self.dataset['test'] = test_data
            self.print_log(f'Test data loaded: {len(feeder)} samples.')
Пример #2
0
 def load_transform(self):
     self.transform = utils.import_class(self.args.transform)
     if self.transform is not None:
         transform_args = self.args.transform_args
         if transform_args is None:
             transform_args = dict()
         self.transform = self.transform(**transform_args)
     self.print_log(self.transform, print_time=False)
Пример #3
0
 def load_dataset(self):
     feeder_class = import_class(self.args.dataset)
     feeder = feeder_class(self.args.data_path,
                           num_points=self.args.num_points,
                           transform=self.transform,
                           phase='train')
     self.dataset['train'] = DataLoader(
         dataset=feeder,
         batch_size=self.args.train_batch_size,
         shuffle=True,
         num_workers=8)
     self.print_log(f'Train data loaded: {len(feeder)} samples.')
Пример #4
0
    def load_dataset(self):
        feeder_class = import_class(self.args.dataset)
        self.feeder = feeder_class(
            self.args.data_path, num_points=self.args.num_points,
            transform=None, phase='test'
        )
        test_data = DataLoader(
            dataset=self.feeder,
            batch_size=self.args.test_batch_size,
            shuffle=False,
            num_workers=8
        )
        self.dataset['test'] = test_data

        self.classes_dict = self.feeder.classes_dict
        self.shape_names = self.feeder.shape_names
        self.num_classes = self.feeder.num_classes
        self.num_parts = self.feeder.num_parts

        self.print_log(f'Test data loaded: {len(self.feeder)} samples.')