From: Francois Fleuret Date: Wed, 14 Jun 2017 18:48:34 +0000 (+0200) Subject: Added the example image. X-Git-Url: https://fleuret.org/cgi-bin/gitweb/gitweb.cgi?a=commitdiff_plain;h=26dffa334607dc6f57139d19eb0b793cb3ac8484;p=pysvrt.git Added the example image. --- diff --git a/example.png b/example.png new file mode 100644 index 0000000..6198c5a Binary files /dev/null and b/example.png differ diff --git a/test-svrt.py b/test-svrt.py index 9aa2d59..c1309bc 100755 --- a/test-svrt.py +++ b/test-svrt.py @@ -39,12 +39,10 @@ from _ext import svrt labels = torch.LongTensor(12).zero_() labels.narrow(0, 0, labels.size(0)//2).fill_(1) -train_set = svrt.generate_vignettes(4, labels) +x = svrt.generate_vignettes(4, labels) -print(str(type(train_set)), train_set.size()) +x = x.view(x.size(0), 1, x.size(1), x.size(2)) -train_set = train_set.view(train_set.size(0), 1, train_set.size(1), train_set.size(2)) +x.div_(255) -train_set.div_(255) - -torchvision.utils.save_image(train_set, 'example.png') +torchvision.utils.save_image(x, 'example.png')