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])
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])
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))
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))