Ejemplo n.º 1
0
 def test__not_flat_with_non_flat_patch(self):
     lr_patch = np.random.random((5, 5, 3))
     with patch('ISR.utils.datahandler.DataHandler._make_img_list', return_value=True):
         with patch('ISR.utils.datahandler.DataHandler._check_dataset', return_value=True):
             DH = DataHandler(
                 lr_dir=None, hr_dir=None, patch_size=0, scale=0, n_validation_samples=None
             )
     self.assertTrue(DH._not_flat(lr_patch, flatness=0.00001))
Ejemplo n.º 2
0
 def test__not_flat_with_flat_patch(self):
     lr_patch = np.zeros((5, 5, 3))
     with patch('ISR.utils.datahandler.DataHandler._make_img_list',
                return_value=True):
         with patch('ISR.utils.datahandler.DataHandler._check_dataset',
                    return_value=True):
             DH = DataHandler(
                 lr_dir=None,
                 hr_dir=None,
                 patch_size=0,
                 scale=0,
                 n_validation_samples=None,
                 T=0.01,
             )
     self.assertFalse(DH._not_flat(lr_patch))