1.paper:Enhancing Image Rescaling Using High Frequency Guidance and Attentions in Downscaling and Upscaling Network
Python 3 (Recommend to use Anaconda)
2.2. install pytorch, reference url: https://pytorch.org.
PyTorch >= 1.0
NVIDIA GPU + CUDA
pip install numpy opencv-python lmdb pyyaml
PyTorch >= 1.1: pip install tb-nightly future
PyTorch == 1.0: pip install tensorboardX
Commonly used training and testing datasets can be downloaded here.
url: https://pan.baidu.com/s/1HlM1Mex-Glgd76ZnB42bFA?pwd=vq97 提取码:vq97
First set a config file in options/train/, then run as following:
python train.py -opt options/train/train_DSNetSRNet_x2.yml
First set a config file in options/test/, then run as following:
python test.py -opt options/test/test_DSNetSRNet_x2.yml
The code framework follows BasicSR. It mainly consists of four parts - Config, Data, Model and Network.
Let us take the train command python train.py -opt options/train/train_DSNetSRNet_x2.yml for example. A sequence of actions will be done after this command.
train.pyis called.- Reads the configuration in
options/train/train_DSNetSRNet_x2.yml, including the configurations for data loader, network, loss, training strategies and etc. The config file is processed byoptions/options.py. - Creates the train and validation data loader. The data loader is constructed in
data/__init__.pyaccording to different data modes. - Creates the model (is constructed in
models/__init__.py. - Start to train the model. Other actions like logging, saving intermediate models, validation, updating learning rate and etc are also done during the training.