def test_empty_dataset(self): opt = Options() opt.dataset_name = os.path.join(os.getcwd(), "test") opt.dataroot = os.path.join(os.getcwd(), "test") dataset = BaseDataset(opt) self.assertEqual(dataset.pre_transform, None) self.assertEqual(dataset.test_transform, None) self.assertEqual(dataset.train_transform, None) self.assertEqual(dataset.val_transform, None) self.assertEqual(dataset.train_dataset, None) self.assertEqual(dataset.test_dataset, None) self.assertEqual(dataset.val_dataset, None)
def test_empty_dataset(self): opt = Options() opt.dataset_name = os.path.join(os.getcwd(), "test") opt.dataroot = os.path.join(os.getcwd(), "test") opt.pre_transform = [DictConfig({"transform": "RandomNoise"})] opt.test_transform = [DictConfig({"transform": "AddOnes"})] opt.val_transform = [DictConfig({"transform": "Jitter"})] opt.train_transform = [DictConfig({"transform": "RandomSymmetry"})] dataset = BaseDataset(opt) self.assertEqual(str(dataset.pre_transform), str(T.Compose([T3d.RandomNoise()]))) self.assertEqual(str(dataset.test_transform), str(T.Compose([T3d.AddOnes()]))) self.assertEqual(str(dataset.train_transform), str(T.Compose([T3d.RandomSymmetry()]))) self.assertEqual(str(dataset.val_transform), str(T.Compose([T3d.Jitter()]))) self.assertEqual(str(dataset.inference_transform), str(T.Compose([T3d.RandomNoise(), T3d.AddOnes()]))) self.assertEqual(dataset.train_dataset, None) self.assertEqual(dataset.test_dataset, None) self.assertEqual(dataset.val_dataset, None)