Comments (11)
from imgcomp-cvpr.
I'm not sure I understand :) bpp = bits per pixel = bytes / number of pixels. the conversion factor is just number of pixels, I don't see how one image can be 500kB and 0.388 bpp and aonther can be 350kB and 0.6 bpp :)
from imgcomp-cvpr.
Thank you for your quick reply! :) Well,for example, in your paper,Figure 5: Example image (kodim21) from the Kodak testing set, compressed with different methods .The first image is 0.124bpp, 37.7KB, the JPEG-compressed image is 0.150bpp, 8.26KB. I cannot understand why a image of smaller bpp takes more storage.
from imgcomp-cvpr.
Where are the KB numbers coming from?
from imgcomp-cvpr.
I saved them from your paper, then I get the KB number.
from imgcomp-cvpr.
from the arxiv? or from the pdf?
from imgcomp-cvpr.
from the pdf
from imgcomp-cvpr.
I see. The problem is that a PDF has no way of decoding images produced by our approach. Thus, to show our images in the paper, we had to save them as JPGs. It's just for visualization purposes.
If you want to obtain a compressed representation of an image using our approach, use the --real_bpp
flag as described here.
from imgcomp-cvpr.
@fab-jul I hope I don't bother you. :) I use the --real_bpp flag, then I get the same problem. I use the same images as yours(kodim21). The original image in Figure5 is 637.05kB, then I get the image compressed by the model, 0.3587bpp, 464.98kB, and the image compressed by JPEG, 0.61bpp, 344.81kB. Why a image of smaller bpp takes more storage really makes me confused.
from imgcomp-cvpr.
No worries! I'll try to explain better:
Say you have an image x. You want to compress it to a bitstream (a file), let's call this f. Later you want to decompress f, which will give you back an image y. Note that y ≠ x, because there is some distortion!
What you care about is the size of the file f. How do you get that? You run my code with --real_bpp. That will create a file, and count the bits of that file (Line 55 of bitcounter.py). That is what will be printed in the console, it's the bpp needed by our approach.
However, when you run val.py
with --real_bpp
, it produces also the output y, because your computer doesn't have a built-in decoder to obtain y from f!! So it saves y directly as a '.png', so that you can look at it, and you can see the distortion. The important thing is: The number of bytes used by y tell you nothing about the size of f! That's why there is a mismatch between bytes and bpp: The bytes are not the size of f.
Note that when you pass --real_bpp
, we just check (in bit_counter.py
), that the symbols decoded from f are the same as the ones we encoded (L68). That is enough to ensure that our encoding works, and that's the only point of --real_bpp
: To show that the theoretical bitrates are almost the actual real bitrates.
from imgcomp-cvpr.
Thank you very much!
from imgcomp-cvpr.
Related Issues (20)
- The size of your trained model HOT 2
- why only mask the last channel? HOT 1
- plot HOT 6
- Testing monochromatic images on your code HOT 6
- about soft_quantize sigma parameter
- bpp comparison HOT 3
- test error HOT 2
- inference error HOT 4
- log_dir_root HOT 4
- training
- CodecDistance HOT 4
- python version
- train stop at"-STARTING TRAINING-------------" HOT 8
- inference using real_bpp HOT 2
- about soft and hard quantization HOT 2
- How to optimize with mse? HOT 1
- Question about 'distortion_to_minimize' HOT 3
- Download link/ pretrained models HOT 2
- which time we can get torch ?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from imgcomp-cvpr.