NOTE: The repo is created using this repo by ai-forever
This repo is PyTorch implementation of a Real-ESRGAN model. This model shows better results on faces compared to the original version. The issue that were in the orignal repo are fixed and hopefully that will work.
This is not an official implementation. I partially use code from the ai-forever.
Real-ESRGAN is an upgraded ESRGAN trained with pure synthetic data is capable of enhancing details while removing annoying artifacts for common real-world images.
- Paper (Real-ESRGAN: Training Real-World Blind Super-Resolution with Pure Synthetic Data)
- Original implementation
- Huggingface 🤗
pip install git+https://github.com/sberbank-ai/Real-ESRGAN.git
# we will get to that later this is not yet updatedBasic usage:
import torch
from PIL import Image
import numpy as np
from RealESRGAN import RealESRGAN
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')Low quality image:
Real-ESRGAN result:

