-
Notifications
You must be signed in to change notification settings - Fork 60
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
No compression happened #3
Comments
What kind of images did you compress? The models are trained on natural images. And when you say 600-800KB, you mean the |
Or are you using |
After I update my gcc, I can run the codes now. |
@BUAAHugeGun This is because it's a JPG, a lossy format :) So if you feed a .jpg to L3C you are asking it to compress the artefacts from JPG losslessly. The number you should care about is how L3C compares to PNG, which is also lossless. Regarding the GPU: this is the problem of using CNNs. I think this could be optimized but I did not spend the time. If you have more RAM, you can also try the CPU version of torchac. |
@fab-jul thanks a lot for your response. 👍 |
uh...I'm coming back here for your help. |
the output will always be equal to the input. what kind of images are in |
First I tried .jpg as I said. They were the same, Though the size of output is much larger than input. |
Can you post one such .png that produces noise here? |
I just downloaded this image and ran it through L3C:
And I get the same image back, as expected, i.e. In theory, the code will always produce the same image. I'm really confused by what you get. Can you post the blurred result as well? |
This is very unexpected. It looks very much like you are getting a sampled version of the image. Some questions:
|
I'm sure about the 3 questions. And I tried some times again. |
...I downloaded the code again. |
Maybe something with torchac is wrong. Can you try to run
because that runs |
Alternatively, can you send |
I sent a email to you. : ) |
Thanks! I’ll have a look. If you can, running the above command (the one with |
So, I just tried, and I get the same blurry output as you. I then went and compared the binary file you gave me to the one I get when I encode. They only match in the part that encodes the smallest bottleneck (which is encoded with a uniform prior). So, for some reason, your network must produce different probability distributions when encoding. Now, I don't see how |
I‘ll check this out. Since it happens on CIFAR also, it most likely is not a memory issue |
It is strange that when I first used l3c.py, the output was the same as the input, but when I found this problem, I tried the same input as the first one, the output changed to a blurred image. |
Wait, are you saying that everything worked before that commit? Or are you not 100% sure? Edit: Are you running both encoding and decoding on the CPU? |
Uh, I just tried .jpg images on GPU before that commit and they were OK. |
So, I finally have some time to dig into this. Good news: I can now finally reproduce it, with the steps provided by @ChipsSpectre. |
Update: This has to do with CUDA. If I compile torchac without CUDA support AND run all commands with Currently however, there is some weird behavior in |
thx a lot. I guess it's hard to find this problem. |
@ChipsSpectre Yes I realized that too now. Another problem is that if you compile with GPU support once, it stays in your What's really weird to me however is that it works when using If you want to dig into that, it would also be much appreciated :) |
fixed. |
Still working on making the backend selection more seamless, so keeping this open. |
@BUAAHugeGun Please try again with the latest master commit and let me know how it goes |
Closing this due to inactivity. |
I tested two of the pre trained models on an image directory with JPEG images of the size 50-70KB. The output images in the sample folder were of the size 600-800KB. So basically no compression. Am I doing something wrong?
The text was updated successfully, but these errors were encountered: