X-Git-Url: https://fleuret.org/cgi-bin/gitweb/gitweb.cgi?a=blobdiff_plain;f=test-svrt.py;h=0e7d9083318d46cffbeb66855ca50240996cc8ae;hb=34aeb8100a6c19dae72779f9e46a0acbb5a069c7;hp=cd98f21daec984c869e5be478b0b009ad4cee058;hpb=dfca7e16051d1752db7daed892ecb200237e3bb6;p=pysvrt.git diff --git a/test-svrt.py b/test-svrt.py index cd98f21..0e7d908 100755 --- a/test-svrt.py +++ b/test-svrt.py @@ -19,7 +19,7 @@ # General Public License for more details. # # You should have received a copy of the GNU General Public License -# along with selector. If not, see . +# along with pysvrt. If not, see . import time @@ -34,13 +34,15 @@ 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)