You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We design a unified generative compression model (Control-GIC) capable of variable bitrate adaption across a broad spectrum while preserving high-perceptual fidelity reconstruction. Control-GIC allows one model for variable bitrates and once compression on an entire dataset for constrained bitrate conditions.
We use OpenImages-v6 dataset and randomly crop images to a uniform 256 × 256 resolution.
python main.py --config configs/config_train.yaml
Inference
We use Kodak, high-resolution DIV2K and CLIC2020 datasets to evaluate the model.
python inference.py -i input_dir -o output_dir
💡 Special Capabilities
Fine control of bitrate
By fine-tuning the granularity ratio, the model is able to make fine adjustments to the bitrate (Evaluated on the Kodak dataset).
Granularity Ratio
Bpp
LPIPS
(0.301, 0.599, 0.1)
0.38925
0.03027
(0.302, 0.598, 0.1)
0.38983
0.03025
(0.303, 0.597, 0.1)
0.39050
0.03020
(0.304, 0.596, 0.1)
0.39108
0.03014
Constant bitrate
Once the granularity ratio is fixed, the bpp values of each image in the dataset are very close to each other, thus easily fulfilling the constrained bandwidth and bitrate conditions. For example, in one compression on the Kodak dataset, we set the ratio to (0.1, 0.8, 0.1), and obtained 24 images with bpp ranging from 0.262 to 0.277, with only slight variations.
Cite
@inproceedings{li2025onceforall,
title={Once-for-All: Controllable Generative Image Compression with Dynamic Granularity Adaptation},
author={Anqi Li and Feng Li and Yuxi Liu and Runmin Cong and Yao Zhao and Huihui Bai},
booktitle={The Thirteenth International Conference on Learning Representations},
year={2025}
}
Thanks
The code references VQGAN, MoVQGAN, DQ-VAE and Huffman coding from Bhrigu Srivastava@bhrigu123. Thanks for these excellent works!
About
[ICLR 2025] Pytorch implementation of the paper "Once-for-All: Controllable Generative Image Compression with Dynamic Granularity Adaptation".