The state-of-the-art image restoration model without nonlinear activation functions.
Go to file
mayorx 386ca20359 update readme 2022-04-16 18:44:21 +08:00
basicsr Support Single Image Inference . 2022-04-16 18:32:43 +08:00
datasets init NAFNet code 2022-04-12 01:15:02 +08:00
demo Support Single Image Inference . 2022-04-16 18:32:43 +08:00
docs reds data preparation 2022-04-16 17:19:32 +08:00
experiments/pretrained_models Support Single Image Inference . 2022-04-16 18:32:43 +08:00
figures init-repo 2022-04-11 19:02:02 +08:00
options save image by default .. for test configs 2022-04-15 18:41:28 +08:00
scripts reds data preparation 2022-04-16 17:19:17 +08:00
.gitignore init-repo 2022-04-11 19:02:02 +08:00
LICENSE claim License 2022-04-12 02:01:23 +08:00
VERSION init NAFNet code 2022-04-12 01:15:02 +08:00
readme.md update readme 2022-04-16 18:44:21 +08:00
requirements.txt init NAFNet code 2022-04-12 01:15:02 +08:00
setup.cfg init NAFNet code 2022-04-12 01:15:02 +08:00
setup.py claim License 2022-04-12 02:01:23 +08:00

readme.md

PWC PWC

NAFNet: Nonlinear Activation Free Network for Image Restoration

The official pytorch implementation of the paper Simple Baselines for Image Restoration

Liangyu Chen*, Xiaojie Chu*, Xiangyu Zhang, Jian Sun

Although there have been significant advances in the field of image restoration recently, the system complexity of the state-of-the-art (SOTA) methods is increasing as well, which may hinder the convenient analysis and comparison of methods. In this paper, we propose a simple baseline that exceeds the SOTA methods and is computationally efficient. To further simplify the baseline, we reveal that the nonlinear activation functions, e.g. Sigmoid, ReLU, GELU, Softmax, etc. are not necessary: they could be replaced by multiplication or removed. Thus, we derive a Nonlinear Activation Free Network, namely NAFNet, from the baseline. SOTA results are achieved on various challenging benchmarks, e.g. 33.69 dB PSNR on GoPro (for image deblurring), exceeding the previous SOTA 0.38 dB with only 8.4% of its computational costs; 40.30 dB PSNR on SIDD (for image denoising), exceeding the previous SOTA 0.28 dB with less than half of its computational costs.

PSNR_vs_MACs

News

NAFNet based Stereo Image Super-Resolution solution won the 1st place on the NTIRE 2022 Stereo Image Super-resolution Challenge! Coming Soon.

Installation

This implementation based on BasicSR which is a open source toolbox for image/video restoration tasks and HINet

python 3.9.5
pytorch 1.11.0
cuda 11.3
git clone https://github.com/megvii-research/NAFNet
cd NAFNet
pip install -r requirements.txt
python setup.py develop --no_cuda_ext

Quick Start

  • Image Denoise Colab Demo: google colab logo
  • Image Deblur Colab Demo: google colab logo
  • Single Image Inference Demo:
    • Image Denoise:
    python basicsr/demo.py -opt options/test/SIDD/NAFNet-width64.yml --input_path ./demo/noisy.png --output_path ./demo/denoise_img.png
    
    • Image Deblur:
    python basicsr/demo.py -opt options/test/GoPro/NAFNet-width64.yml --input_path ./demo/blurry.png --output_path ./demo/deblur_img.png
    
    • --input_path: the path of the degraded image
    • --output_path: the path to save the predicted image
    • pretrained models should be downloaded.

Results and Pre-trained Models

name Dataset PSNR SSIM pretrained models configs
NAFNet-GoPro-width32 GoPro 32.8705 0.9606 gdrive | 百度网盘 (提取码: so6v) train | test
NAFNet-GoPro-width64 GoPro 33.7103 0.9668 gdrive | 百度网盘 (提取码: wnwh) train | test
NAFNet-SIDD-width32 SIDD 39.9672 0.9599 gdrive | 百度网盘 (提取码: um97) train | test
NAFNet-SIDD-width64 SIDD 40.3045 0.9614 gdrive | 百度网盘 (提取码: dton) train | test
NAFNet-REDS-width64 REDS 29.0903 0.8671 gdrive | 百度网盘 (提取码: 9fas) train | test

Image Restoration Tasks

Task Dataset Instructions Visualization Results
Image Deblurring GoPro link gdrive | 百度网盘 (提取码: 96ii)
Image Denoising SIDD link gdrive | 百度网盘 (提取码: hu4t)
Image Deblurring with JPEG artifacts REDS link gdrive | 百度网盘 (提取码: put5)

Citations

If NAFNet helps your research or work, please consider citing NAFNet.

@article{chen2022simple,
  title={Simple Baselines for Image Restoration},
  author={Chen, Liangyu and Chu, Xiaojie and Zhang, Xiangyu and Sun, Jian},
  journal={arXiv preprint arXiv:2204.04676},
  year={2022}
}

Contact

If you have any questions, please contact chenliangyu@megvii.com or chuxiaojie@megvii.com


statistics

visitors