Skip to content

Hassanibrar632/Real_ESRGAN

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NOTE: The repo is created using this repo by ai-forever

Real-ESRGAN

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.

Installation

pip install git+https://github.com/sberbank-ai/Real-ESRGAN.git
# we will get to that later this is not yet updated

Usage


Basic 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')

Examples


Low quality image:

Real-ESRGAN result:

About

This repository provides a complete solution for upscaling images and videos using ESRGAN (Enhanced Super-Resolution Generative Adversarial Network). It includes both front-end and back-end code, enabling users to easily upscale media through a web interface or API.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages