- π€ What is this project?
- π― Key Features
- π Getting Started
- π Provided endpoints
- π Contributing
-
β οΈ Disclaimer
This project is a reimplementation of ENet-PAT model with a 4x upscale ratio with some custom features, based on EnhanceNet-Code repo and using their pre-trained weights. This network was presented on EnhanceNet: Single Image Super-Resolution Through Automated Texture Synthesis paper. Set of custom features is documented on π― Key Features.
- Tensorflow 1 based implementation. Tensorflow 2/Keras migration was not possible while maintaining original weights.
- Reescale based on bicubic interpolation and ENet-PAT model.
- Simple Flask API to expose functionality via POST requests, admitting base64 encoded images.
- With 4GB of RAM, implementation can handle images up to 256x256 px, while with 8GB of RAM is able to support images equal or lower to 512x512 px.
- Install dependencies via requirements.txt.
- Modify if neccesary Flask parameters on endpoint.
- Execute :)
This implementation is not neither optimized to be used in production enviroments or free of OOM (Out Of Memory) errors, so is designed to be used only for development purposes.
Description:
Takes a base64-encoded image and returns an upscaled version, also in base64 format.
Method: POST
URL: /upscale
Request Body:
{
"image": "iVBORw0KGgoAAAANSUhEUgA..."
}image(string, required): A base64-encoded image, without any b64 header format.
Response:
{
"upscaled_image": "iVBORw0KGgoAAAANSUhEUgA..."
}upscaled_image: 4x upscaled image encoded in base64.
Status Codes:
200 OKβ Image processed and upscaled successfully.400 Bad Requestβ Provided base64 string is not a valid image.402 Payment Requiredβ Missing or improperly formatted request body.404 Not Foundβ Invalid endpoint.
Any contributions you make are greatly appreciated, so if you have any idea of how to make this project better, please create a pull request. Also if you find any bug, please create an issue.
This project was originally created by @VicDominguez to use this module in the context of his Final Degree Project, Generation of impressionistic pictures using Neural Networks on 2020. Due this, the whole project was designed to support my constraints; and also source code was originally written on Spanish and translated to English on 2025.
Moreover, seems that imghdr was removed on Python 3.13, but it can be installed via standard-imghdr.