An AI-powered entry in TopGit's GitHub warehouse: microsoft/Bringing-Old-Photos-Back-to-Life, 15.7k stars, AI Tools, Python. Bringing Old Photo Back to Life (CVPR 2020 oral)
Snapshot summary built from the project's own GitHub metadata — there's no written TopGit review yet. The page will update automatically when a full review is published.
WHY NO REVIEW YET
TopGit writes full reviews for the most-starred, most-requested repositories. This page is a snapshot until then — see the READ ME tab for the original README in full.
Old Photo Restoration (Official PyTorch Implementation)
Project Page | Paper (CVPR version) | Paper (Journal version) | Pretrained Model | Colab Demo | Replicate Demo & Docker Image :fire:
Bringing Old Photos Back to Life, CVPR2020 (Oral)
Old Photo Restoration via Deep Latent Space Translation, TPAMI 2022
Ziyu Wan1,
Bo Zhang2,
Dongdong Chen3,
Pan Zhang4,
Dong Chen2,
Jing Liao1,
Fang Wen2 1City University of Hong Kong, 2Microsoft Research Asia, 3Microsoft Cloud AI, 4USTC
:sparkles: News
2022.3.31: Our new work regarding old film restoration will be published in CVPR 2022. For more details, please refer to the project website and github repo.
The framework now supports the restoration of high-resolution input.
Training code is available and welcome to have a try and learn the training details.
You can now play with our Colab and try it on your photos.
Requirement
The code is tested on Ubuntu with Nvidia GPUs and CUDA installed. Python>=3.6 is required to run the code.
Installation
Clone the Synchronized-BatchNorm-PyTorch repository for
cd Face_Enhancement/models/networks/
git clone https://github.com/vacancy/Synchronized-BatchNorm-PyTorch
cp -rf Synchronized-BatchNorm-PyTorch/sync_batchnorm .
cd ../../../
cd Global/detection_models
git clone https://github.com/vacancy/Synchronized-BatchNorm-PyTorch
cp -rf Synchronized-BatchNorm-PyTorch/sync_batchnorm .
cd ../../
Download the landmark detection pretrained model
cd Face_Detection/
wget http://dlib.net/files/shape_predictor_68_face_landmarks.dat.bz2
bzip2 -d shape_predictor_68_face_landmarks.dat.bz2
cd ../
Download the pretrained model, put the file Face_Enhancement/checkpoints.zip under ./Face_Enhancement, and put the file Global/checkpoints.zip under ./Global. Then unzip them respectively.
cd Face_Enhancement/
wget https://github.com/microsoft/Bringing-Old-Photos-Back-to-Life/releases/download/v1.0/face_checkpoints.zip
unzip face_checkpoints.zip
cd ../
cd Global/
wget https://github.com/microsoft/Bringing-Old-Photos-Back-to-Life/releases/download/v1.0/global_checkpoints.zip
unzip global_checkpoints.zip
cd ../
Install dependencies:
pip install -r requirements.txt
:rocket: How to use?
Note: GPU can be set 0 or 0,1,2 or 0,2; use -1 for CPU
1) Full Pipeline
You could easily restore the old photos with one simple command after installation and downloading the pretrained model.
Note: Please try to use the absolute path. The final results will be saved in ./output_path/final_output/. You could also check the produced results of different steps in output_path.
2) Scratch Detection
Currently we don't plan to release the scratched old photos dataset with labels directly. If you want to get the paired data, you could use our pretrained model to test the collected images to obtain the labels.
We use a progressive generator to refine the face regions of old photos. More details could be found in our journal submission and ./Face_Enhancement folder.
NOTE:
This repo is mainly for research purpose and we have not yet optimized the running performance.
Since the model is pretrained with 256*256 images, the model may not work ideally for arbitrary resolution.
5) GUI
A user-friendly GUI which takes input of image by user and shows result in respective window.
How it works:
Run GUI.py file.
Click browse and select your image from test_images/old_w_scratch folder to remove scratches.
Click Modify Photo button.
Wait for a while and see results on GUI window.
Exit window by clicking Exit Window and get your result image in output folder.
How to train?
1) Create Training File
Put the folders of VOC dataset, collected old photos (e.g., Real_L_old and Real_RGB_old) into one shared folder. Then
cd Global/data/
python Create_Bigfile.py
Note: Remember to modify the code based on your own environment.
2) Train the VAEs of domain A and domain B respectively
If you find our work useful for your research, please consider citing the following papers :)
@inproceedings{wan2020bringing,
title={Bringing Old Photos Back to Life},
author={Wan, Ziyu and Zhang, Bo and Chen, Dongdong and Zhang, Pan and Chen, Dong and Liao, Jing and Wen, Fang},
booktitle={Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition},
pages={2747--2757},
year={2020}
}
@article{wan2020old,
title={Old Photo Restoration via Deep Latent Space Translation},
author={Wan, Ziyu and Zhang, Bo and Chen, Dongdong and Zhang, Pan and Chen, Dong and Liao, Jing and Wen, Fang},
journal={arXiv preprint arXiv:2009.07047},
year={2020}
}
If you are also interested in the legacy photo/video colorization, please refer to this work.
Maintenance
This project is currently maintained by Ziyu Wan and is for academic research use only. If you have any questions, feel free to contact [email protected].
License
The codes and the pretrained model in this repository are under the MIT license as specified by the LICENSE file. We use our labeled dataset to train the scratch detection model.
This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact [email protected] with any additional questions or comments.
Is microsoft/Bringing-Old-Photos-Back-to-Life open source?
Yes — microsoft/Bringing-Old-Photos-Back-to-Life ships under the MIT license, which makes its source code freely readable (and, depending on license terms, forkable and reusable). Source: github.com/microsoft/Bringing-Old-Photos-Back-to-Life.
What else is in the AI Tools space?
microsoft/Bringing-Old-Photos-Back-to-Life is tracked by TopGit under the AI Tools category, alongside 8 GitHub-tagged topics. Trending and Topics pages list peer repositories of comparable stars and language.
What is microsoft/Bringing-Old-Photos-Back-to-Life?
microsoft/Bringing-Old-Photos-Back-to-Life (microsoft/Bringing-Old-Photos-Back-to-Life) is a Python project on GitHub. From the project's own README: Bringing Old Photo Back to Life (CVPR 2020 oral)
What license does microsoft/Bringing-Old-Photos-Back-to-Life use?
microsoft/Bringing-Old-Photos-Back-to-Life is released under the MIT license. Always verify the LICENSE file directly on GitHub for the authoritative terms — license strings can be edited out of sync with a project's actual stance.
Where can I see microsoft/Bringing-Old-Photos-Back-to-Life in action?
The project maintains a homepage at https://arxiv.org/abs/2004.09484. The README tab on this page also usually contains screenshots and a quickstart.
Where do I read more about microsoft/Bringing-Old-Photos-Back-to-Life?
This TopGit page is a snapshot — the READ ME tab shows the project's own README content (links stripped, images preserved). The GitHub repository at github.com/microsoft/Bringing-Old-Photos-Back-to-Life is the definitive source.
Why is microsoft/Bringing-Old-Photos-Back-to-Life categorized under AI Tools?
TopGit places microsoft/Bringing-Old-Photos-Back-to-Life in the AI Tools category based on its GitHub topics and description (tagged: "gans", "generative-adversarial-network", "image-manipulation"). Categories are assigned from real repository metadata, not editorial guesswork.
Read full README in the tab above.
Is Bringing-Old-Photos-Back-to-Life worth your time?
ChatGPT, Claude and Perplexity can all read this page. Ask one of them what it makes of Bringing-Old-Photos-Back-to-Life.