技能创建器
skill-creator
创建、改进和评估自定义技能,把专业流程转化为可重复使用的 AI 能力。
gfpgan【数据与研究】Use GFPGAN for face-restoration inference, model-version selection, training/data preparation, checkpoint conversion, and package troubleshooting.
独立 GitHub 快照 · 自动分类 · 以原作者文档为准
Use this repo skill when a user asks about gfpgan, GFPGAN face restoration, blind real-world face enhancement, GFPGAN model versions, the GFPGANer helper API, the inference_gfpgan.py workflow, or GFPGAN training and FFHQ degradation data preparation.
sub-skills/inference/: restore faces from images or folders, choose GFPGAN versions (1, 1.2, 1.3, 1.4, RestoreFormer), use aligned crop mode, call the GFPGANer API, interpret output folders, and debug checkpoint/device/image failures.sub-skills/training/: prepare FFHQ-style data, configure FFHQDegradationDataset, run BasicSR-backed GFPGAN training, inspect GFPGANModel, generate landmark files, and convert bilinear/original checkpoints into clean checkpoints.GFPGAN is a PyTorch package named gfpgan. A typical runtime environment needs PyTorch, TorchVision, BasicSR, facexlib, OpenCV, LMDB, NumPy, PyYAML, SciPy, and tqdm. For image restoration only, install GFPGAN and its base dependencies first; install realesrgan only when background upsampling is required.
python scripts/check_env.py
Read references/installation.md before changing PyTorch/CUDA wheels, installing optional Real-ESRGAN, or using the original paper model that depends on BasicSR extension/JIT behavior.
1.3.8.gfpgan.utils.GFPGANer(model_path, upscale=2, arch='clean', channel_multiplier=2, bg_upsampler=None, device=None).GFPGANer.enhance(img, has_aligned=False, only_center_face=False, paste_back=True, weight=0.5) returns cropped faces, restored faces, and optionally the pasted-back restored image.1.2, 1.3, 1.4) do not require custom CUDA extensions; the original paper model (1) uses the original architecture and may need BasicSR JIT/extension setup.references/installation.md: install variants, dependency roles, CUDA/CPU notes, optional Real-ESRGAN, and original-model extension guidance.references/troubleshooting.md: cross-cutting package import, checkpoint, CUDA, OpenCV, BasicSR, and optional dependency failures.references/repo-provenance.md: source commit, dirty-state baseline, package version, and evidence paths used to generate this skill.references/repo-routing-metadata.json: structured DisCo router metadata used during managed repo-skill import.scripts/check_env.py: verifies importability, important signatures, package metadata, CUDA visibility, and optional dependency availability without downloading model weights.GFPGANer.enhance, start with sub-skills/inference/.options/train_gfpgan_v1*.yml, start with sub-skills/training/.