Artificial intelligence

Machine Learning in Linux: Old Photo Restoration

In Operation

In the Bringing-Old-Photos-Back-to-Life directory, issue the command.

$ python --input_folder [directory] --output_folder [directory]

The software runs through the input folder in a four stage process including face detection and face enhancement, and outputs the restored photos to the output folder. The software uses a progressive generator to refine the face regions of old photos.

We can append the flag --GPU to use the graphics card (GPU can be set to 0 or 0,1,2 or 0,2; use -1 for CPU). If the image has scratches, append the flag --with_scratch. And if the image is high-resolution, append the flag --HR.

Here is one of the example images included with the project; before and after.

Old Photo restoration
Click image for full size

Here’s the Python GUI.

Python interface


From testing a wide range of old photos, the results are impressive to say the least although the face recognition output isn’t nearly as refined compared to GFPGAN.

The software is particularly strong at removing scratches on photos, although we had a few images where part of a scratch still remains.

The GUI is more of a proof-of-concept. It’s very buggy. We recommend using the command-line.

It’s not often we feature Microsoft software on LinuxLinks. That’s not because we dislike the company, it’s simply because most of their software is proprietary, expensive, and doesn’t run natively under Linux. This project is copyrighted by Microsoft, the maintainer was a research intern at Microsoft Research. This is open source software.

The project has amassed over 11k GitHub stars.

Developer: Microsoft Corporation
License: MIT License

Old Photo Restoration is written in Python. Learn Python with our recommended free books and free tutorials.

Artificial intelligence icon For other useful open source apps that use machine learning/deep learning, we’ve compiled this roundup.

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.

Newest Most Voted
Inline Feedbacks
View all comments
1 month ago

Hi, Starts and sits there for 2 hours, the second time, the first was also around two hours. Please advise.
manolo@manolo-Inspiron-620:~/Bringing-Old-Photos-Back-to-Life$ python3
Running Stage 1: Overall restoration
/bin/sh: 1: python: not found
/bin/sh: 1: python: not found

1 month ago
Reply to  Manny

Python>=3.6 is required.