├── .gitignore
├── LICENSE
├── README.md
├── callbacks.py
├── data.py
├── data
├── p1.png
├── p2.png
├── p3.png
├── p4.png
├── p5.png
├── p6.png
└── p7.png
├── figures
├── c1.png
├── c2.png
├── c3.png
├── c4.png
├── c5.png
├── c6.png
├── dloss.png
├── gloss.png
├── movie1.gif
├── movie2.gif
├── ploss.png
├── rgan.png
├── rrdb.png
└── wall.png
├── inference.py
├── layers.py
├── losses.py
├── models.py
├── notebook.ipynb
├── requirements.txt
├── results
├── sr-p1.jpg
├── sr-p2.jpg
├── sr-p3.jpg
├── sr-p4.jpg
├── sr-p5.jpg
├── sr-p6.jpg
└── sr-p7.jpg
├── train.py
└── weights
└── GeneratorVG4(1520).h5
/.gitignore:
--------------------------------------------------------------------------------
1 | __pycache__
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2021 Rishik Mourya
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Super Resolution for Real Time Image Enhancement
2 |
3 |
4 |
5 |
6 |

7 |
8 |
9 | # Final Results from Validation data
10 |
11 |
12 |
13 |
14 |
15 | |
16 |
17 |
18 | |
19 |
20 |
21 |
22 | # Introduction
23 |
24 | It is no suprising that adversarial training is indeed possible for super resolution tasks. The problem with pretty much all the state of the art models is that they are just not usable for native deployment, because of 100s of MBs of model size.
25 |
26 | Also, most of the known super resolution frameworks only works on single compression method, such as bicubic, nearest, bilinear etc. Which helps the model a lot to beat the previous state of the art scores but they perform poorly on real life low resolution images because they might not belong to the same compression method for which the model was trained for.
27 |
28 | So for me the main goal with this project wasn't just to create yet another super resolution model, but to develop a lightest model as possible which works well on any random compression methods.
29 |
30 |
31 | With this goal in mind, I tried adopting the modern super resolution frameworks such as relativistic adversarial training, and content loss optimization (I've mainly followed the [ESRGAN](https://arxiv.org/abs/1809.00219), with few changes in the objective function), and finally was able to create a **model of size 5MB!!!**
32 |
33 | # API Usage
34 |
35 | ```python
36 | from inference import enhance_image
37 |
38 | enhance_image(
39 | lr_image, # , # or lr_path = ,
40 | sr_path, #