What is Real-ESRGAN?

Real-ESRGAN is one of Ai GAN (Generative Adversarial Network) models to enhance image or video resolution. The paper is here.

How to enhance resolution using Real-ESRGAN GitHub code ?

1. First download the code from Real-ESRGAN GitHub repository. Open a dos prompt, in the directory where you want to install, type the command:
>git clone https://github.com/xinntao/Real-ESRGAN.git
2. Download realesr-animevideov3.pth or RealESRGAN_x4plus.pth and put them at “Real-ESRGAN\weights” directory.
3. You need to configure a virtual environment to run the code. If you haven’t installed Anaconda3, go to install Anaconda3.
4. Setup a conda environment with the instruction. If you run into problems when you setup, you can download a ready-for-use gfpgan_env at Gumroad (compatible with CUDA 11.8). Unzip it and put it at your anaconda3 installation under “envs” directory.
5. Now put a short video file you want to enhance in the “inputs\video” directory. Rename the file to “onepiece_demo.mp4.”
6. If you run the project in Windows, open “inference_realesrgan_video.py” with your text editor. In line 319, change to
subprocess.call(cmd, shell=True)
7. Open an Anaconda Prompt. Run command:
>conda activate gfpgan_env
8. Still in the Anaconda prompt, go to the directory “Real-ESRGAN” and run command:
>python setup.py develop
>python inference_realesrgan_video.py -i inputs/video/onepiece_demo.mp4 -n realesr-animevideov3 -s 2 –suffix outx2
9. When it finishes, the new enhanced video is saved at “results\onepiece_demo_outx2.mp4”.


Face Resolution using GFPGAN