How to Revive Century-Old Footage with AI: DAIN, ESRGAN, and DeOldify

This guide shows how to restore and enhance century‑old black‑and‑white Beijing footage using three open‑source AI tools—DAIN for frame interpolation, ESRGAN for super‑resolution, and DeOldify for colorization—complete with setup steps, code snippets, and usage instructions.

Programmer DD
Programmer DD
Programmer DD
How to Revive Century-Old Footage with AI: DAIN, ESRGAN, and DeOldify

Recently a century‑old black‑and‑white video of Beijing was shared on social media. The creator used AI to convert the 1920s footage into a high‑definition, color video, adding period‑appropriate background music.

Video Frame Interpolation Tool – DAIN

DAIN (Depth‑Aware Video Frame Interpolation) inserts intermediate frames between existing ones to increase the frame rate, making video playback smoother. It uses a depth‑aware flow projection layer to generate these frames.

Test Environment

Ubuntu 16.04.5 LTS

Python 3.6.8 (Anaconda 4.1.1)

CUDA 9.0 and cuDNN 7.0

PyTorch 1.0.0 (ATen API)

GCC 4.9.1 and NVCC 9.0

NVIDIA Titan X (Pascal) GPU

Installation and Usage $ git clone https://github.com/baowenbo/DAIN.git Before building the PyTorch extension, ensure pytorch >= 1.0.0 is installed: $ python -c "import torch; print(torch.__version__)" Build the extension: $ cd DAIN<br/>$ cd my_package<br/>$ ./build.sh Build the required correlation package for PWCNet:

$ cd ../PWCNet/correlation_package_pytorch1_0<br/>$ ./build.sh

Create directories for model weights and the Middlebury dataset:

$ cd DAIN<br/>$ mkdir model_weights<br/>$ mkdir MiddleBurySet

Download pretrained weights and the dataset:

$ cd model_weights<br/>$ wget http://vllab1.ucmerced.edu/~wenbobao/DAIN/best.pth<br/>$ cd ../MiddleBurySet<br/>$ wget http://vision.middlebury.edu/flow/data/comp/zip/other-color-allframes.zip<br/>$ unzip other-color-allframes.zip<br/>$ wget http://vision.middlebury.edu/flow/data/comp/zip/other-gt-interp.zip<br/>$ unzip other-gt-interp.zip

Generate slow‑motion results by setting the time step (e.g., 0.25 for 4× slow motion):

$ CUDA_VISIBLE_DEVICES=0 python demo_MiddleBury_slowmotion.py --netName DAIN_slowmotion --time_step 0.25

Adjust time_step to 0.125, 0.1, or 0.01 for slower effects, and create GIF animations with ImageMagick if desired.

Resolution Enhancement Tool – ESRGAN

ESRGAN (Enhanced Super‑Resolution Generative Adversarial Network) upsamples low‑resolution images while generating realistic textures, overcoming the blurriness of traditional interpolation methods.

Test Environment

Python 3

PyTorch >= 1.0 (CUDA >= 7.5 if using GPU)

Required packages: pip install numpy opencv-python Installation and Usage git clone https://github.com/xinntao/ESRGAN<br/>cd ESRGAN Place low‑resolution images in the ./LR folder, download pretrained models into ./models, and run the test script: python test.py Results are saved in the ./results directory.

Black‑and‑White Image Colorization Tool – DeOldify

DeOldify restores and colorizes old images and videos using a novel NoGAN training method, which combines the visual appeal of GANs with stable, flicker‑free results.

Test Environment

Linux

FastAI 1.0.51 (higher versions may cause artifacts)

PyTorch 1.0.1

Jupyter Lab (installed via conda)

TensorBoard / TensorBoardX (optional)

ImageNet dataset for training (optional)

GPU (any modern GPU for colorization; higher‑end GPUs for large‑scale training)

Installation and Usage

git clone https://github.com/jantic/DeOldify.git DeOldify<br/>cd DeOldify<br/>conda env create -f environment.yml

Activate the environment and launch Jupyter Lab: source activate deoldify<br/>jupyter lab Run the provided notebooks or scripts to colorize frames, then export the results as video or GIF.

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

super-resolutionAI video restorationframe interpolationDAINDeOldifyESRGANimage colorization
Programmer DD
Written by

Programmer DD

A tinkering programmer and author of "Spring Cloud Microservices in Action"

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.