|
Download README.md from ai-forever/Real-ESRGAN: direct link, hf CLI and curl.
- Browser
- Download file 1.2 kB
-
https://huggingface.co/ai-forever/Real-ESRGAN/resolve/main/README.md
- Command line
-
hf download hf://ai-forever/Real-ESRGAN/README.md
-
curl -L -o README.md https://huggingface.co/ai-forever/Real-ESRGAN/resolve/main/README.md
1.2 kB
metadata
language:
- ru
- en
tags:
- PyTorch
thumbnail: https://github.com/sberbank-ai/Real-ESRGAN
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.
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.
Usage
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')