Add esrgan

This commit is contained in:
2026-04-05 18:05:54 +02:00
parent b622786943
commit 5f46ed6d6e
4 changed files with 367 additions and 1 deletions
+59
View File
@@ -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 <input> <output> [options]
```
**Options**
| Flag | Default | Description |
| ---------------- | ------- | --------------------------- |
| `-ss <time>` | — | Start time |
| `-to <time>` | — | End time |
| `--model <name>` | `x4` | Model (see below) |
| `--gpu <id>` | `0` | GPU device ID, `-1` for CPU |
| `--crf <n>` | `18` | Output CRF quality |
**Models**
| Flag | Model | Scale | Best for |
| ----------------- | ----------------------- | ----- | ------------------------ |
| `x4` | realesrgan-x4plus | 4x | Real-world footage (FPV) |
| `x4-anime` | realesrgan-x4plus-anime | 4x | Animation |
| `x2` / `video-x2` | realesr-animevideov3-x2 | 2x | Animation video |
| `x3` / `video-x3` | realesr-animevideov3-x3 | 3x | Animation video |
| `video-x4` | realesr-animevideov3-x4 | 4x | Animation video |
**Examples**
```bash
# Upscale a clip (recommended model for FPV)
realesrgan VID_0013.TS output.mp4 --model x4
# Test on a short segment first
realesrgan VID_0013.TS test.mp4 --model x4 -ss 00:01:00 -to 00:01:10
# CPU only
realesrgan VID_0013.TS output.mp4 --gpu -1
```
---
## To investigate
### SeedVR
[ByteDance-Seed/SeedVR](https://github.com/ByteDance-Seed/SeedVR) — video
super-resolution via diffusion model. Potentially much higher quality than
Real-ESRGAN but significantly heavier:
- Requires Python 3.10, PyTorch, `flash_attn`, `apex` (Linux/CUDA only)
- Minimum 1× H100-80G for 720p; 4× H100 for 1080p+
- Not natively runnable on Windows — needs WSL2 or a Linux machine