Path: blob/master/site/en-snapshot/lite/examples/super_resolution/overview.ipynb
25118 views
Copyright 2020 The TensorFlow Authors.
Super resolution with TensorFlow Lite
Overview
The task of recovering a high resolution (HR) image from its low resolution counterpart is commonly referred to as Single Image Super Resolution (SISR).
The model used here is ESRGAN (ESRGAN: Enhanced Super-Resolution Generative Adversarial Networks). And we are going to use TensorFlow Lite to run inference on the pretrained model.
The TFLite model is converted from this implementation hosted on TF Hub. Note that the model we converted upsamples a 50x50 low resolution image to a 200x200 high resolution image (scale factor=4). If you want a different input size or scale factor, you need to re-convert or re-train the original model.
Setup
Let's install required libraries first.
Import dependencies.
Download and convert the ESRGAN model
Download a test image (insect head).
Generate a super resolution image using TensorFlow Lite
Visualize the result
Performance Benchmarks
Performance benchmark numbers are generated with the tool described here.
Model Name | Model Size | Device | CPU | GPU |
---|---|---|---|---|
super resolution (ESRGAN) | 4.8 Mb | Pixel 3 | 586.8ms* | 128.6ms |
Pixel 4 | 385.1ms* | 130.3ms |
*4 threads used