Old photographs suffer from complex, co-occurring degradations β scratches, stains, fading, occlusions, and loss of fine detail β that no single restoration model can adequately address. We present HyMPOR, a hybrid multi-stage pipeline that sequentially applies state-of-the-art models for scratch detection and removal, face enhancement, object removal via segmentation-guided inpainting, and colorization. Evaluated on both synthetic and real damaged photographs, HyMPOR achieves superior quantitative scores and perceptually compelling results across all degradation types.
Everything runs in Google Colab β no manual setup, no separate weight downloads.
- Click the Open in Colab badge above.
- Set the runtime to GPU: Runtime βΈ Change runtime type βΈ T4 GPU.
- Run the first cell. It automatically downloads the complete project (code + all pre-trained weights) from the latest Release and extracts it.
- Run the remaining cells in order to restore your photo.
The full project (~10 GB) is split into parts in the Release and reassembled automatically by the first cell. The first run takes 10β20 minutes depending on connection speed; afterwards everything is cached for the session.
Input (Damaged Old Photo)
β
βΌ
βββββββββββββββββββββββββββββββββββββββ
β Stage 1 β Scratch & Damage Removal β β Bringing Old Photos Back to Life
β Global restoration + face detectionβ
βββββββββββββββββββ¬ββββββββββββββββββββ
β
βΌ
βββββββββββββββββββββββββββββββββββββββ
β Stage 2 β Object / Occlusion β β SAM2 + AOT-GAN
β Segmentation β Inpainting β
βββββββββββββββββββ¬ββββββββββββββββββββ
β
βΌ
βββββββββββββββββββββββββββββββββββββββ
β Stage 3 β Face Enhancement β β GFPGAN
β Blind face restoration via GAN β
βββββββββββββββββββ¬ββββββββββββββββββββ
β
βΌ
βββββββββββββββββββββββββββββββββββββββ
β Stage 4 β Colorization β β DeOldify
β Self-attention GAN colorization β
βββββββββββββββββββ¬ββββββββββββββββββββ
β
βΌ
Output (Restored Photo)
The project bundles both GFPGAN face-enhancement weights β v1.4 (default) and v1.3. You can switch between them by editing a single line in the GFPGAN cell (Step 3):
# Default β v1.4
GFPGAN_WEIGHTS = f'{GFPGAN_DIR}/experiments/pretrained_models/GFPGANv1.4.pth'
# To use v1.3 instead, change 1.4 β 1.3:
GFPGAN_WEIGHTS = f'{GFPGAN_DIR}/experiments/pretrained_models/GFPGANv1.3.pth'Both weights are included in the project, so no extra download is needed β just change the number and re-run the cell.
| # | Module | Purpose | Official Repo |
|---|---|---|---|
| 1 | Bringing Old Photos Back to Life | Scratch detection & global restoration | microsoft/Bringing-Old-Photos-Back-to-Life |
| 2 | SAM2 | Object segmentation & mask generation | facebookresearch/sam2 |
| 3 | AOT-GAN | Inpainting of segmented regions | researchmm/AOT-GAN-for-Inpainting |
| 4 | GFPGAN | Blind face enhancement | TencentARC/GFPGAN |
| 5 | DeOldify | Automatic colorization | jantic/DeOldify |
β All pre-trained weights are bundled in the Release and downloaded automatically by the notebook. There is nothing to download or place manually.
HyMPOR/
βββ HyMPOR_GitHub.ipynb # Main Colab notebook β start here
βββ pipeline/ # Core pipeline code
β βββ run.py # Orchestrator (SAM2 β selector β AOT-GAN)
β βββ config.py # Central configuration
β βββ segmentation.py # SAM2 segmentation
β βββ inpainting.py # AOT-GAN inpainting
β βββ selector.py # Content-aware weight selector
β
βββ modules/
βββ Bringing_Old_Photos_Back_to_Life/ # Stage 1
βββ SAM2/ # Stage 2a
βββ AOT_GAN/ # Stage 2b
βββ GFPGAN/ # Stage 3
βββ DeOldify/ # Stage 4
| Metric | Type | Range | Better |
|---|---|---|---|
| PSNR | Pixel-level fidelity | dB | β Higher |
| SSIM | Structural similarity | [0, 1] | β Higher |
| LPIPS | Perceptual quality | [0, 1] | β Lower |
| BRISQUE | No-reference quality (spatial) | [0, 100] | β Lower |
| MANIQA | No-reference quality (transformer) | [0, 1] | β Higher |
If you find this work useful, please cite:
@article{HyMPOR2026,
title = {A Hybrid Multi-Stage Pipeline for Restoring Damaged and Occluded Old Photographs},
author = {Anas Hameed Ali},
journal = {Under Review},
year = {2026}
}This work builds upon several outstanding open-source projects:
- Bringing Old Photos Back to Life β Microsoft Research
- SAM2 β Meta AI Research
- AOT-GAN β Zeng, Yanhong and Fu, Jianlong and Chao, Hongyang and Guo, Baining
- GFPGAN β Tencent ARC
- DeOldify β Jason Antic
For questions or collaborations, please open an issue.
Released under the MIT License.