This model is able to upscale a pixelated image by a factor of 4, while generating photo-realistic details. The backbone of this neural network is a Generative Adversarial Network (GAN) trained on 600,000 images of the OpenImages V4 dataset.
|Domain||Application||Industry||Framework||Training Data||Input Data Format|
|Vision||Super-Resolution||General||TensorFlow||OpenImages V4||Image (RGB/HWC)|
|Set5||Author’s SRGAN||This SRGAN|
|Set14||Author’s SRGAN||This SRGAN|
|BSD100||Author’s SRGAN||This SRGAN|
The performance of this implementation was evaluated on three datasets: Set5, Set14, and BSD100. The PSNR (peak signal to noise ratio) and SSIM (structural similarity index) metrics were evaluated, although the paper discusses the MOS (mean opinion score) as the most favorable metric. In essence, the SRGAN implementation trades a better PSNR or SSIM score for a result more appealing to the human eye. This leads to a collection of output images with more crisp and realistic details.
NOTE: The SRGAN in the paper was trained on 350k ImageNet samples, whereas this SRGAN was trained on 600k OpenImages V4 pictures.
- C. Ledig, L. Theis, F. Huszar, J. Caballero, A. Cunningham, A. Acosta, A. Aitken, A. Tejani, J. Totz, Z. Wang, W. Shi, Photo-Realistic Single Image Super-Resolution Using a Generative Adversarial Network, ArXiv, 2017.
- SRGAN-tensorflow (model code source)
|Model GitHub Repository||Apache 2.0||LICENSE|
|Model Weights||Apache 2.0||LICENSE|
|Model Code (3rd party)||MIT||LICENSE|
|Test assets||CC BY 2.0||Samples README|
Options available for deploying this model
This model can be deployed using the following mechanisms:
Deploy from Dockerhub:
docker run -it -p 5000:5000 codait/max-image-resolution-enhancer
Deploy on Red Hat OpenShift:
Follow the instructions for the OpenShift web console or the OpenShift Container Platform CLI in this tutorial and specify
codait/max-image-resolution-enhanceras the image name.
Deploy on Kubernetes:
kubectl apply -f https://raw.githubusercontent.com/IBM/MAX-Image-Resolution-Enhancer/master/max-image-resolution-enhancer.yaml
Locally: follow the instructions in the model README on GitHub
You can test or use this model using cURL
Test the model using cURL
model/predict endpoint to load a test image (you can use one of the test images from the
assets/test_examples/low_resolution folder) in order to get a high resolution output image returned.
Once deployed, you can test the model from the command line. For example:
curl -F "image=@samples/test_examples/low_resolution/food.png" -XPOST http://localhost:5000/model/predict > food_high_res.png
The above command will send the low resolution
food.png file to the model, and save the high resolution output image to the
food_high_res.png file in the root directory.
The ideal input image is a PNG file with a resolution between 100×100 and 500×500, preferably without any post-capture processing and flashy colors. The model is able to generate details from a pixelated image (low DPI), but is not able to correct a ‘blurred’ image.
Left: input image (128×80). Right: output image (512×320)
Resources and Contributions
If you are interested in contributing to the Model Asset Exchange project or have any queries, please follow the instructions here.