Skip to content

Modern Graph TensorFlow implementation of Super-Resolution GAN

Notifications You must be signed in to change notification settings

AndreiMoraru123/Super-Resolution

Repository files navigation

Photo-Realistic Single Image Super-Resolution GAN

TensorFlow Keras nVIDIA

Code style: black Checked with mypy Build Status

Note

I adapted the code from this awesome PyTorch version. Please check it out as well.

Important

I am using python 3.11 with tensorflow 2.12 on WSL2.

Steps

  1. pip install -r requirements.txt
  2. download the COCO dataset (I use COCO 2017).
  3. download the Set5, Set14, BSD100 test datasets
  4. create_data_lists.py creates the JSON files for training and testing from the COCO image paths.
  5. architecture.py defines the training blueprints for both models (ResNet and GAN).
  6. train.py runs the whole training pipeline with top-down logic found in the file. Everything is managed by the Trainer from trainer.py.
  7. resolve.py generates the super resolution images from a given high resolution image (the low resolution version to be solved is generated by down-sampling the given image) and evaluates the models using with scikit-image's peak_signal_noise_ratio and structural_similarity using the Evaluator from evaluator.py.

The code itself is heavily commented and you can get a feel for super-resolution models by looking at the tests.

Overfitting on one image

  • Top-Left: Bicubic Up-sampling
  • Top-Right: Super Resolution ResNet
  • Bottom-Left: Super Resolution GAN
  • Bottom-Right: Original High Resolution

bird_resolved

Evaluation results:
{   'PSNR (SRGAN)': 29.44381,
    'PSNR (SRResNet)': 29.380556,
    'SSIM (SRGAN)': 0.87486875,
    'SSIM (SRResNet)': 0.87476}