TencentARC /GFPGAN
GFPGAN aims at developing Practical Algorithms for Real-world Face Restoration.
★ 37,704⑂ 6,279👁 510⑃ 65● 511▤ 8
More from this author
+3
Daily
+2
Weekly
37,704
stars
6,279
forks
510
watchers
65
prs
511
issues
8
releases
README
English | 简体中文
--
1. :boom: Updated online demo: . Here is the backup.
1. :boom: Updated online demo:
1. Colab Demo for GFPGAN ; (Another Colab Demo for the original paper model)
:rocket: Thanks for your interest in our work. You may also want to check our new updates on the tiny models for anime images and videos in Real-ESRGAN :blush:
GFPGAN aims at developing a Practical Algorithm for Real-world Face Restoration.
It leverages rich and diverse priors encapsulated in a pretrained face GAN (e.g., StyleGAN2) for blind face restoration.
:question: Frequently Asked Questions can be found in FAQ.md.
:triangular_flag_on_post: Updates
- :white_check_mark: Add RestoreFormer inference codes.
- :white_check_mark: Add V1.4 model, which produces slightly more details and better identity than V1.3.
- :white_check_mark: Add V1.3 model, which produces more natural restoration results, and better results on very low-quality / high-quality inputs. See more in Model zoo, Comparisons.md
- :white_check_mark: Integrated to Huggingface Spaces with Gradio. See Gradio Web Demo.
- :white_check_mark: Support enhancing non-face regions (background) with Real-ESRGAN.
- :white_check_mark: We provide a clean version of GFPGAN, which does not require CUDA extensions.
- :white_check_mark: We provide an updated model without colorizing faces.
---
If GFPGAN is helpful in your photos/projects, please help to :star: this repo or recommend it to your friends. Thanks:blush:
Other recommended projects:
:arrow_forward: Real-ESRGAN: A practical algorithm for general image restoration
:arrow_forward: BasicSR: An open-source image and video restoration toolbox
:arrow_forward: facexlib: A collection that provides useful face-relation functions
:arrow_forward: HandyView: A PyQt5-based image viewer that is handy for view and comparison
---
:book: GFP-GAN: Towards Real-World Blind Face Restoration with Generative Facial Prior
[Paper]   [Project Page]   [Demo]
Xintao Wang, Yu Li, Honglun Zhang, Ying Shan
Applied Research Center (ARC), Tencent PCG
---
:wrench: Dependencies and Installation
- Python = 3.7 (Recommend to use Anaconda or Miniconda)
- PyTorch = 1.7
- Option: NVIDIA GPU + CUDA
- Option: Linux
Installation
We now provide a clean version of GFPGAN, which does not require customized CUDA extensions.
If you want to use the original model in our paper, please see PaperModel.md for installation.
1. Clone repo
bash
git clone https://github.com/TencentARC/GFPGAN.git
cd GFPGAN
1. Install dependent packages
bash
Install basicsr - https://github.com/xinntao/BasicSR
We use BasicSR for both training and inference
pip install basicsr
Install facexlib - https://github.com/xinntao/facexlib
We use face detection and face restoration helper in the facexlib package
pip install facexlib
pip install -r requirements.txt
python setup.py develop
If you want to enhance the backTop issues
#104have trouble export "GFPGANCleanv1-NoCE-C2.pth" to ONNX18 comments · 2021-12-01#545Issues with PyTorch Distributed Training on Google Colab12 comments · 2024-05-10#334Improve inference time. 12 comments · 2023-02-09#275GFPGAN to TorchScript/TensorRT10 comments · 2022-09-27#215No module named 'basicsr.losses.gan_loss'10 comments · 2022-07-13#93Training failed in single GPU10 comments · 2021-11-09#25Is this possible, to improve?10 comments · 2021-07-24#205Black Background, with enhanced face9 comments · 2022-06-27
Discussions
#648Request for 30 Free Runs Per Day for GFPGAN0 comments · 2026-08-22#639GFPGAN smart optimizations0 comments · 2025-12-27#624CodeBoarding diagrams0 comments · 2025-08-15#616Is commercial use allowed?0 comments · 2025-04-16#591Finetuning GFPGAN0 comments · 2024-11-14#573Erro em "3. Inference"0 comments · 2024-09-16#567Error CUDA out of memory0 comments · 2024-08-11#565Model for side face enhansion0 comments · 2024-08-09
Latest release
GFPGAN v1.3.8 Release Note v1.3.8 2022-09-16🚀 See you again 😸 ✨ Highlights ✅ remove codeformer