projects
/
pysvrt.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
The learning continues from where it stopped if a state is found.
[pysvrt.git]
/
test-svrt.py
diff --git
a/test-svrt.py
b/test-svrt.py
index
c1309bc
..
ad3677a
100755
(executable)
--- 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
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
-# along with s
elector
. If not, see <http://www.gnu.org/licenses/>.
+# along with s
vrt
. If not, see <http://www.gnu.org/licenses/>.
import time
import time
@@
-34,15
+34,19
@@
from torch.nn import functional as fn
from torchvision import datasets, transforms, utils
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)
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')
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')