explaingit

xinntao/real-esrgan

35,324PythonAudience · generalComplexity · 3/5Setup · moderate

TLDR

Real-ESRGAN is a Python deep learning tool that upscales and restores degraded images and videos, old photos, compressed frames, and anime art, producing sharper, higher-resolution outputs by training on realistic degradation patterns rather than clean downsampling.

Mindmap

mindmap
  root((Real-ESRGAN))
    What it does
      Image upscaling
      Artifact removal
      Video restoration
    Specialized Models
      General photos
      Anime images
      Face enhancement
    Supported Inputs
      Old photographs
      Scanned artwork
      Video frames
    Tech stack
      Python
      PyTorch
      NCNN-Vulkan portable
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Things people build with this

USE CASE 1

Upscale and restore old or blurry family photos to 4× resolution with realistic detail and reduced compression artifacts.

USE CASE 2

Enhance anime images or video frames using the specialized anime model for print or high-DPI display.

USE CASE 3

Batch-process scanned documents or artwork to remove JPEG artifacts and increase resolution.

USE CASE 4

Improve low-resolution video quality by processing frames through Real-ESRGAN before re-encoding.

Tech stack

PythonPyTorchNCNN-VulkanGFPGAN

Getting it running

Difficulty · moderate Time to first run · 30min

Requires Python with PyTorch, a GPU dramatically speeds up processing but CPU mode is available via portable NCNN-Vulkan executables.

In plain English

Real-ESRGAN is a Python tool for upscaling and restoring low-quality images and videos using deep learning. Upscaling means taking a small or degraded image and producing a larger, sharper, more detailed version, a process formally called super-resolution. The "ESRGAN" part stands for Enhanced Super-Resolution Generative Adversarial Network, a type of neural network designed specifically for this task. The "Real" prefix indicates that this version is specifically trained to handle the kinds of degradations that appear in real-world photos and scans, not just simple artificial downsampling. The problem Real-ESRGAN solves is that real-world images suffer from complex combinations of degradation: blurriness, JPEG compression artifacts, noise, and low resolution all at once. Earlier super-resolution tools were trained only on cleanly downsampled images and performed poorly on genuinely degraded inputs. Real-ESRGAN addresses this by training entirely on synthetic data that mimics realistic degradation patterns, producing a model that generalizes well to actual old photos, scanned documents, and compressed video frames. Key features include a general-purpose model for photographs, a specialized model optimized for anime images and video (using a much smaller, faster neural network), optional face enhancement by integrating a companion face restoration model called GFPGAN, and adjustable denoising strength to prevent over-smoothing. It supports processing images with alpha channels (transparency), gray images, and 16-bit images. You would use Real-ESRGAN when enhancing old or low-resolution photographs, restoring scanned artwork or documents, upscaling anime images for print, or improving video quality. It can be run via command line, Python API, or portable executables that require no Python installation. The tech stack is Python using PyTorch for neural network inference. Portable GPU-accelerated executables (via NCNN-Vulkan) are also available for Windows, Linux, and macOS.

Copy-paste prompts

Prompt 1
Run Real-ESRGAN on a folder of old JPEG photos to upscale them 4× and reduce compression artifacts. Give me the command-line invocation with the general-purpose RealESRGAN_x4plus model.
Prompt 2
I have a batch of anime screenshots at 720p I want to upscale to 4K using Real-ESRGAN's anime model. Show me the Python API code to process them with the realesr-animevideov3 model.
Prompt 3
I want to enhance faces in old degraded photographs using Real-ESRGAN with the built-in GFPGAN face enhancement. Provide the command-line flag and explain what face enhancement adds on top of normal upscaling.
Prompt 4
How do I use Real-ESRGAN to upscale a video from 480p to 1080p? Walk me through extracting frames with ffmpeg, processing them with Real-ESRGAN, and reassembling the video.
Open on GitHub → Explain another repo

← xinntao on gitmyhub — every repo by this author, as a profile.

Verify against the repo before relying on details.