This commit is contained in:
2025-10-01 16:06:53 +02:00
commit 93c6b1c261
12 changed files with 874 additions and 0 deletions

76
Readme.md Normal file
View File

@@ -0,0 +1,76 @@
## Upscale
Automatically upscale and interpolate video files.
### Usage
0. Preparing video file (MKVToolNix)
- Make sure video file does NOT have an image attachment
- Video file should have ONE `ass` subtitle file
- Name video file similar to the following: `Your Title - 01.mkv`
1. Place `.mkv` file inside `0-Source` folder
2. Execute `python Start.py`
### Configuration
The `Start.py` file has two options INSIDE, edit in text editor:
- `INTERPOLATE_4K`: `True` or `False` (wether or not 4k48fps should be outputted)
- `MAX_INPUT_WIDTH`: `'720'` (downscales the video to this width, as 1080p upscaling would be insane)
### Requirements
- **OS**: Windows or Linux
- **GPU**: NVIDIA GPU with 16GB of VRAM
- **RAM**: Min: 16GB, Recommended: 32GB
- **Python**: >=3.12 (Windows) or Python 3.13 (Linux)
#### Additional Requirements for 4k48fps
- **GPU**: NVIDIA GPU with 24GB of VRAM
- **RAM** (Linux): 48GB (there is a memory leak in VapourSynth)
### Installation (Windows)
1. Download and install [Python 3.12](https://www.python.org/ftp/python/3.12.8/python-3.12.8-amd64.exe) - Check option to add to path
2. Download and install [Imagemagick](https://imagemagick.org/script/download.php#windows) - Check option to install legacy tools (Required for creating player previews `thumbs.vtt` and `sprite.jpg`)
3. Download and install [MKVToolNix](https://mkvtoolnix.download/downloads.html#windows) - **Add to system path environment manually**
4. Download [ffmpeg](https://www.gyan.dev/ffmpeg/builds/#release-builds) - Either place it inside the MKVToolNix install directory or create a new directory somewhere and **add it to system path environment**
5. Download and install [VapourSynth R72](https://github.com/vapoursynth/vapoursynth/releases) - Check options to install vsrepo, avisynth support not required
6. Install `vsrepo` packages, in Terminal (cmd, NOT Powershell!):
```cmd
:: FFmpeg Source Plugin
vsrepo.py install ffms2
:: (optional) Miscfilters Plugin, used for scenedetection in vsrife
:: Unsure if it even works
vsrepo.py install misc
```
7. Install `pip` packages
```cmd
pip install packaging setuptools wheel
pip install pymediainfo python-dateutil
pip install torch torchvision --index-url https://download.pytorch.org/whl/cu126
pip install vsrealesrgan vsrife
```
8. Install models used by `vsrealesrgan` and `vsrife`
```ps
python -m vsrealesrgan
python -m vsrife
```
### Installation (Arch Linux)
Sadly there is some sort of memory leak in vsrife or vapoursynth under Linux.
If you have 32GB of RAM it should suffice for everything EXCEPT 4k48p, there you probably need 48GB or 64GB of RAM.
```bash
# System Packages
sudo pacman -S python vapoursynth ffms2 ffmpeg mkvtoolnix-cli mediainfo imagemagick
# Setup virtual environment (in upscale dirctory)
python -m venv .venv
source .venv/bin/activate
# Install pip dependencies
pip install typing-extensions packaging setuptools wheel
pip install pymediainfo python-dateutil
pip install torch torchvision --index-url https://download.pytorch.org/whl/cu126
pip install vsrealesrgan vsrife
# Install models
python -m vsrealesrgan
python -m vsrife
```