CAE
Lossy Image Compression with Compressive Autoencoders
key words: Image Compression, Compressive Autoencoders
The model utilizes the Compressive Autoencoders to compress images. The paper is published in 2017, and readers can read the original paper via the link.
Our Contributions
- Translate from Pytorch version to mindspore
- Successfully run forward, backward and parameter update
- Test the mindspore version
File Structure
The translated model file is in CAE/demo/model_baseline.py.
demo
├── ckpt
│ └── latest.ckpt # test model file
├── model_baseline.py # reproduce model
├── pycache
├── test.py # test in reality
└── train.py # train
Environment
- mindspore-dev==2.0.0dev20230116
- It is recommended to install through the link.
- cuda 11.1
- python 3.7
Command
Please intall compressai via
pip install -e .
under dictionary CAE.
Train
Train the model via:
cd demo
python train.py -d your/own/dataset/address
test
We code and decode via:
cd demo
python test.py -d your/own/dataset/address
Actually, it is very fast although it is related to disk I/O. Therefore, we will not provide the fast version of testing.
Comparison
Reconstructed image
mindspore version
Quality measurements on Kodak
MindSpore version, models trained on div2k
bpp |
PSNR |
MSSSIM |
enc_time |
dec_time |
GPU Memory(MiB) |
lambda |
0.327 |
26.618 |
0.933 |
5.784 |
21.105 |
4002 |
0.01 |
0.586 |
27.635 |
0.958 |
5.967 |
22.718 |
4002 |
0.04 |
0.761 |
27.772 |
0.96 |
5.497 |
21.23 |
4002 |
0.08 |
1.296 |
27.799 |
0.96 |
6.94 |
24.043 |
4002 |
0.2 |
|
PSNR |
bpp |
Official PT version |
about 32* |
about 0.7* |
*: There is not official implementation. We infer the value via the presentation in the paper.
Besides, we reproduce the model according to the Suro Lee's project. We appreciate the contribution of her/him from the bottom of our heart.
Citation
@article{theis2017lossy,
title={Lossy image compression with compressive autoencoders},
author={Theis, Lucas and Shi, Wenzhe and Cunningham, Andrew and Huszar, Ferenc},
journal={arXiv preprint arXiv:1703.00395},
year={2017}
}
Contributors
Name:
Zhuozhen Yu
email: yuzhuozhen@stu.pku.edu.cn
Please keep free to contact us.
Hua Ye