BYchao100 / Deep-Lossy-Plus-Residual-Coding

Deep Lossy Plus Residual Coding for Lossless and Near-lossless Image Compression (TPAMI'24, Journal Extension of our CVPR'21 work)
14 stars 0 forks source link

Deep-Lossy-Plus-Residual-Coding

Deep Lossy Plus Residual (DLPR) coding is the state-of-the-art learning-based lossless and near-lossless image compression algorithm with fast running speed (TPAMI'24, Journal extension of our CVPR'21 work).

Usage

The code is run with Python 3.9, Pytorch 1.11.0, Cudatoolkit 11.3.1, Timm 0.5.4, Torchac 0.9.3 and Compressai 1.2.0.

Please note: Inconsistent pytorch and cuda versions, especially higher versions, may cause failure.

Data preparation

Download and extract DIV2K_train_HR and DIV2K_valid_HR high-resolution images from DIV2K Dataset to Datasets folder.

./Datasets/
  DIV2K_train_HR/
      img1.png
      img2.png
      ...
  DIV2K_valid_HR/
      img3.png
      img4.png
      ...
  extract_patches_train.py
  extract_patches_valid.py

Run extract_patches_train.py and extract_patches_valid.py to crop 2K images into $128\times 128$ patches for network training and validation.

DLPR coding for lossless compression ($\tau=0$)

In DLPR_ll folder, we provide the DLPR coding system for lossless compression only, without Scalable Quantized Residual Compressor.

The trained model ckp_ll can be downloaded from Baidu Netdisk with access code dlpr. Please put ckp_ll in the DLPR_ll folder.

DLPR coding for near-lossless compression ($\tau\ge0$)

In DLPR_nll folder, we provide the DLPR coding system for scalable near-lossless compression.

The trained model ckp_nll can be downloaded from Baidu Netdisk with access code dlpr. Please put ckp_nll in the DLPR_nll folder.

Citation

@ARTICLE{DLPR,
  author={Bai, Yuanchao and Liu, Xianming and Wang, Kai and Ji, Xiangyang and Wu, Xiaolin and Gao, Wen},
  journal={IEEE Transactions on Pattern Analysis and Machine Intelligence}, 
  title={Deep Lossy Plus Residual Coding for Lossless and Near-lossless Image Compression}, 
  year={2024},
  volume={46},
  number={5},
  pages={3577-3594},
  doi={10.1109/TPAMI.2023.3348486}
}