--- id: gfpgan version: "1.3.8" license: Apache License Version 2.0 license_treatment: permissive maintenance: dormant --- # gfpgan — GFPGAN aims at developing Practical Algorithms for Real-world Face Restoration License: permissive · Maintenance: dormant · Downloads: 284.1K/mo ## 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 above — 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 pip install gfpgan uv add gfpgan 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: unspecified - Install friction: low - Maintenance: dormant - Downloads: 284.1K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags face restoration neural network, enhance blurry faces in photos, ai face upscaling, blind face restoration gan, restore low quality portraits, face super-resolution pytorch, denoise and sharpen faces, face-restoration, gan-based, image-enhancement [View on SkillFed](https://skillfed.io/packages/gfpgan) · [View on PyPI](https://pypi.org/project/gfpgan/)