Home

Awesome

CTC (CVPR 2023)

"Context-based Trit-Plane Coding for Progressive Image Compression," In CVPR 2023.

Seungmin Jeon, Kwang Pyo Choi, Youngo Park and Chang-Su Kim.

PyTorch-Based Official Code for CTC.

Requirements

Installation

Download pre-trained model parameters on the root path.

Usage

Encoding

  $ python codec.py --mode enc --save-path {path} --input-file {input image file} --cuda

"--cuda" is optional.

For exasmple, command below

  $ python codec.py --mode enc --save-path results --input-file sample.png --cuda

generates binary files in "results/bits".

Decoding

  $ python codec.py --mode dec --save-path {path same with enc} --input-file {original image file} --recon-level {int} --cuda

"--input-file" is optional, used to calculate PSNR.

For example, command below

  $ python codec.py --mode dec --save-path results --input-file sample.png --recon-level 140 --cuda

prints metrics and saves reconstructed an image "results/recon/q0140.png".

Citation

Please cite the following paper when you use this repository. Thanks!

    @inproceedings{2023_CVPR_jeon,
        author    = {Jeon, Seungmin and Choi, Kwang Pyo and Park, Youngo and Kim, Chang-Su}, 
        title     = {Context-Based Trit-Plane Coding for Progressive Image Compression}, 
        booktitle = {{Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition}},
        year      = {2023}
    }

License

See MIT License