Artificial intelligence

Machine Learning in Linux: Old Photo Restoration

With the availability of huge amounts of data for research and powerful machines to run your code on with distributed cloud computing and parallelism across GPU cores, Deep Learning has helped to create self-driving cars, intelligent voice assistants, pioneer medical advancements, machine translation, and much more. Deep Learning has become an indispensable tool for countless industries.

Old Photo Restoration is a project that uses deep learning to restore old photos via deep latent space translation. This research project lets you restore old photos that suffer from severe degradation through a deep learning approach. It uses a novel triplet domain translation network by leveraging real photos along with massive synthetic image pairs.

The software is written in Python and published under the MIT license.


First, clone the project’s GitHub repository with the command:

$ git clone

Now we clone the Synchronized-BatchNorm-PyTorch repository.

$ cd Bringing-Old-Photos-Back-to-Life/Face_Enhancement/models/networks/
$ git clone
$ cp -rf Synchronized-BatchNorm-PyTorch/sync_batchnorm .
$ cd ../../../

$ cd Global/detection_models
$ git clone
$ cp -rf Synchronized-BatchNorm-PyTorch/sync_batchnorm .
$ cd ../../

Download the landmark detection pretrained model.

$ cd Face_Detection/
$ wget
$ bzip2 -d shape_predictor_68_face_landmarks.dat.bz2
$ cd ../

Now download the face checkpoints and global checkpoints pretrained models using wget. Note the file is a 653MB download, and the file is a 1.9GB download.

$ cd Face_Enhancement/
$ wget
$ unzip
$ cd ../
$ cd Global/
$ wget
$ unzip
$ cd ../

Using pip, we install the dependencies. pip is a package manager for Python packages.

$ pip install -r requirements.txt

On our systems, the pip command compiles and installs the packages: PySimpleGUI-4.60.4, dill-0.3.6, dlib-19.24.0, dominate-2.7.0, easydict-1.10, einops-0.6.0, protobuf-3.20.3, and tensorboardX-2.6.

If you want to test the project’s GUI, you’ll also need the python3-tk package installed. On our Ubuntu system, this is installed with the command:

$ sudo apt-get install python3-tk

Next page: Page 2 – In Operation and Summary

Pages in this article:
Page 1 – Introduction and Installation
Page 2 – In Operation and Summary

Notify of

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Inline Feedbacks
View all comments