Image upscaling has seen tremendous progress in recent years, but many models still struggle with real-world images that contain complex degradation patterns. Real-ESRGAN aims to solve this by developing practical algorithms for general image and video restoration.
What is Real-ESRGAN?
Real-ESRGAN is an extension of the powerful ESRGAN (Enhanced Super-Resolution Generative Adversarial Networks). While the original ESRGAN was impressive, it was trained on synthetic data that didn't always reflect real-world imperfections. Real-ESRGAN bridges this gap by training on "pure synthetic data" that better mimics real-world degradation, making it incredibly effective at restoring actual photos and videos.
Key Features
- Real-World Restoration: specifically designed to handle common image artifacts like blur, noise, and compression.
- Anime Optimization: Includes specialized models (
RealESRGAN_x4plus_anime_6B) optimized for upscaling anime images and videos with smaller model sizes and faster inference. - Face Enhancement: Integrates with GFPGAN to improve facial details in restored images.
- Video Support: optimized models for upscaling anime and general videos.
- Portable: Offers executable files (NCNN) for Windows, Linux, and macOS, requiring no complex Python or CUDA setup for end-users.
Use Cases
- Restoring Old Photos: enhancing resolution and removing noise from scanned vintage photographs.
- Anime Upscaling: Perfect for upgrading classic anime content to 4K resolution.
- Video Enhancement: Improving the quality of low-resolution video clips.
- Texture Upscaling: Useful for game developers needing high-resolution textures from lower-quality sources.
Getting Started
Real-ESRGAN is open-source and provides multiple ways to use it, from online demos to portable executables: https://github.com/xinntao/Real-ESRGAN
Quick Start with Python
For developers, you can easily integrate Real-ESRGAN into your workflow.
# Clone the repository
git clone https://github.com/xinntao/Real-ESRGAN.git
cd Real-ESRGAN
# Install dependencies
pip install basicsr
pip install facexlib
pip install gfpgan
pip install -r requirements.txt
python setup.py developPortable Usage (NCNN)
For users who don't want to install Python environments, the project offers portable executables (NCNN) for Intel/AMD/Nvidia GPUs.
# Basic usage
./realesrgan-ncnn-vulkan.exe -i input.jpg -o output.png -n realesrgan-x4plus
# With face enhancement (if supported) and custom scale
./realesrgan-ncnn-vulkan.exe -i input.jpg -o output.png -s 4Credits
Real-ESRGAN is developed by Xintao Wang, Liangbin Xie, Chao Dong, and Ying Shan from Tencent ARC Lab and Shenzhen Institutes of Advanced Technology, Chinese Academy of Sciences.
If you find this project useful, please consider starring their repository and citing their work: "Real-ESRGAN: Training Real-World Blind Super-Resolution with Pure Synthetic Data"