GAN.html" title=GFPGAN>GFPGAN__0">GAN.html" title=GFPGAN>GFPGAN 简述
-
GAN.html" title=GFPGAN>GFPGAN (Generative Facial Prior GAN) 是一种基于生成对抗网络(GAN)的面部图像修复与增强模型。它由腾讯 ARC Lab 的研究团队开发,目的是以高效和高质量的方式修复低分辨率、受损或老化的人脸图像,同时保留其真实感和身份一致性。GAN.html" title=GFPGAN>GFPGAN 是当前图像处理领域的热门技术之一,尤其在图像复原和增强领域表现突出。
-
应用场景
GAN.html" title=GFPGAN>GFPGAN__22">GAN.html" title=GFPGAN>GFPGAN 介绍
- GitHub:https://github.com/TencentARC/GAN.html" title=GFPGAN>GFPGAN
- 论文:https://arxiv.org/pdf/2101.04061
- 环境依赖:
- Python >= 3.7 (Recommend to use Anaconda or Miniconda)
- PyTorch >= 1.7
- Option: NVIDIA GPU + CUDA
- Option: Linux
- 克隆仓库:
git clone https://github.com/TencentARC/GAN.html" title=GFPGAN>GFPGAN.git
cd GAN.html" title=GFPGAN>GFPGAN
- 安装依赖包:
# 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 facexlibpip install -r requirements.txt
python setup.py develop# If you want to enhance the background (non-face) regions with Real-ESRGAN,
# you also need to install the realesrgan package
pip install realesrgan
- 下载预训练模型:
wget https://github.com/TencentARC/GAN.html" title=GFPGAN>GFPGAN/releases/download/v1.3.0/GAN.html" title=GFPGAN>GFPGANv1.3.pth -P experiments/pretrained_models
- 快速推理:
python inference_gfpgan.py -i inputs/whole_imgs -o results -v 1.3 -s 2
Usage: python inference_gfpgan.py -i inputs/whole_imgs -o results -v 1.3 -s 2 [options]...-h show this help-i input Input image or folder. Default: inputs/whole_imgs-o output Output folder. Default: results-v version GAN.html" title=GFPGAN>GFPGAN model version. Option: 1 | 1.2 | 1.3. Default: 1.3-s upscale The final upsampling scale of the image. Default: 2-bg_upsampler background upsampler. Default: realesrgan-bg_tile Tile size for background sampler, 0 for no tile during testing. Default: 400-suffix Suffix of the restored faces-only_center_face Only restore the center face-aligned Input are aligned faces-ext Image extension. Options: auto | jpg | png, auto means using the same extension as inputs. Default: auto
- 模型版本对比介绍:
- 提供了基础模型可供自行训练: