def test_15(self):
bpth = tempfile.mkdtemp()
os.mkdir(os.path.join(bpth, 'a'))
ipth = os.path.join(bpth, 'a', 'b.png')
img = np.ones((32,32))
misc.imsave(ipth, img)
ei = util.ExampleImages(pth=bpth)
im = ei.images()
assert(len(im) > 0)
gp = ei.groups()
assert(len(gp) > 0)
img = ei.image('b.png', group='a')
assert(img.shape == (32,32))
im = ei.image('b.png', group='a', scaled=True, dtype=np.float32,
zoom=0.5)
os.remove(ipth)
os.rmdir(os.path.join(bpth, 'a'))
os.rmdir(bpth)
评论列表
文章目录