- Implemented super resolution convolutional neural networks (SRCNN) and applied super resolution to input images.
- Python 3.6
- OpenCV 4.0.0
- keras 2.1.0
- Tensorflow 1.13.0
- cuda toolkit 10.0
- cuDNN 7.4.2
- Imutils
- NumPy
- SciPy
- Matplotlib
The dataset is 100 images from UKBench dataset.
The sr_config.py
(check here) under config/
directory stores the configurations for the project, including path to the input images, path to the temporary output directories, path to the HDF5
files, and etc.
The srcnn,py
(check here) under pipeline/nn/conv/
directory construct the super resolution convolutional neural network, which is fully convolutional. In this convolutional neural network, we train for filters, not accuracy. We are concerned with actual filters learn by SRCNN which will enable us to upscale an image.
The goal is to make SRCNN learn how to reconstruct high resolution patchesfrom low resolution input ones. Thus, we are going to construct two sets of image patches, including a low resolution patch that will be the input to the network, and a high resolution patch that will be target for the network to predict.
The build_dataset.py
(check here) builds a dataset of low and high resolution input patches.
The train.py
(check here) trains a network to learn to map the low resolution patches to their high resolution counterparts.
The resize.py
(check here) utilizes loops over the input patches of a low resolution images, passes them through the network, and then creates the output high resolution image from the predicted patches.
There are two helper classes for building dataset or training process:
The hdf5datasetwriter.py
(check here) under pipeline/io/
directory, defines a class that help to write raw images or features into HDF5
dataset.
The hdf5datasetgenerator.py
(check here) under pipeline/io/
directory yields batches of images and labels from HDF5
dataset. This class can help to facilitate our ability to work with datasets that are too big to fit into memory.
Figure 1 shows the original image. And Figure 2 increases the size of original image about two times but without applying any SRCNN, as a baseline image. Figure 3 demonstrates the image after applying SRCNN, which is about same size as Figure 2.
Figure 1: Original image.
Figure 2: Baseline image (2x bigger than original image), before applying SRCNN.
Figure 3: Output image, after applying SRCNN.