Blind face restoration (BFR) from severely degraded face images in the wild is a very challenging problem. Due to the high illness of the problem and the complex unknown degradation, directly training a deep neural network (DNN) usually cannot lead to acceptable results. Existing generative adversarial network (GAN) based methods can produce better results but tend to generate over-smoothed restorations. Here we provide the GPEN model. GPEN was proposed by first learning a GAN for high-quality face image generation and embedding it into a U-shaped DNN as a prior decoder, then fine-tuning the GAN prior embedded DNN with a set of synthesized low-quality face images. The GAN blocks are designed to ensure that the latent code and noise input to the GAN can be respectively generated from the deep and shallow features of the DNN, controlling the global face structure, local face details and background of the reconstructed image. The proposed GAN prior embedded network (GPEN) is easy-to-implement, and it can generate visually photo-realistic results. Experiments demonstrated that the proposed GPEN achieves significantly superior results to state-of-the-art BFR methods both quantitatively and qualitatively, especially for the restoration of severely degraded face images in the wild.
The user could use the following command to do face enhancement and select the local image as input:
import paddle
from ppgan.faceutils.face_enhancement import FaceEnhancement
faceenhancer = FaceEnhancement()
img = faceenhancer.enhance_from_image(img)
Note: please convert the image to float type, currently does not support int8 type.
In the future, training scripts will be added to facilitate users to train more types of GPEN.
@inproceedings{inproceedings,
author = {Yang, Tao and Ren, Peiran and Xie, Xuansong and Zhang, Lei},
year = {2021},
month = {06},
pages = {672-681},
title = {GAN Prior Embedded Network for Blind Face Restoration in the Wild},
doi = {10.1109/CVPR46437.2021.00073}
}