X-Git-Url: https://www.fleuret.org/cgi-bin/gitweb/gitweb.cgi?a=blobdiff_plain;f=README.md;h=4753d971ffbee5a7ab463f9d8700eeaa24885b28;hb=f1b69c449f895dcefa9c6390e350040ad4555018;hp=c28a3170b4cb4942df36e20b0ee0123d2a9edbee;hpb=13cdfeaa573e4e217f55cd2176fe815ff4a28cd3;p=pysvrt.git diff --git a/README.md b/README.md index c28a317..4753d97 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ framework. The main function is ``` -torch.ByteTensor generate_vignettes(int problem_number, torch.LongTensor labels) +torch.ByteTensor svrt.generate_vignettes(int problem_number, torch.LongTensor labels) ``` where @@ -20,14 +20,39 @@ The returned ByteTensor has three dimensions: * Pixel row * Pixel col +The two additional functions + +``` +torch.ByteStorage svrt.compress(torch.ByteStorage x) +``` + +and + +``` +torch.ByteStorage svrt.uncompress(torch.ByteStorage x) +``` + +provides a lossless compression scheme adapted to the ByteStorage of +the vignette ByteTensor (i.e. expecting a lot of 255s, a few 0s, and +no other value). + +They allow to reduce the memory footprint by a factor ~50, and may be +usefull to deal with very large data-sets and avoid re-generating +images at every batch. + +See vignette_set.py for a class CompressedVignetteSet using it. + # Installation and test # Executing ``` make -j -k -./built.py ./test-svrt.py ``` should generate an image example.png in the current directory. + +Note that the image generation does not take advantage of GPUs or +multi-core, and can be as fast as 10,000 vignettes per second and as +slow as 40 on a 4GHz i7-6700K.