Commit a0b4dd25 authored by Daniel Scheffler's avatar Daniel Scheffler
Browse files

Fixed test_image_classifier.py.

parent 1a93b1e3
Pipeline #3263 passed with stage
in 18 minutes and 16 seconds
...@@ -43,12 +43,12 @@ with zipfile.ZipFile(path_classifier_zip, "r") as zf, tempfile.TemporaryDirector ...@@ -43,12 +43,12 @@ with zipfile.ZipFile(path_classifier_zip, "r") as zf, tempfile.TemporaryDirector
class Test_MinimumDistance_Classifier(unittest.TestCase): class Test_MinimumDistance_Classifier(unittest.TestCase):
def test_classify(self): def test_classify(self):
MDC = MinimumDistance_Classifier(cluster_centers, cluster_labels, CPUs=1) MDC = MinimumDistance_Classifier(cluster_centers, cluster_labels, CPUs=1)
cmap_sp = MDC.classify(test_gA, nodataVal=-9999) cmap_sp = MDC.classify(test_gA, in_nodataVal=-9999)
self.assertIsInstance(cmap_sp, np.ndarray) self.assertIsInstance(cmap_sp, np.ndarray)
self.assertEqual(cmap_sp.shape, (1010, 1010)) self.assertEqual(cmap_sp.shape, (1010, 1010))
MDC = MinimumDistance_Classifier(cluster_centers, cluster_labels, CPUs=None) MDC = MinimumDistance_Classifier(cluster_centers, cluster_labels, CPUs=None)
cmap_mp = MDC.classify(test_gA, nodataVal=-9999) cmap_mp = MDC.classify(test_gA, in_nodataVal=-9999)
self.assertIsInstance(cmap_mp, np.ndarray) self.assertIsInstance(cmap_mp, np.ndarray)
self.assertEqual(cmap_mp.shape, (1010, 1010)) self.assertEqual(cmap_mp.shape, (1010, 1010))
...@@ -58,12 +58,12 @@ class Test_MinimumDistance_Classifier(unittest.TestCase): ...@@ -58,12 +58,12 @@ class Test_MinimumDistance_Classifier(unittest.TestCase):
class Test_kNN_Classifier(unittest.TestCase): class Test_kNN_Classifier(unittest.TestCase):
def test_classify(self): def test_classify(self):
kNNC = kNN_Classifier(cluster_centers, cluster_labels, CPUs=1) kNNC = kNN_Classifier(cluster_centers, cluster_labels, CPUs=1)
cmap_sp = kNNC.classify(test_gA, nodataVal=-9999) cmap_sp = kNNC.classify(test_gA, in_nodataVal=-9999)
self.assertIsInstance(cmap_sp, np.ndarray) self.assertIsInstance(cmap_sp, np.ndarray)
self.assertEqual(cmap_sp.shape, (1010, 1010)) self.assertEqual(cmap_sp.shape, (1010, 1010))
kNNC = kNN_Classifier(cluster_centers, cluster_labels, CPUs=None) kNNC = kNN_Classifier(cluster_centers, cluster_labels, CPUs=None)
cmap_mp = kNNC.classify(test_gA, nodataVal=-9999) cmap_mp = kNNC.classify(test_gA, in_nodataVal=-9999)
self.assertIsInstance(cmap_mp, np.ndarray) self.assertIsInstance(cmap_mp, np.ndarray)
self.assertEqual(cmap_mp.shape, (1010, 1010)) self.assertEqual(cmap_mp.shape, (1010, 1010))
...@@ -73,12 +73,12 @@ class Test_kNN_Classifier(unittest.TestCase): ...@@ -73,12 +73,12 @@ class Test_kNN_Classifier(unittest.TestCase):
class Test_SAM_Classifier(unittest.TestCase): class Test_SAM_Classifier(unittest.TestCase):
def test_classify(self): def test_classify(self):
SC = SAM_Classifier(cluster_centers, CPUs=1) SC = SAM_Classifier(cluster_centers, CPUs=1)
cmap_sp = SC.classify(test_gA, nodataVal=-9999, tiledims=(400, 200)) cmap_sp = SC.classify(test_gA, in_nodataVal=-9999, tiledims=(400, 200))
self.assertIsInstance(cmap_sp, np.ndarray) self.assertIsInstance(cmap_sp, np.ndarray)
self.assertEqual(cmap_sp.shape, (1010, 1010)) self.assertEqual(cmap_sp.shape, (1010, 1010))
SC = SAM_Classifier(cluster_centers, CPUs=None) SC = SAM_Classifier(cluster_centers, CPUs=None)
cmap_mp = SC.classify(test_gA, nodataVal=-9999, tiledims=(400, 200)) cmap_mp = SC.classify(test_gA, in_nodataVal=-9999, tiledims=(400, 200))
self.assertIsInstance(cmap_mp, np.ndarray) self.assertIsInstance(cmap_mp, np.ndarray)
self.assertEqual(cmap_mp.shape, (1010, 1010)) self.assertEqual(cmap_mp.shape, (1010, 1010))
...@@ -88,12 +88,12 @@ class Test_SAM_Classifier(unittest.TestCase): ...@@ -88,12 +88,12 @@ class Test_SAM_Classifier(unittest.TestCase):
class Test_SID_Classifier(unittest.TestCase): class Test_SID_Classifier(unittest.TestCase):
def test_classify(self): def test_classify(self):
SC = SID_Classifier(cluster_centers, CPUs=1) SC = SID_Classifier(cluster_centers, CPUs=1)
cmap_sp = SC.classify(test_gA, nodataVal=-9999, tiledims=(400, 200)) cmap_sp = SC.classify(test_gA, in_nodataVal=-9999, tiledims=(400, 200))
self.assertIsInstance(cmap_sp, np.ndarray) self.assertIsInstance(cmap_sp, np.ndarray)
self.assertEqual(cmap_sp.shape, (1010, 1010)) self.assertEqual(cmap_sp.shape, (1010, 1010))
SC = SID_Classifier(cluster_centers, CPUs=None) SC = SID_Classifier(cluster_centers, CPUs=None)
cmap_mp = SC.classify(test_gA, nodataVal=-9999, tiledims=(400, 200)) cmap_mp = SC.classify(test_gA, in_nodataVal=-9999, tiledims=(400, 200))
self.assertIsInstance(cmap_mp, np.ndarray) self.assertIsInstance(cmap_mp, np.ndarray)
self.assertEqual(cmap_mp.shape, (1010, 1010)) self.assertEqual(cmap_mp.shape, (1010, 1010))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment