The overall code framework is shown in the following figure. It mainly consists of four parts - Config, Data, Model and Network.
Let us take the train commad python train.py -opt options/train/train_esrgan.json for example. A sequence of actions will be done after this command.
train.pyis called.- Reads the configuration (a json file) in
options/train/train_esrgan.json, including the configurations for data loader, network, loss, training strategies and etc. The json 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__.pyaccording to different model types). A model mainly consists of two parts - [network structure] and [model definition, e.g., loss definition, optimization and etc]. The network is constructed inmodels/network.pyand the detailed structures are inmodels/modules. - Start to train the model. Other actions like logging, saving intermediate models, validation, updating learning rate and etc are also done during the training.
Moreover, there are utils and userful scripts. A detailed description is provided as follows.
options/ Configure the options for data loader, network structure, model, training strategies and etc.
jsonfile is used to configure options andoptions/options.pywill convert the json file to python dict.jsonfile usesnullforNone; and supports//comments, i.e., in each line, contents after the//will be ignored.- Supports
debugmode, i.e, model name start withdebug_will trigger the debug mode. - The configuration file and descriptions can be found in
options.
data/ A data loader to provide data for training, validation and testing.
- A separate data loader module. You can modify/create data loader to meet your own needs.
- Uses
cv2package to do image processing, which provides rich operations. data/util.pyprovides useful tools.- Now, we convert the images to format NCHW, [0,1], RGB, torch float tensor.
models/ Construct different models for training and testing.
- A model mainly consists of two parts - [network structure] and [model defination, e.g., loss definition, optimization and etc]. The network description is in the Network part.
- Based on the
base_model.py, we define different models, e.g.,SR_model.py,SRGAN_model.py,SRRaGAN_model.pyandSFTGAN_ACD_model.py.
models/modules/ Construct different network architectures.
- The network is constructed in
models/network.pyand the detailed structures are inmodels/modules. - We provide some useful blocks in
block.pyand it is flexible to construct your network structures with these pre-defined blocks. - You can also easily write your own network architecture in a seperate file like
sft_arch.py.
utils/ Provide useful utilities.
- logger.py provides logging service during training and testing.
- Support to use tensorboard to visualize and compare training loss, validation PSNR and etc. Installationand usage can be found here.
- progress_bar.py provides a progress bar which can print the progress.
scripts/ Privide useful scripts.
Details can be found here.
The proposed Supervised method expects the LR and its corresponding HR image as the input. The details of the proposed architecture are shown in the figure below.
Image Super-resolution on LR image is performed using Genertor Network, which is trained using a composite loss consisting of content loss, perceptual loss, adversarial loss, and quality assessment loss.
The quantitative assessment of the proposed method without QA and without discriminator networks carried out on RealSR validation dataset.
The quantitative comparison of the proposed and other existing SR methods on Real SR validation and DIV2KRK datasets.
The comparison of the Super-Resolution results obtained using the Proposed Architecture and Without Quality Loss method and Without Triplet Loss (Vanilla GAN Loss) method on NTIRE-2020 Real world SR challenge testing dataset.
For designing our Code Framework, we have taken reference of the following repository - https://github.com/xinntao/BasicSR




