Skip to content

ProRes: Exploring Degradation-aware Visual Prompt for Universal Image Restoration

License

Notifications You must be signed in to change notification settings

leonmakise/ProRes

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

14 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

ProRes πŸŒ†

Exploring Degradation-aware Visual Prompt for Universal Image Restoration

Jiaqi Ma1,✒, Tianheng Cheng2,✒ Guoli Wang3 Xinggang Wang2, Qian Zhang3, Lefei Zhang1,πŸ“§

1School of Computer Science, Wuhan University
2 School of EIC, Huazhong University of Science & Technology
3 Horizon Robotics

(✒) Equal contribution. (πŸ“§) corresponding author.

arXiv paper

Updates

This project is under active development, please stay tuned! β˜•

Sep 29, 2024: Code & models of ProRes are released, and some minor issues have been fixed. We will update the arXiv version with more details upon acceptance.

Aug 28, 2024: Our newest paper Perceive-IR is on arXiv and under peer review! Perceive-IR performs well under two all-in-one settings.

Jun 26, 2023: We've released ProRes! We wish this work would inspire more works on prompt learning with image restoration tasks. Code & models are coming soon!

Highlights

  • ProRes addresses universal image restoration with degradation-aware prompts, which is the first prompt-based versatile framework for image restoration.

  • ProRes demonstrate two superior capabilities: (1) control ability for desired outputs and (2) transferability based on prompt tuning.

  • ProRes can be easily adapted for new tasks or new datasets through effective and efficient prompt tuning.

  • Specific prompts can control the output of ProRes. Moreover, combining different prompts can tackle the images with multiple corruptions.

Getting Started

Requirement

  • Linux, CUDA>=9.2, GCC>=5.4
  • PyTorch >= 1.8.1
  • MATLAB for evaluation

Other Dependencies

Install detectron2, following the instructions in here. Or simply use the following command.

cd ProRes/
git clone https://github.com/facebookresearch/detectron2
python -m pip install -e detectron2

Data Preparation

Download Path

Preprocess Data

Run the following commands to generate corresponding JSON files for each dataset.

#denoising
python data/sidd/gen_json_sidd.py --split train
python data/sidd/gen_json_sidd.py --split val

# low-light enhancement
python data/lol/gen_json_lol.py --split train
python data/lol/gen_json_lol.py --split val

# deraining
python data/derain/gen_json_rain.py --split train
python data/derain/gen_json_rain.py --split val

# derblurring
python data/derain/gen_json_blur.py --split train
python data/derain/gen_json_blur.py --split val

Dataset Structure

We recommend the dataset directory structure to be the following:

$ProRes/datasets/
    denoise/
        train/
        val/
    enhance/
        our485/
            low/
            high/
        eval15/
            low/
            high/
    derain/
        train/
            input/
            target/
        test/
            Rain100H/
            Rain100L/
            Test100/
            Test1200/
            Test2800/
    deblur/
        train/
            input/
            target/
        test/
            GoPro/
            HIDE/
            RealBlur_J/
            RealBlur_R/

    target-derain_train.json
    gt-enhance_lol_train.json
    groundtruth-denoise_ssid_train448.json
    groundtruth_crop-deblur_gopro_train.json
    
    target-derain_test_rain100h.json
    gt-enhance_lol_eval.json
    groundtruth-denoise_ssid_val256.json
    groundtruth-deblur_gopro_val.json

Training

Download pre-trained MAE ViT-Large model and put it in the folder ./ProRes/pretrained_weights/.

sh scripts/train.sh

Evaluation

Download the pretrained model and put it in the folder ./ProRes/models/prores_vitl_pretrained_sl1_mprnetprompt_add/.

Run the following command:

sh eval_ours.sh

Experimental Results

Performance on Image Restorations Tasks

denoising deraining enhance deblurring
SIDD 5 datasets LoL 4 datasets
PSNR SSIM PSNR SSIM PSNR SSIM PSNR SSIM
Task-specific models
Uformer 39.89 0.960 - - - - 32.31 0.941
MPRNet 39.71 0.958 32.73 0.921 - - 33.67 0.948
MIRNet-v2 39.84 0.959 - - 24.74 0.851 - -
Restormer 40.02 0.960 33.96 0.935 - - 32.32 0.935
MAXIM 39.96 0.960 33.24 0.933 23.43 0.863 34.50 0.954
Universal models
Painter 38.88 0.954 29.49 0.868 22.40 0.872 - -
ViT-Large 39.28 0.967 30.75 0.893 21.69 0.850 20.57 0.680
ProRes 39.28 0.967 30.67 0.891 22.73 0.877 28.03 0.897

Notes:

  • The works we used for reference including Uformer(paper,code), MPRNet(paper,code), MIRNet-v2(paper,code), Restormer(paper,code), MAXIM(paper,code) and Painter(paper,code).
  • For both Painter and ProRes, we adopt ViT-Large with MAE pre-trained weights.
  • More experimental results are listed in the paper!

Visualizations

Control Ability

1.Independent Control

Visualization results processed from images of different corruptions. Compared with the original inputs, the outputs are consistent with the given visual prompts.

2. Sensitive to Irrelevant Task-specific Prompts

Visualization results processed by different prompts. Compared with the original inputs, the outputs remain unchanged with irrelevant visual prompts.

3. Tackle Complicated Corruptions

Visualization results processed by ProRes from images of mixed types of degradation, i.e., low-light and rainy. ProRes adopts two visual prompts for low-light enhancement (E) and deraining (D) and combines the two visual prompts by linear weighted sum, i.e., Ξ±D + (1 βˆ’ Ξ±)E, to control the restoration process.

Adaptation on New Datasets & Task

1. Low-light Enhancement Results

Visualization results of ProRes on the FiveK dataset. We adopt two settings, i.e., direct inference and prompt tuning, to evaluate ProRes on the FiveK dataset (a new dataset for low-light enhancement).

2. Dehazing Results

Visualization results of ProRes on the RESIDE-6K dataset via prompt tuning for image dehazing (a new task).

Citation

If you find our paper and code useful for your research, please consider giving a star ⭐ and citation πŸ“ :

@article{
      title={ProRes: Exploring Degradation-aware Visual Prompt for Universal Image Restoration}, 
      author={Jiaqi Ma and Tianheng Cheng and Guoli Wang and Xinggang Wang and Qian Zhang and Lefei Zhang},
      journal={arXiv preprint arXiv:2306.13653},
      year={2023}
}

Acknowledgement

This project is based on MAE, BEiT, MIRNet, MPRNet, Uformer and Painter. Thanks for their wonderful work!