Image Restoration Toolbox (PyTorch). Training and testing codes for DPIR, USRNet, DnCNN, FFDNet, SRMD, DPSR, BSRGAN, SwinIR

Overview

Training and testing codes for USRNet, DnCNN, FFDNet, SRMD, DPSR, MSRResNet, ESRGAN, BSRGAN, SwinIR

Kai Zhang

Computer Vision Lab, ETH Zurich, Switzerland


Real-World Image (x4) BSRGAN, ICCV2021 Real-ESRGAN SwinIR (ours)
  • News (2021-08-31): We upload the training code of BSRGAN.

  • News (2021-08-24): We upload the BSRGAN degradation model.

  • News (2021-08-22): Support multi-feature-layer VGG perceptual loss and UNet discriminator.

  • News (2021-08-18): We upload the extended BSRGAN degradation model. It is slightly different from our published version.

  • News (2021-06-03): Add testing codes of GPEN (CVPR21) for face image enhancement: main_test_face_enhancement.py

from utils.utils_modelsummary import get_model_activation, get_model_flops
input_dim = (3, 256, 256)  # set the input dimension
activations, num_conv2d = get_model_activation(model, input_dim)
logger.info('{:>16s} : {:<.4f} [M]'.format('#Activations', activations/10**6))
logger.info('{:>16s} : {:
   .format('#Conv2d', num_conv2d))
flops = get_model_flops(model, input_dim, False)
logger.info('{:>16s} : {:<.4f} [G]'.format('FLOPs', flops/10**9))
num_parameters = sum(map(lambda x: x.numel(), model.parameters()))
logger.info('{:>16s} : {:<.4f} [M]'.format('#Params', num_parameters/10**6))

Clone repo

git clone https://github.com/cszn/KAIR.git
pip install -r requirement.txt

Training

You should modify the json file from options first, for example, setting "gpu_ids": [0,1,2,3] if 4 GPUs are used, setting "dataroot_H": "trainsets/trainH" if path of the high quality dataset is trainsets/trainH.

  • Training with DataParallel - PSNR
python main_train_psnr.py --opt options/train_msrresnet_psnr.json
  • Training with DataParallel - GAN
python main_train_gan.py --opt options/train_msrresnet_gan.json
  • Training with DistributedDataParallel - PSNR - 4 GPUs
python -m torch.distributed.launch --nproc_per_node=4 --master_port=1234 main_train_psnr.py --opt options/train_msrresnet_psnr.json  --dist True
  • Training with DistributedDataParallel - PSNR - 8 GPUs
python -m torch.distributed.launch --nproc_per_node=8 --master_port=1234 main_train_psnr.py --opt options/train_msrresnet_psnr.json  --dist True
  • Training with DistributedDataParallel - GAN - 4 GPUs
python -m torch.distributed.launch --nproc_per_node=4 --master_port=1234 main_train_gan.py --opt options/train_msrresnet_gan.json  --dist True
  • Training with DistributedDataParallel - GAN - 8 GPUs
python -m torch.distributed.launch --nproc_per_node=8 --master_port=1234 main_train_gan.py --opt options/train_msrresnet_gan.json  --dist True
  • Kill distributed training processes of main_train_gan.py
kill $(ps aux | grep main_train_gan.py | grep -v grep | awk '{print $2}')

Method Original Link
DnCNN https://github.com/cszn/DnCNN
FDnCNN https://github.com/cszn/DnCNN
FFDNet https://github.com/cszn/FFDNet
SRMD https://github.com/cszn/SRMD
DPSR-SRResNet https://github.com/cszn/DPSR
SRResNet https://github.com/xinntao/BasicSR
ESRGAN https://github.com/xinntao/ESRGAN
RRDB https://github.com/xinntao/ESRGAN
IMDB https://github.com/Zheng222/IMDN
USRNet https://github.com/cszn/USRNet
DRUNet https://github.com/cszn/DPIR
DPIR https://github.com/cszn/DPIR
BSRGAN https://github.com/cszn/BSRGAN
SwinIR https://github.com/JingyunLiang/SwinIR

Network architectures

  • FFDNet

  • SRMD

  • SRResNet, SRGAN, RRDB, ESRGAN

  • IMDN

    -----

Testing

Method model_zoo
main_test_dncnn.py dncnn_15.pth, dncnn_25.pth, dncnn_50.pth, dncnn_gray_blind.pth, dncnn_color_blind.pth, dncnn3.pth
main_test_ircnn_denoiser.py ircnn_gray.pth, ircnn_color.pth
main_test_fdncnn.py fdncnn_gray.pth, fdncnn_color.pth, fdncnn_gray_clip.pth, fdncnn_color_clip.pth
main_test_ffdnet.py ffdnet_gray.pth, ffdnet_color.pth, ffdnet_gray_clip.pth, ffdnet_color_clip.pth
main_test_srmd.py srmdnf_x2.pth, srmdnf_x3.pth, srmdnf_x4.pth, srmd_x2.pth, srmd_x3.pth, srmd_x4.pth
The above models are converted from MatConvNet.
main_test_dpsr.py dpsr_x2.pth, dpsr_x3.pth, dpsr_x4.pth, dpsr_x4_gan.pth
main_test_msrresnet.py msrresnet_x4_psnr.pth, msrresnet_x4_gan.pth
main_test_rrdb.py rrdb_x4_psnr.pth, rrdb_x4_esrgan.pth
main_test_imdn.py imdn_x4.pth

model_zoo

trainsets

testsets

References

@inproceedings{liang2021swinir,
title={SwinIR: Image Restoration Using Swin Transformer},
author={Liang, Jingyun and Cao, Jiezhang and Sun, Guolei and Zhang, Kai and Van Gool, Luc and Timofte, Radu},
booktitle={IEEE International Conference on Computer Vision Workshops},
year={2021}
}
@inproceedings{zhang2021designing,
title={Designing a Practical Degradation Model for Deep Blind Image Super-Resolution},
author={Zhang, Kai and Liang, Jingyun and Van Gool, Luc and Timofte, Radu},
booktitle={IEEE International Conference on Computer Vision},
year={2021}
}
@article{zhang2021plug, % DPIR & DRUNet & IRCNN
  title={Plug-and-Play Image Restoration with Deep Denoiser Prior},
  author={Zhang, Kai and Li, Yawei and Zuo, Wangmeng and Zhang, Lei and Van Gool, Luc and Timofte, Radu},
  journal={IEEE Transactions on Pattern Analysis and Machine Intelligence},
  year={2021}
}
@inproceedings{zhang2020aim, % efficientSR_challenge
  title={AIM 2020 Challenge on Efficient Super-Resolution: Methods and Results},
  author={Kai Zhang and Martin Danelljan and Yawei Li and Radu Timofte and others},
  booktitle={European Conference on Computer Vision Workshops},
  year={2020}
}
@inproceedings{zhang2020deep, % USRNet
  title={Deep unfolding network for image super-resolution},
  author={Zhang, Kai and Van Gool, Luc and Timofte, Radu},
  booktitle={IEEE Conference on Computer Vision and Pattern Recognition},
  pages={3217--3226},
  year={2020}
}
@article{zhang2017beyond, % DnCNN
  title={Beyond a gaussian denoiser: Residual learning of deep cnn for image denoising},
  author={Zhang, Kai and Zuo, Wangmeng and Chen, Yunjin and Meng, Deyu and Zhang, Lei},
  journal={IEEE Transactions on Image Processing},
  volume={26},
  number={7},
  pages={3142--3155},
  year={2017}
}
@inproceedings{zhang2017learning, % IRCNN
title={Learning deep CNN denoiser prior for image restoration},
author={Zhang, Kai and Zuo, Wangmeng and Gu, Shuhang and Zhang, Lei},
booktitle={IEEE conference on computer vision and pattern recognition},
pages={3929--3938},
year={2017}
}
@article{zhang2018ffdnet, % FFDNet, FDnCNN
  title={FFDNet: Toward a fast and flexible solution for CNN-based image denoising},
  author={Zhang, Kai and Zuo, Wangmeng and Zhang, Lei},
  journal={IEEE Transactions on Image Processing},
  volume={27},
  number={9},
  pages={4608--4622},
  year={2018}
}
@inproceedings{zhang2018learning, % SRMD
  title={Learning a single convolutional super-resolution network for multiple degradations},
  author={Zhang, Kai and Zuo, Wangmeng and Zhang, Lei},
  booktitle={IEEE Conference on Computer Vision and Pattern Recognition},
  pages={3262--3271},
  year={2018}
}
@inproceedings{zhang2019deep, % DPSR
  title={Deep Plug-and-Play Super-Resolution for Arbitrary Blur Kernels},
  author={Zhang, Kai and Zuo, Wangmeng and Zhang, Lei},
  booktitle={IEEE Conference on Computer Vision and Pattern Recognition},
  pages={1671--1681},
  year={2019}
}
@InProceedings{wang2018esrgan, % ESRGAN, MSRResNet
    author = {Wang, Xintao and Yu, Ke and Wu, Shixiang and Gu, Jinjin and Liu, Yihao and Dong, Chao and Qiao, Yu and Loy, Chen Change},
    title = {ESRGAN: Enhanced super-resolution generative adversarial networks},
    booktitle = {The European Conference on Computer Vision Workshops (ECCVW)},
    month = {September},
    year = {2018}
}
@inproceedings{hui2019lightweight, % IMDN
  title={Lightweight Image Super-Resolution with Information Multi-distillation Network},
  author={Hui, Zheng and Gao, Xinbo and Yang, Yunchu and Wang, Xiumei},
  booktitle={Proceedings of the 27th ACM International Conference on Multimedia (ACM MM)},
  pages={2024--2032},
  year={2019}
}
@inproceedings{zhang2019aim, % IMDN
  title={AIM 2019 Challenge on Constrained Super-Resolution: Methods and Results},
  author={Kai Zhang and Shuhang Gu and Radu Timofte and others},
  booktitle={IEEE International Conference on Computer Vision Workshops},
  year={2019}
}
@inproceedings{yang2021gan,
    title={GAN Prior Embedded Network for Blind Face Restoration in the Wild},
    author={Tao Yang, Peiran Ren, Xuansong Xie, and Lei Zhang},
    booktitle={IEEE Conference on Computer Vision and Pattern Recognition},
    year={2021}
}
Issues
  • train real-world swinIR with the given running sentence

    train real-world swinIR with the given running sentence

    Hello, when I was using "#003 Real-World Image SR" to train my own super-resolution model, I found this sentence in the KAIR/docs/README_SwinIR.md file: "# before training gan, put the PSNR-oriented model into superresolution /swinir_sr_realworld_x4_gan/models/", what is this for? Will there be any impact on training if you do not follow this operation? I did not find the PSNR-oriented model, and I did not find a place to use it in the training code.

    opened by aiaini66 27
  • USRNET training

    USRNET training

    Hi I am a beginner with Super Resolution task I was trying the usrnet.py as given in the repo, I created a similar .json file for usrnet by taking hints from other models. I am having issue with the training. Please provide directions on how to train the model correctly. Screenshot from 2020-08-21 17-39-40

    question 
    opened by Zepharchit 14
  • SwinIR classical Image SR Training using dataparallel

    SwinIR classical Image SR Training using dataparallel

    While training the SwinIR classical Image SR, using dataparallel : **python main_train_psnr.py --opt options/swinir/train_swinir_sr_classical.json**

    file::main_train_psnr.py has training loop. Call to model.test(), gives error:

    Traceback (most recent call last):
      File "main_train_psnr.py", line 256, in <module>
        main()
      File "main_train_psnr.py", line 228, in main
        model.test()
      File "F:\models\model_plain.py", line 186, in test
        self.netG_forward()
      File "F:\models\model_plain.py", line 143, in netG_forward
        self.E = self.netG(self.L)
      File "C:\Users\Anaconda3\envs\pytorch_gpu\lib\site-packages\torch\nn\modules\module.py", line 550, in __call__
        result = self.forward(*input, **kwargs)
      File "C:\Users\Anaconda3\envs\pytorch_gpu\lib\site-packages\torch\nn\parallel\data_parallel.py", line 154, in forward
        return self.module(*inputs[0], **kwargs[0])
      File "C:\Users\Anaconda3\envs\pytorch_gpu\lib\site-packages\torch\nn\modules\module.py", line 550, in __call__
        result = self.forward(*input, **kwargs)
      File "F:\models\network_swinir.py", line 807, in forward
        x = self.conv_after_body(self.forward_features(x)) + x
      File "F:\models\network_swinir.py", line 793, in forward_features
        x = layer(x, x_size)
      File "C:\Users\Anaconda3\envs\pytorch_gpu\lib\site-packages\torch\nn\modules\module.py", line 550, in __call__
        result = self.forward(*input, **kwargs)
      File "F:\models\network_swinir.py", line 485, in forward
        return self.patch_embed(self.conv(self.patch_unembed(self.residual_group(x, x_size), x_size))) + x
      File "C:\Users\Anaconda3\envs\pytorch_gpu\lib\site-packages\torch\nn\modules\module.py", line 550, in __call__
        result = self.forward(*input, **kwargs)
      File "F:\models\network_swinir.py", line 405, in forward
        x = blk(x, x_size)
      File "C:\Users\Anaconda3\envs\pytorch_gpu\lib\site-packages\torch\nn\modules\module.py", line 550, in __call__
        result = self.forward(*input, **kwargs)
      File "F:\models\network_swinir.py", line 258, in forward
        x_windows = window_partition(shifted_x, self.window_size)  # nW*B, window_size, window_size, C
      File "F:\models\network_swinir.py", line 43, in window_partition
        x = x.view(B, H // window_size, window_size, W // window_size, window_size, C)
    RuntimeError: shape '[1, 84, 8, 127, 8, 180]' is invalid for input of size 124480800
    

    The header of file has comment 'training code for MSRResNet'. Seems like the file needs to be modified.

    opened by paragon1234 11
  • Cannot reproduce SwinIR results

    Cannot reproduce SwinIR results

    Dear authors, I ran SwinIR classical super-resolution with python -m torch.distributed.launch --nproc_per_node=8 --master_port=1234 main_train_psnr.py --opt options/swinir/train_swinir_sr_classical.json --dist True, and add test code in it. But the final result for Set5 is 38.25~38.26, which is 0.1 dB lower than reported in Table2 in the paper.

    image

    Do you have any ideas about it? Thanks!

    opened by Pexure 9
  • Size mismatches and missing keys with testing

    Size mismatches and missing keys with testing

    Hi, so after I've trained for a bit I want to actually use this model in another code. So following the example set in main_test, I run the following snippet:

        denoiser = net(in_nc=1, out_nc=1, nc=64, nb=17, act_mode='R')
        denoiser.load_state_dict(torch.load(os.path.join(args.model_dir, args.model_name)), strict=True)
        denoiser.eval()
    

    However when it loads in the state dict, I get a myriad of size mismatches and missing keys. Admittedly I am terminating training early because its currently taking ~10 days to train a network, but I don't understand why it's able to run this model in the training mode but not in testing mode.

    opened by emmajreid 6
  • DatasetUSRNet

    DatasetUSRNet

    20-09-25 03:21:23.915 : <epoch:  5, iter:   5,000, lr:1.000e-04> G_loss: 3.441e-02 
    20-09-25 03:21:23.916 : Saving the model.
    Traceback (most recent call last):
      File "E:/Work/KAIR/main_train_msrresnet_psnr.py", line 219, in <module>
        main()
      File "E:/Work/KAIR/main_train_msrresnet_psnr.py", line 178, in main
        for test_data in test_loader:
      File "D:\anaconda3\lib\site-packages\torch\utils\data\dataloader.py", line 363, in __next__
        data = self._next_data()
      File "D:\anaconda3\lib\site-packages\torch\utils\data\dataloader.py", line 989, in _next_data
        return self._process_data(data)
      File "D:\anaconda3\lib\site-packages\torch\utils\data\dataloader.py", line 1014, in _process_data
        data.reraise()
      File "D:\anaconda3\lib\site-packages\torch\_utils.py", line 395, in reraise
        raise self.exc_type(msg)
    AttributeError: Caught AttributeError in DataLoader worker process 0.
    Original Traceback (most recent call last):
      File "D:\anaconda3\lib\site-packages\torch\utils\data\_utils\worker.py", line 185, in _worker_loop
        data = fetcher.fetch(index)
      File "D:\anaconda3\lib\site-packages\torch\utils\data\_utils\fetch.py", line 44, in fetch
        data = [self.dataset[idx] for idx in possibly_batched_index]
      File "D:\anaconda3\lib\site-packages\torch\utils\data\_utils\fetch.py", line 44, in <listcomp>
        data = [self.dataset[idx] for idx in possibly_batched_index]
      File "E:\Work\KAIR\data\dataset_usrnet.py", line 116, in __getitem__
        return {'L': img_L, 'H': img_H, 'k': k, 'sigma': noise_level, 'sf': self.sf, 'L_path': L_path, 'H_path': H_path}
    AttributeError: 'DatasetUSRNet' object has no attribute 'sf'
    
    
    Process finished with exit code 1
    
    duplicate Solved! 
    opened by zuenko 6
  • When will you publish the training code of SwinIR?

    When will you publish the training code of SwinIR?

    Hi,

    I found the SwinIR very inspiring and the repo says the training code would be released in this repo. May I ask when the training code is going to be released? Thank you.

    Best, Yang

    Solved! 
    opened by yzcv 5
  • DPSR Training Error

    DPSR Training Error

    Thanks for @cszn contribution, DPSR is an amazing job. I was tried to train with my own dataset with main_train_dpsr.py by using pretrained_netG. I used pretrained_netG with dpsr repository's model, DPSRx4.pth. But i got runtime error. RuntimeError: Error(s) in loading state_dict for SRResNet: Missing key(s) in state_dict: "model.3.weight", "model.3.bias", "model.6.weight", "model.6.bias". Unexpected key(s) in state_dict: "model.2.weight", "model.2.bias", "model.5.weight", "model.5.bias".

    How can i fix? Hope your kind help. Thanks

    opened by richardminh 5
  • Can‘t reproduce the same test results on BSD68 using my own USRNET training model.

    Can‘t reproduce the same test results on BSD68 using my own USRNET training model.

    Hi, I trained the USRNet using the code in this repository recently. I haven't found problems in data and network during training. But I got the worse results than yours in the paper. So I'd like to ask for some hints to train the model correctly. I was wondering whether the mannual seed affecting the results. If so, Can you show me your setting of mannual seed during your training? Thanks for your help.

    微信图片_20201104101808 My results were shown above, the blue ones are results in the paper. I can get the same results using the pretrained model download from drive. The red ones are my results which have a large gap between the ones in papers.

    Solved! 
    opened by pigfather0315 5
  • Could you please upload the pre-tained model to Baidu Netdisk ?

    Could you please upload the pre-tained model to Baidu Netdisk ?

    Hello ! I can not download the Model_Zoo from Google. Could you please upload the pre-tained model to Baidu Netdisk if it's convenient? Thank you .

    opened by HaolyShiit 4
  • About the Discriminator_Unet

    About the Discriminator_Unet

    Great work!

    I have a question that in the definition of discriminator_unet:

        def forward(self, x):
            x0 = F.leaky_relu(self.conv0(x), negative_slope=0.2, inplace=True)
            x1 = F.leaky_relu(self.conv1(x0), negative_slope=0.2, inplace=True)
            x2 = F.leaky_relu(self.conv2(x1), negative_slope=0.2, inplace=True)
            x3 = F.leaky_relu(self.conv3(x2), negative_slope=0.2, inplace=True)
    
            # upsample
            x3 = F.interpolate(x3, scale_factor=2, mode='bilinear', align_corners=False)
            x4 = F.leaky_relu(self.conv4(x3), negative_slope=0.2, inplace=True)
    
            x4 = x4 + x2
            x4 = F.interpolate(x4, scale_factor=2, mode='bilinear', align_corners=False)
            x5 = F.leaky_relu(self.conv5(x4), negative_slope=0.2, inplace=True)
    
            x5 = x5 + x1
            x5 = F.interpolate(x5, scale_factor=2, mode='bilinear', align_corners=False)
            x6 = F.leaky_relu(self.conv6(x5), negative_slope=0.2, inplace=True)
    
            x6 = x6 + x0
    
            # extra
            out = F.leaky_relu(self.conv7(x6), negative_slope=0.2, inplace=True)
            out = F.leaky_relu(self.conv8(out), negative_slope=0.2, inplace=True)
            out = self.conv9(out)
    
            return out
    

    In the connection of encoder and decoder, should it be concatenate instead of just add?

    opened by kaaarho 0
  • Question about training dpsr

    Question about training dpsr

    Thank you Kai Zhang. I have a question about training dpsr https://arxiv.org/pdf/2008.13751.pdf. About the optimization of eq. 6a and 6b, in the Algorithm 1, it seems that K iterations are in each training sample. However, I can not find the code for K iterations in neither models/network_dpsr.py or models/model_plain.py, Can you point out the part in which the optimization of eq. 6a and 6b ( K iterations in Algorithm 1 )? Thank you !

    opened by 1144181135 0
  • Question about training USRNet

    Question about training USRNet

    Hello, I have some questions about training USRNet. When I read the training code, I can not find where the optimization of equation 5 and 6. In the lines 149-152 of https://github.com/cszn/KAIR/blob/master/models/model_plain.py, it seems that only l1 loss and conventional backward are used in the code. Can you point out the part in which the optimization of equation 5 and 6? Thank you!

    opened by 1144181135 2
  • Single precision training

    Single precision training

    Hi, First I'd like to congrat you about your great work!

    I'd like to ask whether a single precision training has been taken into consideration for the future, or if it is not suitable for such a task.

    Thank you in advance!

    opened by mawanda-jun 0
  • training image size error

    training image size error

    hi, i am new in this field.

    I tried to reproduce with custom dataset but got this error below,

    i already tried to crop with fix number, but not solved the error.

    RuntimeError: stack expects each tensor to be equal size, but got [3, 48, 48] at entry 0 and [3, 47, 43]

    i am confuse, where this error comes from. thank you.

    opened by EvelyneCalista 0
  • train time

    train time

    I want to get x2 pre_train model . so set the following parameters for training,one epoch cost time about 31s,some calculation,It takes a very long time to complete the training.my server has 3 rtx6000 gpus.is that a normal amount of time? 1640598084796_148CA02A-51AE-4a0c-BC9A-22C4ACB9CA52

    opened by sunyclj 0
  • OST Dataset - stack expects each tensor to be equal size

    OST Dataset - stack expects each tensor to be equal size

    Hi there, thanks for the amazing work!

    I'm traning the SwinIR-classical model recently, according to SwinIR github page SwinIR-M traning dataset including DIV2K, Flickr2K.

    but I want a larger dataset, so I add OST dataset in it.

    but i got an error when execute main_train_psnr.py

    <epoch:  0, iter:     860, lr:2.000e-04> G_loss: 4.096e-02 
    ---1-->   baby.png | 30.40dB
    ---2-->   bird.png | 27.21dB
    ---3--> butterfly.png | 21.32dB
    ---4-->   head.png | 28.58dB
    ---5-->  woman.png | 25.64dB
    <epoch:  0, iter:     860, Average PSNR : 26.63dB
    
    Traceback (most recent call last):
      File "main_train_psnr.py", line 275, in <module>
        main()
      File "main_train_psnr.py", line 183, in main
        for i, train_data in enumerate(train_loader):
      File "/opt/conda/lib/python3.8/site-packages/torch/utils/data/dataloader.py", line 517, in __next__
        data = self._next_data()
      File "/opt/conda/lib/python3.8/site-packages/torch/utils/data/dataloader.py", line 557, in _next_data
        data = self._dataset_fetcher.fetch(index)  # may raise StopIteration
      File "/opt/conda/lib/python3.8/site-packages/torch/utils/data/_utils/fetch.py", line 47, in fetch
        return self.collate_fn(data)
      File "/opt/conda/lib/python3.8/site-packages/torch/utils/data/_utils/collate.py", line 73, in default_collate
        return {key: default_collate([d[key] for d in batch]) for key in elem}
      File "/opt/conda/lib/python3.8/site-packages/torch/utils/data/_utils/collate.py", line 73, in <dictcomp>
        return {key: default_collate([d[key] for d in batch]) for key in elem}
      File "/opt/conda/lib/python3.8/site-packages/torch/utils/data/_utils/collate.py", line 55, in default_collate
        return torch.stack(batch, 0, out=out)
    RuntimeError: stack expects each tensor to be equal size, but got [3, 24, 24] at entry 0 and [3, 24, 20] at entry 6
    

    and my config file is

    , "datasets": {
        "train": {
          "name": "train_dataset"       
          , "dataset_type": "sr"      
          , "dataroot_H": "trainsets/trainH"   // include DIV2K, Flickr2K, OST  
          , "dataroot_L": null               
    
          , "H_size": 96           
    
          , "dataloader_shuffle": true
          , "dataloader_num_workers": 0
          , "dataloader_batch_size": 16      // batch size 1 | 16 | 32 | 48 | 64 | 128. Total batch size =4x8=32 in SwinIR
        }
        , "test": {
          "name": "test_dataset"            // just name
          , "dataset_type": "sr"         // "dncnn" | "dnpatch" | "fdncnn" | "ffdnet" | "sr" | "srmd" | "dpsr" | "plain" | "plainpatch" | "jpeg"
          , "dataroot_H": "testsets/Set5/GTmod12"    
          , "dataroot_L": "testsets/Set5/LRbicx4"                 // path of L testing dataset 
        }
      }
    

    why adding OST dataset will get this error?

    opened by mushding 0
  • Thanks to the author’s KAIR,But...

    Thanks to the author’s KAIR,But...

    Thanks to the author’s KAIR, many techniques for image restoration are very impressive. But for some extreme real-world images: noise + blur + deformation(Many degradation factors at the sam time), the presented technology cannot solve very well, however we human can make up for it in our brain. How much can CV restorate? in what manner?Because I always believe in a promising CV recovery technology:the restoration equals secondary creation.

    opened by QiuPaul 0
  • Bug fix in dist sampler that caused same data order in each epoch

    Bug fix in dist sampler that caused same data order in each epoch

    Please see the warning at the bottom of this page: https://pytorch.org/docs/stable/data.html?highlight=set_epoch . For more details, you may refer to this issue: https://github.com/pytorch/pytorch/issues/31771

    opened by sarvghotra 0
Releases(v1.1)
Owner
Kai Zhang
Image Restoration; Inverse Problems
Kai Zhang
Official repository for "Restormer: Efficient Transformer for High-Resolution Image Restoration". SOTA for motion deblurring, image deraining, denoising (Gaussian/real data), and defocus deblurring.

Restormer: Efficient Transformer for High-Resolution Image Restoration Syed Waqas Zamir, Aditya Arora, Salman Khan, Munawar Hayat, Fahad Shahbaz Khan,

Syed Waqas Zamir 257 Jan 13, 2022
CIFAR-10_train-test - training and testing codes for dataset CIFAR-10

CIFAR-10_train-test - training and testing codes for dataset CIFAR-10

Frederick Wang 2 Jan 7, 2022
Dynamic Attentive Graph Learning for Image Restoration, ICCV2021 [PyTorch Code]

Dynamic Attentive Graph Learning for Image Restoration This repository is for GATIR introduced in the following paper: Chong Mou, Jian Zhang, Zhuoyuan

Jian Zhang 59 Jan 10, 2022
This is my codes that can visualize the psnr image in testing videos.

CVPR2018-Baseline-PSNRplot This is my codes that can visualize the psnr image in testing videos. Future Frame Prediction for Anomaly Detection – A New

Wenhao Yang 12 May 29, 2021
Multi-Stage Progressive Image Restoration

Multi-Stage Progressive Image Restoration Syed Waqas Zamir, Aditya Arora, Salman Khan, Munawar Hayat, Fahad Shahbaz Khan, Ming-Hsuan Yang, and Ling Sh

Syed Waqas Zamir 630 Jan 20, 2022
(under submission) Bayesian Integration of a Generative Prior for Image Restoration

BIGPrior: Towards Decoupling Learned Prior Hallucination and Data Fidelity in Image Restoration Authors: Majed El Helou, and Sabine Süsstrunk {Note: p

Majed El Helou 20 Jan 11, 2022
HINet: Half Instance Normalization Network for Image Restoration

HINet: Half Instance Normalization Network for Image Restoration Liangyu Chen, Xin Lu, Jie Zhang, Xiaojie Chu, Chengpeng Chen Paper: https://arxiv.org

null 229 Jan 18, 2022
This is an implementation for the CVPR2020 paper "Learning Invariant Representation for Unsupervised Image Restoration"

Learning Invariant Representation for Unsupervised Image Restoration (CVPR 2020) Introduction This is an implementation for the paper "Learning Invari

GarField 77 Dec 15, 2021
EDPN: Enhanced Deep Pyramid Network for Blurry Image Restoration

EDPN: Enhanced Deep Pyramid Network for Blurry Image Restoration Ruikang Xu, Zeyu Xiao, Jie Huang, Yueyi Zhang, Zhiwei Xiong. EDPN: Enhanced Deep Pyra

null 61 Jan 14, 2022
Real-ESRGAN aims at developing Practical Algorithms for General Image Restoration.

Real-ESRGAN Colab Demo for Real-ESRGAN . Portable Windows executable file. You can find more information here. Real-ESRGAN aims at developing Practica

Xintao 8.8k Jan 15, 2022
Image restoration with neural networks but without learning.

Warning! The optimization may not converge on some GPUs. We've personally experienced issues on Tesla V100 and P40 GPUs. When running the code, make s

Dmitry Ulyanov 7k Jan 15, 2022
An official repository for Paper "Uformer: A General U-Shaped Transformer for Image Restoration".

Uformer: A General U-Shaped Transformer for Image Restoration Zhendong Wang, Xiaodong Cun, Jianmin Bao and Jianzhuang Liu Paper: https://arxiv.org/abs

Zhendong Wang 269 Jan 11, 2022
Image Restoration Using Swin Transformer for VapourSynth

SwinIR SwinIR function for VapourSynth, based on https://github.com/JingyunLiang/SwinIR. Dependencies NumPy PyTorch, preferably with CUDA. Note that t

Holy Wu 10 Jan 3, 2022
Half Instance Normalization Network for Image Restoration

HINet Half Instance Normalization Network for Image Restoration, based on https://github.com/megvii-model/HINet. Dependencies NumPy PyTorch, preferabl

Holy Wu 3 Dec 12, 2021
Old Photo Restoration (Official PyTorch Implementation)

Bringing Old Photo Back to Life (CVPR 2020 oral)

Microsoft 9.9k Jan 22, 2022
Implements the training, testing and editing tools for "Pluralistic Image Completion"

Pluralistic Image Completion ArXiv | Project Page | Online Demo | Video(demo) This repository implements the training, testing and editing tools for "

Chuanxia Zheng 562 Jan 12, 2022
FuseDream: Training-Free Text-to-Image Generationwith Improved CLIP+GAN Space OptimizationFuseDream: Training-Free Text-to-Image Generationwith Improved CLIP+GAN Space Optimization

FuseDream This repo contains code for our paper (paper link): FuseDream: Training-Free Text-to-Image Generation with Improved CLIP+GAN Space Optimizat

XCL 125 Jan 17, 2022
An image base contains 490 images for learning (400 cars and 90 boats), and another 21 images for testingAn image base contains 490 images for learning (400 cars and 90 boats), and another 21 images for testing

SVM Données Une base d’images contient 490 images pour l’apprentissage (400 voitures et 90 bateaux), et encore 21 images pour fait des tests. Prétrait

Achraf Rahouti 3 Nov 30, 2021