| Dataset | Size | Content |
|---------|------|---------|
| FFHQ‑1024 (official StyleGAN2 pre‑training) | 70 k high‑quality portraits | Balanced gender/ethnicity, diverse ages, backgrounds. |
| Synthetic Degradation Pipeline (used for BFR) | N/A (on‑the‑fly) | Randomly sampled combinations of:
• Down‑sampling factors (2‑× to 16‑×)
• Gaussian blur (σ = 0‑3)
• Motion blur (kernel lengths up to 25 px)
• JPEG compression (Q = 10‑100)
• Additive Gaussian noise (σ = 0‑25)
• Random color shift (γ, contrast). |
| Real‑World BFR Test Set (e.g., CelebA‑HQ degraded, LFW‑BFR) | 5 k images | For evaluation only, not used in training. |
Training objectives (combined with weighting coefficients):
[ \beginaligned \mathcalL\texttotal &= \lambda\textpix \mathcalL\textpixel ;+; \lambda\textperc \mathcalL\textperc ;+; \lambda\textid \mathcalL\textid ;+; \lambda\textadv \mathcalL\textadv ;+; \lambda\textlpips \mathcalL_\textlpips \ \endaligned ]
Typical weighting (as reported in the original GPEN paper): gpen-bfr-2048.pth
| Loss | λ | |------|---| | Pixel (L1) | 1.0 | | Perceptual (VGG‑19 relu2_2) | 0.05 | | Identity (ArcFace cosine) | 0.1 | | Adversarial (R1) | 0.005 | | LPIPS | 0.1 |
Training lasted ~1 M iterations on 8 × NVIDIA A100 GPUs (mixed‑precision, Adam optimizer, lr = 2e‑4 → 2e‑5 after 800 k steps).
The 2048 checkpoint is the result of fine‑tuning the 1024‑pixel model on a progressively‑grown version of StyleGAN2 (weights duplicated to support 2048 output). No additional data beyond the synthetic pipeline was introduced; the model simply learns to extrapolate the StyleGAN2 latent space to higher spatial resolution. | Dataset | Size | Content | |---------|------|---------|
| Attribute | Value |
|-----------|-------|
| File type | PyTorch checkpoint (torch.save) |
| Size on disk | ≈ 2.1 GB (fp32) – ~1.1 GB when saved with torch.save(..., _use_new_zipfile_serialization=False, pickle_protocol=4) and torch.save(..., dtype=torch.float16) |
| Top‑level keys | 'encoder', 'mapper', 'generator', 'args' |
| encoder | state_dict of a ResNet‑50 (BN layers stripped) |
| mapper | 2‑layer MLP (512 → 512) plus LayerNorm |
| generator | StyleGAN2 weights (including the new 2048‑pixel synthesis blocks) |
| args | Namespace containing training hyper‑parameters, input resolution, output resolution, and a version string (GPEN-BFR-v2.0-2048). |
| Compatibility | Requires PyTorch ≥ 1.8 and CUDA ≥ 11.0 (or CPU‑only fallback). The checkpoint can be loaded on any device with the same architecture (ResNet‑50 + StyleGAN2). |
Note: The checkpoint does not contain the optimizer state, learning‑rate scheduler, or training logs – only the model parameters needed for inference.
You generally don't run this file by double-clicking it. Instead, you place it inside the weights folder of a GPEN implementation. | Attribute | Value | |-----------|-------| | File
A typical workflow using a script (like the popular run_gpen.py) looks like this:
python run_gpen.py --input my_blurry_face.jpg \
--output restored_face.png \
--model_path ./weights/gpen-bfr-2048.pth \
--size 2048 \
--face_align
Pro Tip: Because this model expects a 2048x2048 input, you must run a face alignment and cropping step first. If you feed it a full-body photo, it will either crash or produce a nightmare of artifacts. The model only understands faces.