Exemplo n.º 1
0
 def test_all(self):
     data_path = 'data'
     data_splits_path = '../outputs/data_splits.json'
     input_patch_size = core.patch_size()
     dat = core.Data(data_splits_path, data_path, input_patch_size)
     self.assertTrue(len(dat.train_set) > 0)
     self.assertTrue(len(dat.validation_set) > 0)
     self.assertTrue(len(dat.test_set) > 0)
     self.assertTrue(len(dat.train_files) > 0)
     self.assertTrue(len(dat.validation_files) > 0)
     self.assertTrue(len(dat.test_files) > 0)
Exemplo n.º 2
0
 def test_generator_len2(self):
     data_list = [('data/input1.npy', 'data/output1.npy'),
                  ('data/input2.npy', 'data/output2.npy')]
     input_patch_size = core.patch_size()
     gen = core.keras_generator(data_list, input_patch_size)
     i = 1
     for sample in gen:
         if i > 15:
             break
         self.assertEqual(2, len(sample))
         self.assertEqual((8, 360, 50, 6), sample[0].shape)
         self.assertEqual((8, 360, 50), sample[1].shape)
         i += 1
Exemplo n.º 3
0
    def test_example(self):
        fpath_in = 'data/input1.npy'
        fpath_out = 'data/output1.npy'
        input_patch_size = core.patch_size()

        gen = core.patch_generator(fpath_in, fpath_out, input_patch_size)

        i = 1
        for sample in gen:
            if i > 15:
                break
            self.assertEqual(sorted(['X', 'Y']), sorted(sample.keys()))
            self.assertEqual((1, 360, 50, 6), sample['X'].shape)
            self.assertEqual((1, 360, 50), sample['Y'].shape)
            i += 1
Exemplo n.º 4
0
 def test_patch_size(self):
     expected = (360, 50)
     actual = core.patch_size()
     self.assertEqual(expected, actual)