/unpaired_face_sr

To learn image super-resolution, use a GAN to learn how to do image degradation first, ECCV 2018

Primary LanguagePython

Intro

This repo re-produced paper including training codes. I wrote this codes from here, where you can only get the test code, and implemented traing parts following the paper as much as I can. Because some hyper-parameters, such as the number of channels for each layer in High-to-Low generator and discriminators, were missing in the paper, they were set by my own choice.

In the paper, they used the spectral normalization. The spectral normalization code used in here is adopted from repo.

In this repo, files with prefix yoon_ are additionally impelmantatied files to the authors' repo.

Adrian Bulat, Jing Yang, Georgios Tzimiropoulos
"To learn image super-resolution, use a GAN to learn how to do image degradation first" in ECCV2018

Requirements

Pytorch, Opencv, numpy, ...

Data

  • Trainset is in Dataset. HIGH is the training high resolution images. LOW is the training low resolution images
  • Testset is testset.tar
  • locate the data folders using High_Data and Low_Data variables in yoon_data.py.

Running testing

CUDA_VISIBLE_DEVICES=0, python model_evaluation.py 

Fid Calculation

CUDA_VISIBLE_DEVICES=0, python fid_score.py /Dataset/HIGH/SRtrainset_2/ test_res/

This code is from https://github.com/mseitzer/pytorch-fid

Running training

python yoon_train.py --gpu [your_gpu_num]

You can replace [your_gpu_num] with a number (gpu id).

If your dataset folders are different from the default setting, you have to locate the folders using High_Data and Low_Data variables in yoon_data.py.

Re-produced results

result1 result2 result3 result4 result5

License

This project is licensed under the MIT License