Ejemplo n.º 1
0
 def test_minimum_dimensions_example_stream(self):
     stream = MinimumImageDimensions(self.example_stream, (4, 5),
                                     which_sources=('source1', ))
     it = stream.get_epoch_iterator()
     for example, shp in zip(it, self.shapes):
         assert example[0].shape[0] >= 4 and example[0].shape[1] >= 5
         assert (example[1].shape[1] == shp[0]
                 and example[1].shape[0] == shp[1])
Ejemplo n.º 2
0
 def test_minimum_dimensions_example_stream(self):
     stream = MinimumImageDimensions(self.example_stream, (4, 5),
                                     which_sources=('source1',))
     it = stream.get_epoch_iterator()
     for example, shp in zip(it, self.shapes):
         assert example[0].shape[0] >= 4 and example[0].shape[1] >= 5
         assert (example[1].shape[1] == shp[0] and
                 example[1].shape[0] == shp[1])
Ejemplo n.º 3
0
 def test_minimum_dimensions_batch_stream(self):
     stream = MinimumImageDimensions(self.batch_stream, (4, 5),
                                     which_sources=('source1', ))
     it = stream.get_epoch_iterator()
     for batch, shapes in zip(it, partition_all(self.batch_size,
                                                self.shapes)):
         assert (example.shape[0] >= 4 and example.shape[1] >= 5
                 for example in batch[0])
         assert (example.shape[1] == shp[0] and example.shape[0] == shp[1]
                 for example, shp in zip(batch[1], shapes))
Ejemplo n.º 4
0
 def test_minimum_dimensions_batch_stream(self):
     stream = MinimumImageDimensions(self.batch_stream, (4, 5),
                                     which_sources=('source1',))
     it = stream.get_epoch_iterator()
     for batch, shapes in zip(it, partition_all(self.batch_size,
                                                self.shapes)):
         assert (example.shape[0] >= 4 and example.shape[1] >= 5
                 for example in batch[0])
         assert (example.shape[1] == shp[0] and
                 example.shape[0] == shp[1]
                 for example, shp in zip(batch[1], shapes))