[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-1419":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":14,"openIssues":15,"contributorsCount":16,"subscribersCount":16,"size":16,"stars1d":16,"stars7d":17,"stars30d":18,"stars90d":16,"forks30d":16,"starsTrendScore":19,"compositeScore":20,"rankGlobal":10,"rankLanguage":10,"license":21,"archived":22,"fork":22,"defaultBranch":23,"hasWiki":24,"hasPages":22,"topics":25,"createdAt":10,"pushedAt":10,"updatedAt":33,"readmeContent":34,"aiSummary":35,"trendingCount":16,"starSnapshotCount":16,"syncStatus":36,"lastSyncTime":37,"discoverSource":38},1419,"GFPGAN","TencentARC\u002FGFPGAN","TencentARC","GFPGAN aims at developing Practical Algorithms for Real-world Face Restoration.","",null,"Python",37466,6280,510,376,0,6,30,1,76,"Other",false,"master",true,[26,27,28,29,30,31,32],"deep-learning","face-restoration","gan","gfpgan","image-restoration","pytorch","super-resolution","2026-06-12 04:00:09","\u003Cp align=\"center\">\n  \u003Cimg src=\"assets\u002Fgfpgan_logo.png\" height=130>\n\u003C\u002Fp>\n\n## \u003Cdiv align=\"center\">\u003Cb>\u003Ca href=\"README.md\">English\u003C\u002Fa> | \u003Ca href=\"README_CN.md\">简体中文\u003C\u002Fa>\u003C\u002Fb>\u003C\u002Fdiv>\n\n\u003Cdiv align=\"center\">\n\u003C!-- \u003Ca href=\"https:\u002F\u002Ftwitter.com\u002F_Xintao_\" style=\"text-decoration:none;\">\n    \u003Cimg src=\"https:\u002F\u002Fuser-images.githubusercontent.com\u002F17445847\u002F187162058-c764ced6-952f-404b-ac85-ba95cce18e7b.png\" width=\"4%\" alt=\"\" \u002F>\n\u003C\u002Fa> -->\n\n[![download](https:\u002F\u002Fimg.shields.io\u002Fgithub\u002Fdownloads\u002FTencentARC\u002FGFPGAN\u002Ftotal.svg)](https:\u002F\u002Fgithub.com\u002FTencentARC\u002FGFPGAN\u002Freleases)\n[![PyPI](https:\u002F\u002Fimg.shields.io\u002Fpypi\u002Fv\u002Fgfpgan)](https:\u002F\u002Fpypi.org\u002Fproject\u002Fgfpgan\u002F)\n[![Open issue](https:\u002F\u002Fimg.shields.io\u002Fgithub\u002Fissues\u002FTencentARC\u002FGFPGAN)](https:\u002F\u002Fgithub.com\u002FTencentARC\u002FGFPGAN\u002Fissues)\n[![Closed issue](https:\u002F\u002Fimg.shields.io\u002Fgithub\u002Fissues-closed\u002FTencentARC\u002FGFPGAN)](https:\u002F\u002Fgithub.com\u002FTencentARC\u002FGFPGAN\u002Fissues)\n[![LICENSE](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FLicense-Apache%202.0-blue.svg)](https:\u002F\u002Fgithub.com\u002FTencentARC\u002FGFPGAN\u002Fblob\u002Fmaster\u002FLICENSE)\n[![python lint](https:\u002F\u002Fgithub.com\u002FTencentARC\u002FGFPGAN\u002Factions\u002Fworkflows\u002Fpylint.yml\u002Fbadge.svg)](https:\u002F\u002Fgithub.com\u002FTencentARC\u002FGFPGAN\u002Fblob\u002Fmaster\u002F.github\u002Fworkflows\u002Fpylint.yml)\n[![Publish-pip](https:\u002F\u002Fgithub.com\u002FTencentARC\u002FGFPGAN\u002Factions\u002Fworkflows\u002Fpublish-pip.yml\u002Fbadge.svg)](https:\u002F\u002Fgithub.com\u002FTencentARC\u002FGFPGAN\u002Fblob\u002Fmaster\u002F.github\u002Fworkflows\u002Fpublish-pip.yml)\n\u003C\u002Fdiv>\n\n1. :boom: **Updated** online demo: [![Replicate](https:\u002F\u002Fimg.shields.io\u002Fstatic\u002Fv1?label=Demo&message=Replicate&color=blue)](https:\u002F\u002Freplicate.com\u002Ftencentarc\u002Fgfpgan). Here is the [backup](https:\u002F\u002Freplicate.com\u002Fxinntao\u002Fgfpgan).\n1. :boom: **Updated** online demo: [![Huggingface Gradio](https:\u002F\u002Fimg.shields.io\u002Fstatic\u002Fv1?label=Demo&message=Huggingface%20Gradio&color=orange)](https:\u002F\u002Fhuggingface.co\u002Fspaces\u002FXintao\u002FGFPGAN)\n1. [Colab Demo](https:\u002F\u002Fcolab.research.google.com\u002Fdrive\u002F1sVsoBd9AjckIXThgtZhGrHRfFI6UUYOo) for GFPGAN \u003Ca href=\"https:\u002F\u002Fcolab.research.google.com\u002Fdrive\u002F1sVsoBd9AjckIXThgtZhGrHRfFI6UUYOo\">\u003Cimg src=\"https:\u002F\u002Fcolab.research.google.com\u002Fassets\u002Fcolab-badge.svg\" alt=\"google colab logo\">\u003C\u002Fa>; (Another [Colab Demo](https:\u002F\u002Fcolab.research.google.com\u002Fdrive\u002F1Oa1WwKB4M4l1GmR7CtswDVgOCOeSLChA?usp=sharing) for the original paper model)\n\n\u003C!-- 3. Online demo: [Replicate.ai](https:\u002F\u002Freplicate.com\u002Fxinntao\u002Fgfpgan) (may need to sign in, return the whole image)\n4. Online demo: [Baseten.co](https:\u002F\u002Fapp.baseten.co\u002Fapplications\u002FQ04Lz0d\u002Foperator_views\u002F8qZG6Bg) (backed by GPU, returns the whole image)\n5. We provide a *clean* version of GFPGAN, which can run without CUDA extensions. So that it can run in **Windows** or on **CPU mode**. -->\n\n> :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](https:\u002F\u002Fgithub.com\u002Fxinntao\u002FReal-ESRGAN\u002Fblob\u002Fmaster\u002Fdocs\u002Fanime_video_model.md)** :blush:\n\nGFPGAN aims at developing a **Practical Algorithm for Real-world Face Restoration**.\u003Cbr>\nIt leverages rich and diverse priors encapsulated in a pretrained face GAN (*e.g.*, StyleGAN2) for blind face restoration.\n\n:question: Frequently Asked Questions can be found in [FAQ.md](FAQ.md).\n\n:triangular_flag_on_post: **Updates**\n\n- :white_check_mark: Add [RestoreFormer](https:\u002F\u002Fgithub.com\u002Fwzhouxiff\u002FRestoreFormer) inference codes.\n- :white_check_mark: Add [V1.4 model](https:\u002F\u002Fgithub.com\u002FTencentARC\u002FGFPGAN\u002Freleases\u002Fdownload\u002Fv1.3.0\u002FGFPGANv1.4.pth), which produces slightly more details and better identity than V1.3.\n- :white_check_mark: Add **[V1.3 model](https:\u002F\u002Fgithub.com\u002FTencentARC\u002FGFPGAN\u002Freleases\u002Fdownload\u002Fv1.3.0\u002FGFPGANv1.3.pth)**, which produces **more natural** restoration results, and better results on *very low-quality* \u002F *high-quality* inputs. See more in [Model zoo](#european_castle-model-zoo), [Comparisons.md](Comparisons.md)\n- :white_check_mark: Integrated to [Huggingface Spaces](https:\u002F\u002Fhuggingface.co\u002Fspaces) with [Gradio](https:\u002F\u002Fgithub.com\u002Fgradio-app\u002Fgradio). See [Gradio Web Demo](https:\u002F\u002Fhuggingface.co\u002Fspaces\u002Fakhaliq\u002FGFPGAN).\n- :white_check_mark: Support enhancing non-face regions (background) with [Real-ESRGAN](https:\u002F\u002Fgithub.com\u002Fxinntao\u002FReal-ESRGAN).\n- :white_check_mark: We provide a *clean* version of GFPGAN, which does not require CUDA extensions.\n- :white_check_mark: We provide an updated model without colorizing faces.\n\n---\n\nIf GFPGAN is helpful in your photos\u002Fprojects, please help to :star: this repo or recommend it to your friends. Thanks:blush:\nOther recommended projects:\u003Cbr>\n:arrow_forward: [Real-ESRGAN](https:\u002F\u002Fgithub.com\u002Fxinntao\u002FReal-ESRGAN): A practical algorithm for general image restoration\u003Cbr>\n:arrow_forward: [BasicSR](https:\u002F\u002Fgithub.com\u002Fxinntao\u002FBasicSR): An open-source image and video restoration toolbox\u003Cbr>\n:arrow_forward: [facexlib](https:\u002F\u002Fgithub.com\u002Fxinntao\u002Ffacexlib): A collection that provides useful face-relation functions\u003Cbr>\n:arrow_forward: [HandyView](https:\u002F\u002Fgithub.com\u002Fxinntao\u002FHandyView): A PyQt5-based image viewer that is handy for view and comparison\u003Cbr>\n\n---\n\n### :book: GFP-GAN: Towards Real-World Blind Face Restoration with Generative Facial Prior\n\n> [[Paper](https:\u002F\u002Farxiv.org\u002Fabs\u002F2101.04061)] &emsp; [[Project Page](https:\u002F\u002Fxinntao.github.io\u002Fprojects\u002Fgfpgan)] &emsp; [Demo] \u003Cbr>\n> [Xintao Wang](https:\u002F\u002Fxinntao.github.io\u002F), [Yu Li](https:\u002F\u002Fyu-li.github.io\u002F), [Honglun Zhang](https:\u002F\u002Fscholar.google.com\u002Fcitations?hl=en&user=KjQLROoAAAAJ), [Ying Shan](https:\u002F\u002Fscholar.google.com\u002Fcitations?user=4oXBp9UAAAAJ&hl=en) \u003Cbr>\n> Applied Research Center (ARC), Tencent PCG\n\n\u003Cp align=\"center\">\n  \u003Cimg src=\"https:\u002F\u002Fxinntao.github.io\u002Fprojects\u002FGFPGAN_src\u002Fgfpgan_teaser.jpg\">\n\u003C\u002Fp>\n\n---\n\n## :wrench: Dependencies and Installation\n\n- Python >= 3.7 (Recommend to use [Anaconda](https:\u002F\u002Fwww.anaconda.com\u002Fdownload\u002F#linux) or [Miniconda](https:\u002F\u002Fdocs.conda.io\u002Fen\u002Flatest\u002Fminiconda.html))\n- [PyTorch >= 1.7](https:\u002F\u002Fpytorch.org\u002F)\n- Option: NVIDIA GPU + [CUDA](https:\u002F\u002Fdeveloper.nvidia.com\u002Fcuda-downloads)\n- Option: Linux\n\n### Installation\n\nWe now provide a *clean* version of GFPGAN, which does not require customized CUDA extensions. \u003Cbr>\nIf you want to use the original model in our paper, please see [PaperModel.md](PaperModel.md) for installation.\n\n1. Clone repo\n\n    ```bash\n    git clone https:\u002F\u002Fgithub.com\u002FTencentARC\u002FGFPGAN.git\n    cd GFPGAN\n    ```\n\n1. Install dependent packages\n\n    ```bash\n    # Install basicsr - https:\u002F\u002Fgithub.com\u002Fxinntao\u002FBasicSR\n    # We use BasicSR for both training and inference\n    pip install basicsr\n\n    # Install facexlib - https:\u002F\u002Fgithub.com\u002Fxinntao\u002Ffacexlib\n    # We use face detection and face restoration helper in the facexlib package\n    pip install facexlib\n\n    pip install -r requirements.txt\n    python setup.py develop\n\n    # If you want to enhance the background (non-face) regions with Real-ESRGAN,\n    # you also need to install the realesrgan package\n    pip install realesrgan\n    ```\n\n## :zap: Quick Inference\n\nWe take the v1.3 version for an example. More models can be found [here](#european_castle-model-zoo).\n\nDownload pre-trained models: [GFPGANv1.3.pth](https:\u002F\u002Fgithub.com\u002FTencentARC\u002FGFPGAN\u002Freleases\u002Fdownload\u002Fv1.3.0\u002FGFPGANv1.3.pth)\n\n```bash\nwget https:\u002F\u002Fgithub.com\u002FTencentARC\u002FGFPGAN\u002Freleases\u002Fdownload\u002Fv1.3.0\u002FGFPGANv1.3.pth -P experiments\u002Fpretrained_models\n```\n\n**Inference!**\n\n```bash\npython inference_gfpgan.py -i inputs\u002Fwhole_imgs -o results -v 1.3 -s 2\n```\n\n```console\nUsage: python inference_gfpgan.py -i inputs\u002Fwhole_imgs -o results -v 1.3 -s 2 [options]...\n\n  -h                   show this help\n  -i input             Input image or folder. Default: inputs\u002Fwhole_imgs\n  -o output            Output folder. Default: results\n  -v version           GFPGAN model version. Option: 1 | 1.2 | 1.3. Default: 1.3\n  -s upscale           The final upsampling scale of the image. Default: 2\n  -bg_upsampler        background upsampler. Default: realesrgan\n  -bg_tile             Tile size for background sampler, 0 for no tile during testing. Default: 400\n  -suffix              Suffix of the restored faces\n  -only_center_face    Only restore the center face\n  -aligned             Input are aligned faces\n  -ext                 Image extension. Options: auto | jpg | png, auto means using the same extension as inputs. Default: auto\n```\n\nIf you want to use the original model in our paper, please see [PaperModel.md](PaperModel.md) for installation and inference.\n\n## :european_castle: Model Zoo\n\n| Version | Model Name  | Description |\n| :---: | :---:        |     :---:      |\n| V1.3 | [GFPGANv1.3.pth](https:\u002F\u002Fgithub.com\u002FTencentARC\u002FGFPGAN\u002Freleases\u002Fdownload\u002Fv1.3.0\u002FGFPGANv1.3.pth) | Based on V1.2; **more natural** restoration results; better results on very low-quality \u002F high-quality inputs. |\n| V1.2 | [GFPGANCleanv1-NoCE-C2.pth](https:\u002F\u002Fgithub.com\u002FTencentARC\u002FGFPGAN\u002Freleases\u002Fdownload\u002Fv0.2.0\u002FGFPGANCleanv1-NoCE-C2.pth) | No colorization; no CUDA extensions are required. Trained with more data with pre-processing. |\n| V1 | [GFPGANv1.pth](https:\u002F\u002Fgithub.com\u002FTencentARC\u002FGFPGAN\u002Freleases\u002Fdownload\u002Fv0.1.0\u002FGFPGANv1.pth) | The paper model, with colorization. |\n\nThe comparisons are in [Comparisons.md](Comparisons.md).\n\nNote that V1.3 is not always better than V1.2. You may need to select different models based on your purpose and inputs.\n\n| Version | Strengths  | Weaknesses |\n| :---: | :---:        |     :---:      |\n|V1.3 |  ✓ natural outputs\u003Cbr> ✓better results on very low-quality inputs \u003Cbr> ✓ work on relatively high-quality inputs \u003Cbr>✓ can have repeated (twice) restorations | ✗ not very sharp \u003Cbr> ✗ have a slight change on identity |\n|V1.2 |  ✓ sharper output \u003Cbr> ✓ with beauty makeup | ✗ some outputs are unnatural |\n\nYou can find **more models (such as the discriminators)** here: [[Google Drive](https:\u002F\u002Fdrive.google.com\u002Fdrive\u002Ffolders\u002F17rLiFzcUMoQuhLnptDsKolegHWwJOnHu?usp=sharing)], OR [[Tencent Cloud 腾讯微云](https:\u002F\u002Fshare.weiyun.com\u002FShYoCCoc)]\n\n## :computer: Training\n\nWe provide the training codes for GFPGAN (used in our paper). \u003Cbr>\nYou could improve it according to your own needs.\n\n**Tips**\n\n1. More high quality faces can improve the restoration quality.\n2. You may need to perform some pre-processing, such as beauty makeup.\n\n**Procedures**\n\n(You can try a simple version ( `options\u002Ftrain_gfpgan_v1_simple.yml`) that does not require face component landmarks.)\n\n1. Dataset preparation: [FFHQ](https:\u002F\u002Fgithub.com\u002FNVlabs\u002Fffhq-dataset)\n\n1. Download pre-trained models and other data. Put them in the `experiments\u002Fpretrained_models` folder.\n    1. [Pre-trained StyleGAN2 model: StyleGAN2_512_Cmul1_FFHQ_B12G4_scratch_800k.pth](https:\u002F\u002Fgithub.com\u002FTencentARC\u002FGFPGAN\u002Freleases\u002Fdownload\u002Fv0.1.0\u002FStyleGAN2_512_Cmul1_FFHQ_B12G4_scratch_800k.pth)\n    1. [Component locations of FFHQ: FFHQ_eye_mouth_landmarks_512.pth](https:\u002F\u002Fgithub.com\u002FTencentARC\u002FGFPGAN\u002Freleases\u002Fdownload\u002Fv0.1.0\u002FFFHQ_eye_mouth_landmarks_512.pth)\n    1. [A simple ArcFace model: arcface_resnet18.pth](https:\u002F\u002Fgithub.com\u002FTencentARC\u002FGFPGAN\u002Freleases\u002Fdownload\u002Fv0.1.0\u002Farcface_resnet18.pth)\n\n1. Modify the configuration file `options\u002Ftrain_gfpgan_v1.yml` accordingly.\n\n1. Training\n\n> python -m torch.distributed.launch --nproc_per_node=4 --master_port=22021 gfpgan\u002Ftrain.py -opt options\u002Ftrain_gfpgan_v1.yml --launcher pytorch\n\n## :scroll: License and Acknowledgement\n\nGFPGAN is released under Apache License Version 2.0.\n\n## BibTeX\n\n    @InProceedings{wang2021gfpgan,\n        author = {Xintao Wang and Yu Li and Honglun Zhang and Ying Shan},\n        title = {Towards Real-World Blind Face Restoration with Generative Facial Prior},\n        booktitle={The IEEE Conference on Computer Vision and Pattern Recognition (CVPR)},\n        year = {2021}\n    }\n\n## :e-mail: Contact\n\nIf you have any question, please email `xintao.wang@outlook.com` or `xintaowang@tencent.com`.\n","GFPGAN 是一个面向真实世界人脸修复的实用算法项目。该项目利用生成对抗网络（GAN）和深度学习技术，能够有效恢复低质量的人脸图像，提升其清晰度与细节表现力。基于 PyTorch 框架开发，支持超分辨率处理等功能，使得模糊或损坏严重的人脸照片得以高质量复原。适用于需要对老旧照片、视频帧中的人脸进行修复增强的各种场景，如家庭相册翻新、影视后期制作等。",2,"2026-06-11 02:43:37","top_all"]