From 5f46ed6d6e119526db9b68fb291d1b508eb82f7a Mon Sep 17 00:00:00 2001
From: mnerv <24420859+mnerv@users.noreply.github.com>
Date: Sun, 5 Apr 2026 18:05:54 +0200
Subject: [PATCH] Add esrgan
---
.gitignore | 3 +
README.md | 59 ++++++++++
esrgan.py | 303 +++++++++++++++++++++++++++++++++++++++++++++++++
pyproject.toml | 3 +-
4 files changed, 367 insertions(+), 1 deletion(-)
create mode 100644 esrgan.py
diff --git a/.gitignore b/.gitignore
index b4fc99b..2a81adc 100644
--- a/.gitignore
+++ b/.gitignore
@@ -13,6 +13,9 @@ wheels/
.DS_Store
Thumbs.db
+# Tools (large binaries)
+.tools/
+
# Video output
*.mp4
*.mkv
diff --git a/README.md b/README.md
index 0046245..52073b6 100644
--- a/README.md
+++ b/README.md
@@ -53,3 +53,62 @@ hdzero VID_0013.TS output.mp4 --gpu
# Limit CPU usage
hdzero VID_0013.TS output.mp4 --threads 4
```
+
+---
+
+### `realesrgan`
+
+AI upscaler using [Real-ESRGAN](https://github.com/xinntao/Real-ESRGAN) (NCNN portable executable). Upscales video by extracting frames, running Real-ESRGAN on each frame, then reassembling with original audio.
+
+Place the NCNN executable in `.tools/realesrgan-ncnn-vulkan-*/`.
+
+```sh
+realesrgan