WooKyoungHan / JDEC

Official implementation of the CVPR'24 Paper "JDEC: JPEG Decoding via Enhanced Continuous Cosine Coefficients"

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

JDEC: JPEG Decoding via Enhanced Continuous Cosine Coefficient

This repository contains the official implementation for JDEC introduced in the following paper:

JDEC: JPEG Decoding via Enhanced Continuous Cosine Coefficient (CVPR 2024)

arXiv

Project Page

Overall Structure

Overall Structure of Our JDEC

JDEC consists of an encoder with group spectra embedding, a decoder, and a continuous cosine formulation. Inputs of JDEC are as follows: compressed spectra and quantization map. Note that our JDEC does not take images as input. JDEC formulates latent features into a trainable continuous cosine coefficient as a function of the block grid and forwards to INR. Therefore, each block shares the estimated continuous cosine spectrum.

Installation

Our code is based on Ubuntu 20.04, PyTorch 1.10.0, CUDA 11.3 (NVIDIA RTX 3090 24GB, sm86), and python 3.6.

For environment setup, we recommend using conda for installation:

conda env create --file environment.yaml
conda activate jdec

The encoder module of our JDEC is based on the prior work RGB No More.

Please refer to the Usage part for installation.

  • Compile dct_manip -- a modified libjpeg handler:

    • Open dct_manip/setup.py

    • Modify include_dirs and library_dirs to include your include and library folder.

    • Modify extra_objects to the path containing libjpeg.so

    • Modify headers to the path containing jpeglib.h

    • Run cd dct_manip

    • Run pip install .

Data Preparation

Our train and valid sets follow the prior work FBCNN, from DIV2K and Flickr2K dataset.

  • The following file configurations are required to operate the data loader:
    jpeg_removal
    ├── train_paired
    │   ├── train_10
    │   │   ├── 0001.jpeg
    │   │   ├──...
    │   ├── train_20
    │   │   ├── 0001.jpeg
    │   │   ├──...
    │   ├── train_30
    │   │   ├── 0001.jpeg
    │   ├── ...
    │   └── train #(GT)
    │       ├── 0001.png
    │       └──...
    └── valid_paired
        ├── valid_10
        │   ├── 0801.jpeg
        │   ├──...
        └── valid
            ├── 0001.png
            └──..
    

Train

The basic train code is :

python train.py --config configs/train_JDEC.yaml --gpu 0

If you want to modify some configuration (e.g. the range of input bit-depth) modify .yaml files and run

python train.py --config configs/FancyConfiguration.yaml --gpu 0

We provide our main model's checkpoint.

Test

The basic test code is :

python test.py 

The path to the model checkpoint and benchmark datasets should be changed.

(e.g.'./PATH_TO_LIVE1' and model_path = './PATH_TO_MODEL')

Acknowledgements

This code is built on LIIF,LTE, SwinIR and RGB No More. We thank the authors for sharing their codes.


BibTex:
@inproceedings{han2024jdec,
  title={JDEC: JPEG Decoding via Enhanced Continuous Cosine Coefficients},
  author={Han, Woo Kyoung and Im, Sunghoon and Kim, Jaedeok and Jin, Kyong Hwan},
  booktitle={Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition},
  pages={2784--2793},
  year={2024}
}

About

Official implementation of the CVPR'24 Paper "JDEC: JPEG Decoding via Enhanced Continuous Cosine Coefficients"

License:BSD 3-Clause "New" or "Revised" License


Languages

Language:Python 67.1%Language:JavaScript 22.5%Language:C++ 6.7%Language:HTML 3.3%Language:CSS 0.4%