コード例 #1
0
 def test_DATAAUGMENTATION_BASE_infauf(self):
     data_aug = Data_Augmentation()
     data_aug.infaug = True
     for axis in data_aug.infaug_flip_list:
         data_aug.infaug_flip_current = axis
         img_aug = data_aug.run_infaug(self.img3D)
         self.assertFalse(np.array_equal(img_aug, self.img3D))
         img_aug = data_aug.run_infaug(img_aug)
         self.assertTrue(np.array_equal(img_aug, self.img3D))
コード例 #2
0
 def test_DATAGENERATOR_inferenceAug(self):
     data_aug = Data_Augmentation()
     pp_fi = Preprocessor(self.data_io,
                          batch_size=4,
                          data_aug=data_aug,
                          prepare_subfunctions=False,
                          prepare_batches=False,
                          analysis="fullimage")
     data_gen = DataGenerator([self.sample_list[0]],
                              pp_fi,
                              training=False,
                              shuffle=False,
                              iterations=None)
     pred_list_inactive = []
     for batch in data_gen:
         pred_list_inactive.append(batch)
     data_aug.infaug = True
     pred_list_active = []
     for batch in data_gen:
         pred_list_active.append(batch)
     for i in range(0, len(pred_list_active)):
         ba = pred_list_active[i]
         bi = pred_list_inactive[i]
         self.assertFalse(np.array_equal(ba, bi))