An Attempt at Super Resolution: Part I

Photo by Mike Austin on Unsplash

Haven’t you been amused at watching TV series when the detective zooms into the image of a crime scene and he finds a clue that leads to the culprit? Sounds so sci-fi! Well this is my attempt to code that out. While Super Resolution has been there for quite some time now , being used for various tasks. One of them being delivering high resolution content such as 1080 resolution movies through streaming while consuming lesser bandwidth. Surprising!? I know!.

What is Super Resolution?

Lets code that out and see for ourselves:

lr_img = cv2.imread('Data/0797_lr.png')

Now lets resize the image to 2X. Below is the code and the output of the image. If you observe , you can see the image getting blurred. This is because just doubling images just can’t create and fill in the missing information.

hr_img = cv2.resize(lr_img,(lr_img.shape[1]*2,lr_img.shape[0]*2),interpolation = cv2.INTER_NEAREST)

Interpolation above does the trick here in filling in the missing values.
A quick highlight what each of it means:

The above ones are used for zooming purposes.


Why do we need super resolution at all?

If data can’t be created, is Super Resolution achievable?

With the progress of research in the field of Deep Learning , multiple researchers have been able to propose and build architectures that are able to achieve such feats. This is possible due the reason that Neural networks can fill in the gaps when they are trained over pairs of low resolution and their corresponding higher resolution images.

While there are multiple such architectures and designs that work on similar lines, we will try to build one super resolution pipeline using Resnet-18 based model. Lets build it together in the following below sections.

Before we head out to code, a couple of papers to inspire us:

Icon Credits: Icons made by Smashicons from
Image source
Originally published at

Anurag is a Data Scientist by profession. Loves to tinker with gadgets. Codes and plays during free time.

Anurag is a Data Scientist by profession. Loves to tinker with gadgets. Codes and plays during free time.