Ejemplo n.º 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)
Ejemplo n.º 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)
Ejemplo n.º 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)
Ejemplo n.º 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)
Ejemplo n.º 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)
Ejemplo n.º 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)
Ejemplo n.º 7
0
 def test_load_non_existent_path(self):
     with self.assertRaises(ValidationException):
         loader = ImageLoader(32)
         loader.create("/tmp/nonexistentpath", format='png')
Ejemplo n.º 8
0
 def test_constructor(self):
     with self.test_session():
         loader = ImageLoader(32)
         self.assertEqual(loader.batch_size, 32)
Ejemplo n.º 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)
Ejemplo n.º 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)
Ejemplo n.º 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)
Ejemplo n.º 12
0
 def test_load_non_existent_path(self):
     with self.assertRaises(ValidationException):
         loader = ImageLoader(32)
         loader.create("/tmp/nonexistentpath", format='png')