Coder Social home page Coder Social logo

Comments (11)

raindropstarbucks avatar raindropstarbucks commented on June 27, 2024

@fab-jul

from imgcomp-cvpr.

fab-jul avatar fab-jul commented on June 27, 2024

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.

raindropstarbucks avatar raindropstarbucks commented on June 27, 2024

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.

fab-jul avatar fab-jul commented on June 27, 2024

Where are the KB numbers coming from?

from imgcomp-cvpr.

raindropstarbucks avatar raindropstarbucks commented on June 27, 2024

I saved them from your paper, then I get the KB number.

from imgcomp-cvpr.

fab-jul avatar fab-jul commented on June 27, 2024

from the arxiv? or from the pdf?

from imgcomp-cvpr.

raindropstarbucks avatar raindropstarbucks commented on June 27, 2024

from the pdf

from imgcomp-cvpr.

fab-jul avatar fab-jul commented on June 27, 2024

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.

raindropstarbucks avatar raindropstarbucks commented on June 27, 2024

@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.

fab-jul avatar fab-jul commented on June 27, 2024

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 yx, 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.

raindropstarbucks avatar raindropstarbucks commented on June 27, 2024

Thank you very much!

from imgcomp-cvpr.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.