Full explanation of this project can be found here.
- Python 3.7
- CUDA 10.1
- torch==1.5.1
- torchvision==0.6.1
- tensorflow>=1.15.4
- opencv-python
- dlib
- scipy==1.4.1
- tqdm
- imgaug
- torchmetrics
- pytorch-fid
The script to train the model using FFHQ dataset is available at train.py
. The config for running this script can be found at config/base.json
and config/psfrgan/train.json
.
The script to generate low-resolution (LR) face images and ground truth high-resolution (HR) face images from 1024x1024 CelebAHQ dataset for testing purpose is available at downsample_psfrgan.py
. The config for running this script can be found at config/downsample.json
.
The script to generate the predicted super-resolution (SR) face images is available at test_psfrgan.py
. The config for running this script can be found at config/base.json
and config/psfrgan/test.json
.
The script to evaluate the predicted SR face images against ground truth HR face images is available at evaluate_psfrgan.py
. The config for running this script can be found at config/evaluate.json
. The script will produce PSNR, LPIPS, and SSIM score. To retrieve FID score, simply run python -m pytorch_fid <path/to/sr-folder> <path/to/hr-folder>
.
The script to prepare your own test images from real LR face images is available at preprocess_psfrgan.py
. This script will crop and align the real faces so that it is ready to be used to evaluate the model. The config for running this script is available at config/preprocess.json
.