skillfed

gfpgan

GFPGAN aims at developing Practical Algorithms for Real-world Face Restoration

gfpgan v1.3.8 284.1K downloads/30d#8,068 on PyPI37,655
Permissive license Apache License Version 2.0 DORMANT released

What it is and what it does

GFPGAN is a face restoration tool built on PyTorch that uses a generative adversarial network to recover detail and clarity in degraded facial images. It leverages a pretrained StyleGAN2-based facial prior to perform blind restoration—meaning it works on faces of unknown quality without requiring alignment or preprocessing. The package includes multiple model versions (V1, V1.2, V1.3) with different trade-offs between sharpness and naturalness.

The typical workflow is to load a pretrained model, pass an image or folder of images through the restorer, and receive enhanced faces along with optional full-image upscaling via Real-ESRGAN. It depends on basicsr for training and inference infrastructure, facexlib for face detection and helper functions, and standard computer-vision libraries (OpenCV, NumPy, SciPy). The package is designed to run on GPU but includes a clean version that works on CPU.

Use it for:

  • Restore old or low-resolution photographs where faces are blurry or degraded
  • Enhance security camera footage or surveillance images to improve facial clarity
  • Preprocess face images for downstream computer-vision tasks like recognition or analysis
  • Batch upscale and denoise portrait collections for archival or publication
  • Combine with Real-ESRGAN to restore both faces and background details in a single pass

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

GFPGAN restores and enhances degraded faces in images using a generative adversarial network trained on facial priors, producing clearer face details while optionally upscaling the full image.

Yes, if you need face restoration and can work with a dormant package. The library is stable and well-established (37k+ GitHub stars), has no known vulnerabilities, and low install friction. However, expect no active maintenance or updates—use it for production only if you can tolerate a frozen codebase and are comfortable debugging against a 2022-era PyTorch ecosystem.

Install

gfpgan on PyPI

pip

pip install gfpgan

uv

uv add gfpgan

poetry

poetry add gfpgan

Installing gfpgan

Before you install

Low install friction with a pure Python wheel. Requires PyTorch and 12 runtime dependencies including torch, torchvision, and basicsr. The package is dormant (last release 2022-09-16, last commit 2024-07-26), so expect no active maintenance or bug fixes.

License in practice

Licensed under Apache License 2.0 (permissive), allowing commercial and private use with minimal restrictions—suitable for most projects.

Quickstart

pip install gfpgan

from gfpgan import GFPGANer

restorer = GFPGANer(model_path='GFPGANv1.3.pth', upscale=2)
restored_img, restored_faces = restorer.enhance(input_img, has_aligned=False, only_center_face=False, suffix='restored')

Requires a pre-trained model file (e.g., GFPGANv1.3.pth) to be downloaded separately; PyTorch must be installed first.

Verify before relying

  • Whether the package works reliably on Windows or CPU-only systems despite the description mentioning support
  • Current compatibility with modern PyTorch versions beyond what the 2022 release was tested against
  • Performance characteristics and memory requirements for typical image sizes

Package facts

License Apache License Version 2.0 (permissive)
Python support not specified
Install friction low — pure-Python wheel
Runtime dependencies 12 — basicsr, facexlib, lmdb, numpy, opencv-python, pyyaml, scipy, tb-nightly, torch, torchvision, tqdm, yapf
Maintenance dormant — 1,428 days since the last release
Last repo commit
First released
Downloads 284,085/month — #8,068 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: gfpgan-1.3.8-py3-none-any.whl

Keywords: computer vision, pytorch, image restoration, super-resolution, face restoration, gan, gfpgan

Development Status :: 4 - BetaLicense :: OSI Approved :: Apache Software LicenseOperating System :: OS IndependentProgramming Language :: Python :: 3Programming Language :: Python :: 3.7Programming Language :: Python :: 3.8

Tags

face restoration neural networkenhance blurry faces in photosai face upscalingblind face restoration ganrestore low quality portraitsface super-resolution pytorchdenoise and sharpen faces
face-restorationgan-basedimage-enhancement

More Artificial Intelligence packages

Further reading