CVPR2019 (oral) Modulating Image Restoration with Continual Levels via Adaptive Feature Modification Layers (AdaFM). PyTorch implementation
By Jingwen He, Chao Dong, and Yu Qiao
class AdaptiveFM(nn.Module):
def __init__(self, in_channel, kernel_size):
super(AdaptiveFM, self).__init__()
padding = (kernel_size - 1) // 2
self.transformer = nn.Conv2d(in_channel, in_channel, kernel_size, padding=padding, groups=in_channel)
def forward(self, x):
return self.transformer(x) + x
@InProceedings{He_2019_CVPR,
author = {He, Jingwen and Dong, Chao and Qiao, Yu},
title = {Modulating Image Restoration With Continual Levels via Adaptive Feature Modification Layers},
booktitle = {The IEEE Conference on Computer Vision and Pattern Recognition (CVPR)},
month = {June},
year = {2019}
}
pip install numpy opencv-python lmdb
pip install tensorboardX
, for visualizing curves.We provide a pretrained model for AdaFM-Net (experiments/pretrained_models
) that deals with denoising from σ15 to σ75. Please run the following commands directly:
cd codes
python interpolate.py -opt options/test/test.json
The results can be found in the newly created directory AdaFM/results
The noise level of the input image
is σ45, and you are supposed to obtain similar interpolated results as follows:
The overall code framework mainly consists of four parts - Config, Data, Model and Network. We also provides some useful scripts. Please run all the following commands in “codes” directory.
options/test/test.json
(please refer to options
for instructions.)python test.py -opt options/test/test.json
options/test/test.json
python interpolate.py -opt options/test/test.json
scripts/net_interp.py
to obtain the interpolated network.options/test/test.json
and run command: python test.py -opt options/test/test.json
codes/data
.options/train/train_basic.json
(please refer to options
for instructions.)python train.py -opt options/train/train_basic.json
options/train/train_adafm.json
python train.py -opt options/train/train_adafm.json