def test_no_shuffle_limit(self):
     d = Dataset('data/')
     d = d.include('*.png')
     data = d.compile()
     ld = Loader(data, data, threads=4)
     ld.cropper(RandomCrop(1))
     ld.image_augmentation()
     itr = ld.make_one_shot_iterator([4, 3, 16, 16], 10, False,
                                     data.capacity / 2)
     ret = list(itr)
     self.assertEqual(len(ret), 10)
     self.assert_psnr(ret)
     itr = ld.make_one_shot_iterator([4, 3, 16, 16], 10, False,
                                     data.capacity / 2)
     ret = list(itr)
     self.assertEqual(len(ret), 10)
     self.assert_psnr(ret)
Ejemplo n.º 2
0
def test_memory_limit():
    d = Dataset('data/')
    d = d.include('*.png')
    data = d.compile()
    ld = Loader(data, data, threads=4)
    ld.cropper(RandomCrop(1))
    ld.image_augmentation()
    itr = ld.make_one_shot_iterator([4, 3, 16, 16], 10, True,
                                    data.capacity / 2)
    ret = list(itr)
    assert len(ret) is 10
    assert_psnr(ret)
    itr = ld.make_one_shot_iterator([4, 3, 16, 16], 10, True,
                                    data.capacity / 2)
    ret = list(itr)
    assert len(ret) is 10
    assert_psnr(ret)