Skip to content
/ Look Public

Look is a powerful ML tool that upscale satellite images generated using ESRGAN built with TensorFlow Keras & Fastapi. It ensures high-quality scaling, preserving details and consistency, making images ready for further use or visualization. Ideal for enhancing images while maintaining precision

Notifications You must be signed in to change notification settings

RijoSLal/Look

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 

Repository files navigation

Look

Look is a powerful machine learning tool designed to uplscale satellite images, including infrared (IR), ultraviolet (UV), and visible spectrum images, generated by a ESRGAN built with TensorFlow Keras. Integrated with fastapi, it ensures high-quality scaling while preserving details and consistency, making the images ready for further use or visualization. Look is ideal for enhancing images while maintaining precision

Features

  • Upload infrared (IR), ultraviolet (UV), or visible spectrum images, including satellite imagery and scientific visuals.
  • Enhance image resolution using the powerful ESRGAN super-resolution model.
  • Download high-quality, upscaled images with improved clarity and detail.
  • Experience a sleek, user-friendly web interface built with FastAPI, Jinja2 templates, and custom-styled CSS for seamless interaction.

Installation

To set up the project locally, follow these steps:

1. Clone the repository

git clone https://github.com/RijoSLal/Look.git
cd Look

2. Install dependencies

Make sure you have a Python environment ready. Then, install the necessary dependencies via pip:

pip install -r requirements.txt

3. Set up TensorFlow environment

The model requires TensorFlow to run. Ensure your system is equipped with the appropriate version of TensorFlow and has GPU support for faster inference (optional). If you're using a CPU-only environment, set the environment variable CUDA_VISIBLE_DEVICES=-1 to avoid GPU usage.

4. Download the ESRGAN Model

This application uses the ESRGAN model from TensorFlow Hub:

No manual download is necessary, as the model is loaded directly from TensorFlow Hub. Try building from scratch if you have powerful GPU like 3050 or above.

Usage

1. Run the FastAPI server

To launch the FastAPI server, use the following command:

uvicorn main:app --reload

The server will be accessible at http://localhost:8000.

2. Upload an Image

Once the server is running, navigate to the home page and upload an image. The image must be in a supported format (e.g., .jpg, .jpeg, .png). The image will then be processed by the ESRGAN model to generate the enhanced version.

3. Download the Upscaled Image

After the image is processed, a download link for the upscaled image will be provided on the same page. You can download the enhanced image in JPEG format.

API Endpoints

/

  • Method: GET
  • Description: Renders the home page with a file upload form for image submission.

/upload

  • Method: POST
  • Description: Accepts an image file, processes it with the ESRGAN model, and returns the URL of the upscaled image for download.
  • Parameters:
    • file (image file, required)

/download

  • Method: GET
  • Description: Provides a download link for the upscaled image if it exists.
  • Response: The upscaled image file (JPEG format).

Project Structure

.
├── main.py                  # FastAPI application and route definitions
├── model_gan.py             # GAN model handling and image processing logic
├── static/                  # Directory for storing uploaded and upscaled images
│   ├── image/               # Directory for images
│   │   ├── unclear_image.jpeg   # Example of uploaded image
│   │   └── super_resolution.jpeg # Upscaled image
│   └── styling/             # Directory for CSS and styling resources
│       └── style.css        # Custom styling for the web interface
├── templates/               # Jinja2 HTML templates
│   └── index.html           # Main page template
├── requirements.txt         # List of dependencies
└── README.md                # Project overview and instructions

Dependencies

  • FastAPI: Web framework for building APIs with Python 3.7+.
  • Uvicorn: ASGI server to run the FastAPI application.
  • TensorFlow: Machine learning framework for building and deploying models.
  • TensorFlow Hub: Pre-trained model repository used to load ESRGAN.
  • Pillow (PIL): Image processing library for saving and manipulating images.
  • Jinja2: Template engine for rendering HTML views.

To install all dependencies:

pip install -r requirements.txt

Optional: TensorFlow GPU Support

If you have a compatible GPU and want to enable TensorFlow GPU acceleration, ensure you have the necessary CUDA and cuDNN libraries installed. Set the environment variable CUDA_VISIBLE_DEVICES=0 for GPU usage. If you prefer to use the CPU, set CUDA_VISIBLE_DEVICES=-1.

License

This project is licensed under the MIT License. See the LICENSE file for more details.

Acknowledgements

This application is designed to be a robust, efficient, and scalable solution for processing images with state-of-the-art deep learning model, and is intended for use cases where high-quality image enhancement is needed.Feel free to play around with it and experiment!

About

Look is a powerful ML tool that upscale satellite images generated using ESRGAN built with TensorFlow Keras & Fastapi. It ensures high-quality scaling, preserving details and consistency, making images ready for further use or visualization. Ideal for enhancing images while maintaining precision

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published