We take the classical SR X4 with DIV2K for example.
1. Prepare the training dataset: [DIV2K](https://data.vision.ee.ethz.ch/cvl/DIV2K/). More details are in [DatasetPreparation.md](DatasetPreparation.md#image-super-resolution)
1. Prepare the validation dataset: Set5. You can download with [this guidance](DatasetPreparation.md#common-image-sr-datasets)
1. Modify the config file in [`options/train/SwinIR/train_SwinIR_SRx4_scratch.yml`](../options/train/SwinIR/train_SwinIR_SRx4_scratch.yml) accordingly.
1. Train with distributed training. More training commands are in [TrainTest.md](TrainTest.md).
1. Download pre-trained models from the [**official SwinIR repo**](https://github.com/JingyunLiang/SwinIR/releases/tag/v0.0) to the `experiments/pretrained_models/SwinIR` folder.
[wandb](https://www.wandb.com/) can be viewed as a cloud version of tensorboard. One can easily view training processes and curves in wandb. Currently, we only sync the tensorboard log to wandb. So we should also turn on tensorboard when using wandb.
Configuration file:
```yml
ogger:
# Whether to tensorboard logger
use_tb_logger:true
# Whether to use wandb logger. Currently, wandb only sync the tensorboard log. So we should also turn on tensorboard when using wandb
wandb:
# wandb project name. Default is None, that is not using wandb.
# Here, we use the basicsr wandb project: https://app.wandb.ai/xintao/basicsr
project:basicsr
# If resuming, wandb id could automatically link previous logs
resume_id:~
```
**[Examples of training curves in wandb](https://app.wandb.ai/xintao/basicsr)**
> FID measures the similarity between two datasets of images. It was shown to correlate well with human judgement of visual quality and is most often used to evaluate the quality of samples of Generative Adversarial Networks.
> FID is calculated by computing the [Fréchet distance](https://en.wikipedia.org/wiki/Fr%C3%A9chet_distance) between two Gaussians fitted to feature representations of the Inception network.
References
- https://github.com/mseitzer/pytorch-fid
-[GANs Trained by a Two Time-Scale Update Rule Converge to a Local Nash Equilibrium](https://arxiv.org/abs/1706.08500)
-[Are GANs Created Equal? A Large-Scale Study](https://arxiv.org/abs/1711.10337)
- All the FFHQ inception feature statistics calculated on the resized 299 x 299 size.
-`inception_FFHQ_256_stylegan2_pytorch-abba9d31.pth` is converted from the statistics in [stylegan2-pytorch](https://github.com/rosinality/stylegan2-pytorch).
> FID measures the similarity between two datasets of images. It was shown to correlate well with human judgement of visual quality and is most often used to evaluate the quality of samples of Generative Adversarial Networks.
> FID is calculated by computing the [Fréchet distance](https://en.wikipedia.org/wiki/Fr%C3%A9chet_distance) between two Gaussians fitted to feature representations of the Inception network.
参考
- https://github.com/mseitzer/pytorch-fid
-[GANs Trained by a Two Time-Scale Update Rule Converge to a Local Nash Equilibrium](https://arxiv.org/abs/1706.08500)
-[Are GANs Created Equal? A Large-Scale Study](https://arxiv.org/abs/1711.10337)
- All the FFHQ inception feature statistics calculated on the resized 299 x 299 size.
-`inception_FFHQ_256_stylegan2_pytorch-abba9d31.pth` is converted from the statistics in [stylegan2-pytorch](https://github.com/rosinality/stylegan2-pytorch).
- track name. There are four tracks in the NTIRE 2019 Challenges on Video Restoration and Enhancement:
-**SR**: super-resolution with a fixed downsampling kernel (MATLAB bicubic downsampling kernel is frequently used). Most of the previous video SR methods focus on this setting.
-**SRblur**: the inputs are also degraded with motion blur.
-**deblur**: standard deblurring (motion blur).
-**deblurcomp**: motion blur + video compression artifacts.
- model complexity
-**L** (Large): # of channels = 128, # of back residual blocks = 40. This setting is used in our competition submission.
-**M** (Moderate): # of channels = 64, # of back residual blocks = 10.
<sup>1</sup> The official results are obtained by running the official codes and models. Note that TOFlow does not provide a strategy for border frame recovery and we simply use a `replicate` strategy for border frames. <br/>
<sup>2</sup> The converted model has slightly different results, due to different implementation. And we use `new_info` strategy for border frames. <br/>
<sup>3</sup> Y or RGB denotes the evaluation on Y (luminance) or RGB channels.
- track name. There are four tracks in the NTIRE 2019 Challenges on Video Restoration and Enhancement:
-**SR**: super-resolution with a fixed downsampling kernel (MATLAB bicubic downsampling kernel is frequently used). Most of the previous video SR methods focus on this setting.
-**SRblur**: the inputs are also degraded with motion blur.
-**deblur**: standard deblurring (motion blur).
-**deblurcomp**: motion blur + video compression artifacts.
- model complexity
-**L** (Large): # of channels = 128, # of back residual blocks = 40. This setting is used in our competition submission.
-**M** (Moderate): # of channels = 64, # of back residual blocks = 10.
<sup>1</sup> The official results are obtained by running the official codes and models. Note that TOFlow does not provide a strategy for border frame recovery and we simply use a `replicate` strategy for border frames. <br/>
<sup>2</sup> The converted model has slightly different results, due to different implementation. And we use `new_info` strategy for border frames. <br/>
<sup>3</sup> Y or RGB denotes the evaluation on Y (luminance) or RGB channels.
Please run the commands in the root path of `BasicSR`. <br>
In general, both the training and testing include the following steps:
1. Prepare datasets. Please refer to [DatasetPreparation.md](DatasetPreparation.md)
1. Modify config files. The config files are under the `options` folder. For more specific configuration information, please refer to [Config](Config.md)
1.[Optional] You may need to download pre-trained models if you are testing or using pre-trained models. Please see [ModelZoo](ModelZoo.md)
1. Run commands. Use [Training Commands](#Training-Commands) or [Testing Commands](#Testing-Commands) accordingly.
- :white_check_mark: Oct 5, 2021. Add **ECBSR training and testing** codes: [ECBSR](https://github.com/xindongzhang/ECBSR).
> ACMMM21: Edge-oriented Convolution Block for Real-time Super Resolution on Mobile Devices <br>
> Xindong Zhang, Hui Zeng, Lei Zhang
- :white_check_mark: Sep 2, 2021. Add **SwinIR training and testing** codes: [SwinIR](https://github.com/JingyunLiang/SwinIR) by [Jingyun Liang](https://github.com/JingyunLiang). More details are in [HOWTOs.md](docs/HOWTOs.md#how-to-train-swinir-sr)
> ICCVW21: SwinIR: Image Restoration Using Swin Transformer <br>
> Jingyun Liang, Jiezhang Cao, Sun, Guolei Sun, Kai Zhang, Luc Van Gool and Radu Timofte
- :white_check_mark: Aug 5, 2021. Add NIQE, which produces the same results as MATLAB (both are 5.7296 for tests/data/baboon.png).
- :white_check_mark: July 31, 2021. Add **bi-directional video super-resolution** codes: [**BasicVSR** and IconVSR](https://arxiv.org/abs/2012.02181).
> CVPR21: BasicVSR: The Search for Essential Components in Video Super-Resolution and Beyond <br>
- :white_check_mark: July 20, 2021. Add **dual-blind face restoration** codes: [HiFaceGAN](https://github.com/Lotayou/Face-Renovation) codes by [Lotayou](https://lotayou.github.io/).
- :white_check_mark: Nov 29, 2020. Add **ESRGAN** and **DFDNet**[colab demo](../colab)