PyTorch implementation of Self-Supervised Image Restoration with Blurry and Noisy Pairs
OpenReview | arXiv | video
Overview of our proposed SelfIR framework.
- (a) Training phase of SelfIR. Sub-sampled blurry image
$g_1(I_B)$ and noisy image$g_1(I_N)$ are taken as the inputs.$g_2(I_N)$ is used for calculating the reconstruction loss$\zeta_{rec}$ and regularization loss$\zeta_{reg}$ , while$g_1(I_B)$ is taken for calculating auxiliary loss$\zeta_{aux}$ . - (b) Example of neighbor sub-sampler. In each
$2\times2$ cell, two pixels are randomly selected for respectively composing the neighboring sub-images. - (c) Testing phase of SelfIR. The blurry and noisy images can be directly taken for restoration.
-
Prerequisites
- Python 3.x and PyTorch 1.6.
- OpenCV, NumPy, Pillow, tqdm, lpips, scikit-image and tensorboardX.
-
Dataset
-
GoPro dataset can be downloaded from this link.
-
Synthetic noisy images with Gaussian noise for testing can be downloaded from this link. Please decompress the files according to the commands provided in its
readme.txt
. -
Synthetic noisy images with Poisson noise for testing can be downloaded from this link. Please decompress the files according to the commands provided in its
readme.txt
. -
The directory structure of the dataset:
GOPRO_Large │ └───train │ GOPR0372_07_00 │ GOPR0372_07_01 | ... │ └───test │ GOPR0372_07_00 │ GOPR0372_07_01 | ... │ └───test_noise_gauss5_50 │ GOPR0372_07_00 │ GOPR0372_07_01 | ... │ └───test_noise_poisson5_50 GOPR0372_07_00 GOPR0372_07_01 ...
-
-
For Gaussian noise, we provide the pre-trained models in the
./ckpt/selfir_gauss_noise/
folder. -
For Poisson noise, we provide the pre-trained models in the
./ckpt/selfir_poisson_noise/
folder.
-
Modify
dataroot
,type
andname
intrain.sh
and then run:
-
Modify
dataroot
,type
,name
anditer
intest.sh
and then run:
- You can specify which GPU to use by
--gpu_ids
, e.g.,--gpu_ids 0,1
,--gpu_ids 3
,--gpu_ids -1
(for CPU mode). In the default setting, all GPUs are used. - You can refer to options for more arguments.
If you find it useful in your research, please consider citing:
@inproceedings{SelfIR,
title={Self-Supervised Image Restoration with Blurry and Noisy Pairs},
author={Zhang, Zhilu and Xu, Rongjian and Liu, Ming and Yan, Zifei and Zuo, Wangmeng},
booktitle={NeurIPS},
year={2022}
}
This repo is built upon the framework of CycleGAN, and we borrow some code from Neighbor2Neighbor, thanks for their excellent work!