Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ai-forever/Real-ESRGAN
PyTorch implementation of Real-ESRGAN model
https://github.com/ai-forever/Real-ESRGAN
esrgan python pytorch real-esrgan real-world-super-resolution super-resolution
Last synced: 8 days ago
JSON representation
PyTorch implementation of Real-ESRGAN model
- Host: GitHub
- URL: https://github.com/ai-forever/Real-ESRGAN
- Owner: ai-forever
- License: bsd-3-clause
- Created: 2021-11-02T08:41:49.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2024-04-15T18:19:26.000Z (7 months ago)
- Last Synced: 2024-10-02T09:18:32.826Z (about 1 month ago)
- Topics: esrgan, python, pytorch, real-esrgan, real-world-super-resolution, super-resolution
- Language: Python
- Homepage:
- Size: 9.93 MB
- Stars: 473
- Watchers: 12
- Forks: 122
- Open Issues: 20
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Real-ESRGAN
PyTorch implementation of a Real-ESRGAN model trained on custom dataset. This model shows better results on faces compared to the original version. It is also easier to integrate this model into your projects.> This is not an official implementation. We partially use code from the [original repository](https://github.com/xinntao/Real-ESRGAN)
Real-ESRGAN is an upgraded [ESRGAN](https://arxiv.org/abs/1809.00219) trained with pure synthetic data is capable of enhancing details while removing annoying artifacts for common real-world images.
You can try it in [google colab](https://colab.research.google.com/drive/1YlWt--P9w25JUs8bHBOuf8GcMkx-hocP?usp=sharing) [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/drive/1YlWt--P9w25JUs8bHBOuf8GcMkx-hocP?usp=sharing)
- [Paper (Real-ESRGAN: Training Real-World Blind Super-Resolution with Pure Synthetic Data)](https://arxiv.org/abs/2107.10833)
- [Original implementation](https://github.com/xinntao/Real-ESRGAN)
- [Huggingface 🤗](https://huggingface.co/sberbank-ai/Real-ESRGAN)### Installation
```bash
pip install git+https://github.com/sberbank-ai/Real-ESRGAN.git
```### Usage
---
Basic usage:
```python
import torch
from PIL import Image
import numpy as np
from RealESRGAN import RealESRGANdevice = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
model = RealESRGAN(device, scale=4)
model.load_weights('weights/RealESRGAN_x4.pth', download=True)path_to_image = 'inputs/lr_image.png'
image = Image.open(path_to_image).convert('RGB')sr_image = model.predict(image)
sr_image.save('results/sr_image.png')
```### Examples
---
Low quality image:
![](inputs/lr_image.png)
Real-ESRGAN result:
![](results/sr_image.png)
---
Low quality image:
![](inputs/lr_face.png)
Real-ESRGAN result:
![](results/sr_face.png)
---
Low quality image:
![](inputs/lr_lion.png)
Real-ESRGAN result:
![](results/sr_lion.png)