• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..03-May-2022-

deps/ncnn/H03-May-2022-475,831376,844

src/H03-May-2022-755572

.gitignoreH A D10-Jun-202126 54

.gitmodulesH A D10-Jun-202185 43

LICENSEH A D10-Jun-20211.1 KiB2419

README.mdH A D10-Jun-20213.6 KiB10975

README.md

1# VapourSynth Waifu2x NCNN Vulkan Plugin
2
3Waifu2x filter for VapourSynth, based on [waifu2x-ncnn-vulkan](https://github.com/nihui/waifu2x-ncnn-vulkan).
4
5## Install
6
7Download pre-built binaries and model files from [releases](https://github.com/Nlzy/vapoursynth-waifu2x-ncnn-vulkan/releases). Uncompress and put into VapourSynth plugin folder.
8
9## Usage
10
11```
12core.w2xnvk.Waifu2x(clip[, noise, scale, model, tile_size, gpu_id, gpu_thread, precision, tile_size_w, tile_size_h])
13```
14
15* clip: Input clip. Only 32-bit float RGB is supported.
16
17* noise: Denoise level. (int -1/0/1/2/3, defualt=0)
18  * -1 = none
19  * 0 = low
20  * 1 = medium
21  * 2 = high
22  * 3 = highest
23
24* scale: Upscale ratio. (int 1/2, default=2)
25  * 1 = no scaling, denoise only. upconv_7 doesn't support this mode.
26  * 2 = upscale 2x.
27
28* model: Model to use. (int 0/1/2, default=0)
29  * 0 = upconv_7_anime_style_art_rgb
30  * 1 = upconv_7_photo
31  * 2 = cunet (For 2D artwork. Slow, but better quality.)
32
33* tile_size: Tile size. Must be divisible by 4. Increasing this value may improve performance and take more VRAM. (int >=32, default=0 for auto choose)
34
35* gpu_id: GPU device to use. (int >=0, default=0)
36
37* gpu_thread: Number of threads that can simultaneously access GPU. (int >=1, default=0 for auto detect)
38
39* precision: Floating-point precision. Single-precision (fp32) is slow but more precise in color. Default is half-precision (fp16). (int 16/32, default=16)
40
41* tile_size_w / tile_size_h: Override width and height of tile_size.
42
43## Performance Comparison
44
45### AMD graphics card
46
47* Ryzen 5 1600X + Radeon RX 580 2048SP
48* vapoursynth-waifu2x-ncnn-vulkan: `core.w2xnvk.Waifu2x(last, noise=0, scale=2)`
49* vapoursynth-waifu2x-w2xc: `core.w2xc.Waifu2x(last, noise=0, scale=2)`
50
51|                                 |  540p -> 1080p |  720p -> 2K | 1080p -> 4K |
52|---------------------------------|----------------|-------------|-------------|
53| vapoursynth-waifu2x-w2xc        |      0.744 fps |   0.435 fps |   0.199 fps |
54| vapoursynth-waifu2x-ncnn-vulkan |      3.203 fps |   1.788 fps |   0.795 fps |
55
56### NVIDIA graphics card
57
58* Ryzen 3 1400 + GeForce GTX 1050 Ti
59* vapoursynth-waifu2x-ncnn-vulkan: `core.w2xnvk.Waifu2x(last, noise=0, scale=2, model=0)`
60* vapoursynth-waifu2x-caffe: `core.caffe.Waifu2x(last, noise=0, scale=2, model=3)`
61
62|                                 |  540p -> 1080p |  720p -> 2K | 1080p -> 4K |
63|---------------------------------|----------------|-------------|-------------|
64| vapoursynth-waifu2x-caffe       |      1.674 fps |   1.085 fps |   0.477 fps |
65| vapoursynth-waifu2x-ncnn-vulkan |      1.880 fps |   1.034 fps |   0.471 fps |
66
67## Build
68
69### Arch Linux
70
71```bash
72# Install Vulkan SDK and something else:
73sudo pacman -S vapoursynth glslang vulkan-icd-loader vulkan-headers
74
75# Clone repository and submodule
76git clone https://github.com/Nlzy/vapoursynth-waifu2x-ncnn-vulkan.git
77cd vapoursynth-waifu2x-ncnn-vulkan
78git submodule update --init --recursive
79mkdir build
80cd build
81
82# build
83cmake ..
84cmake --build . -j 4
85```
86
87### Windows
88
89Install [Vulkan SDK](https://vulkan.lunarg.com/sdk/home).
90
91Open `Git Bash`, clone repository and submodule:
92
93```bash
94git clone https://github.com/Nlzy/vapoursynth-waifu2x-ncnn-vulkan.git
95cd vapoursynth-waifu2x-ncnn-vulkan
96git submodule update --init --recursive
97mkdir build
98```
99
100Open `Start Menu` -> `Visual Studio 2019` -> `x64 Native Tools Command Prompt for VS 2019`, then build:
101
102```
103cd X:\path_to_vapoursynth-waifu2x-ncnn-vulkan\build
104cmake -G "NMake Makefiles" -DVAPOURSYNTH_HEADER_DIR=X:\path_to_vapoursynth\sdk\include\vapoursynth ..
105cmake --build .
106```
107
108Note: If you are using VapourSynth "Portable" version, use `-DVAPOURSYNTH_HEADER_DIR=X:\path_to_vapoursynth\sdk\include` instead.
109