예제 #1
0
 def test_load_fixture(self):
     with self.test_session():
         loader = ImageLoader(32)
         x, y = loader.create(fixture_path(), width=4, height=4, format='png')
         self.assertEqual(y.get_shape(), [])
         self.assertEqual(int(x.get_shape()[1]), 4)
         self.assertEqual(int(x.get_shape()[2]), 4)
예제 #2
0
 def test_load_fixture_single_count(self):
     with self.test_session():
         loader = ImageLoader(32)  #TODO crop=true?
         x, y = loader.create(fixture_path('white'),
                              width=4,
                              height=4,
                              format='png')
         self.assertEqual(loader.file_count, 1)
예제 #3
0
 def test_load_fixture_single(self):
     with self.test_session():
         loader = ImageLoader(32)  #TODO crop=true? why is this working
         loader.create(fixture_path('images'),
                       width=4,
                       height=4,
                       format='png')
         self.assertEqual(int(loader.x.get_shape()[1]), 4)
         self.assertEqual(int(loader.x.get_shape()[2]), 4)
예제 #4
0
 def test_load_fixture(self):
     with self.test_session():
         loader = ImageLoader(32)  #TODO crop=true?
         x, y = loader.create(fixture_path(),
                              width=2,
                              height=2,
                              format='png')
         self.assertEqual(int(y.get_shape()[1]), 2)
         self.assertEqual(int(x.get_shape()[1]), 2)
         self.assertEqual(int(x.get_shape()[2]), 2)
예제 #5
0
 def test_load_fixture(self):
     with self.test_session():
         loader = ImageLoader(32)
         x, y = loader.create(fixture_path(),
                              width=4,
                              height=4,
                              format='png')
         self.assertEqual(y.get_shape(), [])
         self.assertEqual(int(x.get_shape()[1]), 4)
         self.assertEqual(int(x.get_shape()[2]), 4)
예제 #6
0
 def test_load_fixture_resize(self):
     with self.test_session():
         loader = ImageLoader(32)  #TODO crop=true?
         loader.create(fixture_path(),
                       width=8,
                       height=8,
                       resize=True,
                       format='png')
         self.assertEqual(int(loader.x.get_shape()[1]), 8)
         self.assertEqual(int(loader.x.get_shape()[2]), 8)
예제 #7
0
 def test_load_non_existent_path(self):
     with self.assertRaises(ValidationException):
         loader = ImageLoader(32)
         loader.create("/tmp/nonexistentpath", format='png')
예제 #8
0
 def test_constructor(self):
     with self.test_session():
         loader = ImageLoader(32)
         self.assertEqual(loader.batch_size, 32)
예제 #9
0
 def test_load_fixture_single_count(self):
     with self.test_session():
         loader = ImageLoader(32) #TODO crop=true?
         loader.create(fixture_path('white'), width=4, height=4, format='png')
         self.assertEqual(loader.file_count, 1)
예제 #10
0
 def test_load_fixture_single(self):
     with self.test_session():
         loader = ImageLoader(32) #TODO crop=true? why is this working
         loader.create(fixture_path('images'), width=4, height=4, format='png')
         self.assertEqual(int(loader.x.get_shape()[1]), 4)
         self.assertEqual(int(loader.x.get_shape()[2]), 4)
예제 #11
0
 def test_load_fixture_resize(self):
     with self.test_session():
         loader = ImageLoader(32) #TODO crop=true?
         loader.create(fixture_path(), width=8, height=8, resize=True, format='png')
         self.assertEqual(int(loader.x.get_shape()[1]), 8)
         self.assertEqual(int(loader.x.get_shape()[2]), 8)
예제 #12
0
 def test_load_non_existent_path(self):
     with self.assertRaises(ValidationException):
         loader = ImageLoader(32)
         loader.create("/tmp/nonexistentpath", format='png')