MageAI is an advanced image upscaling web application powered by the Enhanced Super-Resolution Generative Adversarial Networks (ESRGAN). This application allows users to upload low-resolution images and receive high-resolution upscaled versions, leveraging state-of-the-art AI techniques.
MageAI is designed for image upscaling and enhancement, specifically aimed at restoring details from low-resolution images. It uses ESRGAN (Enhanced Super-Resolution GAN) to improve image quality significantly by learning how to add high-frequency details lost in low-resolution images.
ESRGAN has revolutionized image super-resolution by introducing Residual-in-Residual Dense Blocks (RRDB) and the Relativistic GAN framework. Read more about ESRGAN here.
- Upload: Upload an image (supports PNG, JPG, SVG, GIF).
- Upscale: Uses ESRGAN for image upscaling.
- Preview: View the upscaled image instantly.
- Download: Download the upscaled image.
This project is built with:
- Frontend: React and Next.js
- Styling: Tailwind CSS
- Backend: FastAPI for handling image processing.
- Machine Learning Model: ESRGAN for image upscaling.
- Image Handling: Python's
PIL
library for image processing. - Deployment: Render for hosting both frontend and backend services.
To run this project locally, follow the steps below:
- Node.js (>= 16.x.x)
- Python (>= 3.9)
- FastAPI
- Install ESRGAN
git clone https://github.com/PranavBhatP/Mage.ai.git
cd Mage.ai
-
Navigate to the
client/
folder:cd client
-
Install dependencies:
npm install
-
Start the development server:
npm run dev
-
Navigate to the
server/
folder:cd server
-
Install dependencies (preferably in a virtual environment):
pip install -r requirements.txt
-
Run the FastAPI backend:
uvicorn main:app --host 0.0.0.0 --port 8000
- Upload an Image: Upload your image (JPG, PNG, or GIF format).
- Upscale: Click the "Let's Go!" button to process the image using the backend ESRGAN model.
- Download the Image: Once processed, download your upscaled image.
The backbone of this project is ESRGAN which improves upon the classic GAN by using:
- RRDB (Residual-in-Residual Dense Block): Enables better learning and stability for high-res image generation.
- Relativistic GAN: Helps the model better differentiate between real and generated high-resolution images.
Learn more about the architecture in the original ESRGAN paper.
- ESRGAN GitHub: https://github.com/xinntao/ESRGAN
- Original ESRGAN Paper: ESRGAN: Enhanced Super-Resolution Generative Adversarial Networks
- FastAPI Documentation: https://fastapi.tiangolo.com/
- Next.js Documentation: https://nextjs.org/docs
This project is licensed under the MIT License - see the LICENSE file for details.