X-Git-Url: https://fleuret.org/cgi-bin/gitweb/gitweb.cgi?p=pysvrt.git;a=blobdiff_plain;f=test-svrt.py;h=5f38fa9bede770220868c21c115e51d1c37dbb4a;hp=c1309bc98524fc289e33e047ce673329ceb1f0e2;hb=3feef9000c7201dc25b872d9a604a0faf1caca3b;hpb=26dffa334607dc6f57139d19eb0b793cb3ac8484 diff --git a/test-svrt.py b/test-svrt.py index c1309bc..5f38fa9 100755 --- a/test-svrt.py +++ b/test-svrt.py @@ -34,15 +34,19 @@ from torch.nn import functional as fn from torchvision import datasets, transforms, utils -from _ext import svrt +import svrt labels = torch.LongTensor(12).zero_() labels.narrow(0, 0, labels.size(0)//2).fill_(1) x = svrt.generate_vignettes(4, labels) +print('compression factor {:f}'.format(x.storage().size() / svrt.compress(x.storage()).size())) + x = x.view(x.size(0), 1, x.size(1), x.size(2)) x.div_(255) torchvision.utils.save_image(x, 'example.png') + +print('Wrote example.png')