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.
pip install -r requirements.txt
- download the COCO dataset (I use COCO 2017).
- download the Set5, Set14, BSD100 test datasets
- create_data_lists.py creates the JSON files for training and testing from the COCO image paths.
- architecture.py defines the training blueprints for both models (ResNet and GAN).
- train.py runs the whole training pipeline with top-down logic found in the file. Everything is managed by the
Trainer
from trainer.py. - 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
'speak_signal_noise_ratio
andstructural_similarity
using theEvaluator
from evaluator.py.
The code itself is heavily commented and you can get a feel for super-resolution models by looking at the tests.
- Top-Left: Bicubic Up-sampling
- Top-Right: Super Resolution ResNet
- Bottom-Left: Super Resolution GAN
- Bottom-Right: Original High Resolution
Evaluation results:
{ 'PSNR (SRGAN)': 29.44381,
'PSNR (SRResNet)': 29.380556,
'SSIM (SRGAN)': 0.87486875,
'SSIM (SRResNet)': 0.87476}