Skip to content

Neural network to 4x upscale images, based on ENet-Path model.

License

Notifications You must be signed in to change notification settings

VicDominguez/EnhanceNet

Β 
Β 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

14 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Enhance Net

Neural network to upscale images.

Table of Contents

πŸ€” What is this project?

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.

🎯 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.

πŸš€ Getting Started

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.

πŸ“ˆ Provided endpoints

POST /upscale

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.

πŸ’™ Contributing

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.

⚠️ Disclaimer

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.

About

Neural network to 4x upscale images, based on ENet-Path model.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Languages

  • Python 100.0%