Downloads · 30 days
0
ai-forever/Real-ESRGAN
Real-ESRGAN is a machine learning model from ai-forever. Use it for the machine learning task on the model card, and read the license before you ship it in a product.
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.
Downloads · 30 days
0
Access
Public
Updated Sep 25, 2022
Repo size
202 MB
Likes
263
Trending 1
Click a slice to open those files.
.pth201 MB · 100%
From the Hugging Face model README
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.
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.
Code for using model you can obtain in our repo.
import torch
from PIL import Image
import numpy as np
from RealESRGAN import RealESRGAN
device = 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')