waifu2x ncnn vulkan
Release 20220728
WAIFU2X轉換器的NCNN實現。使用Vulkan API在Intel / AMD / NVIDIA / Apple-Silicon上快速運行。
WAIFU2X-NCNN-VULKAN使用NCNN項目作為通用神經網絡推理框架。
下載Windows/linux/MacOS可為Intel/AMD/NVIDIA GPU執行
https://github.com/nihui/waifu2x-ncnn-vulkan/releases
該軟件包包括所有所需的二進製文件和型號。它是便攜式的,因此不需要CUDA或CAFFE運行時環境:)
waifu2x-ncnn-vulkan.exe -i input.jpg -o output.png -n 2 -s 2 Usage: waifu2x-ncnn-vulkan -i infile -o outfile [options]...
-h show this help
-v verbose output
-i input-path input image path (jpg/png/webp) or directory
-o output-path output image path (jpg/png/webp) or directory
-n noise-level denoise level (-1/0/1/2/3, default=0)
-s scale upscale ratio (1/2/4/8/16/32, default=2)
-t tile-size tile size (>=32/0=auto, default=0) can be 0,0,0 for multi-gpu
-m model-path waifu2x model path (default=models-cunet)
-g gpu-id gpu device to use (-1=cpu, default=auto) can be 0,1,2 for multi-gpu
-j load:proc:save thread count for load/proc/save (default=1:2:2) can be 1:2,2,2:2 for multi-gpu
-x enable tta mode
-f format output image format (jpg/png/webp, default=ext/png)input-path和output-path接受文件路徑或目錄路徑noise-level =噪聲水平,大價值意味著強烈的denoise效應,-1 =無效scale =比例水平,1 =無標度,2 =高檔2xtile-size =瓷磚大小,使用較小的值來減少GPU內存使用情況,默認值自動選擇load:proc:save =三個階段的線程計數(圖像解碼 + WAIFU2X升級 +圖像編碼),使用較大的值可能會增加GPU使用情況並消耗更多的GPU內存。您可以為許多小型圖像使用“ 4:4:4”來調整此配置,對於大型圖像,“ 2:2:2”。默認設置通常在大多數情況下都可以正常工作。如果您發現自己的GPU餓了,請嘗試增加線程計數以實現更快的處理。format =要輸出的圖像的格式,PNG得到更好的支持,但是WebP通常會產生較小的文件大小,兩者均無損編碼如果遇到崩潰或錯誤,請嘗試升級GPU驅動程序:
dnf install vulkan-headers vulkan-loader-develapt-get install libvulkan-devpacman -S vulkan-headers vulkan-icd-loadergit clone https://github.com/nihui/waifu2x-ncnn-vulkan.git
cd waifu2x-ncnn-vulkan
git submodule update --init --recursivemkdir build
cd build
cmake ../src
cmake --build . -j 4 Measure-Command { waifu2x-ncnn-vulkan.exe - i input.png - o output.png - n 2 - s 2 - t [ block size ] - m [ model dir ] } Measure-Command { waifu2x-caffe-cui.exe - t 0 -- gpu 0 - b 1 - c [ block size ] - p cudnn -- model_dir [ model dir ] - s 2 - n 2 - m noise_scale - i input.png - o output.png }| 圖像大小 | 目標大小 | 塊大小 | 總時間 | GPU內存(MB) | |
|---|---|---|---|---|---|
| WAIFU2X-NCNN-VULKAN | 200x200 | 400x400 | 400/200/100 | 0.86/0.86/0.82 | 638/638/197 |
| waifu2x-cui | 200x200 | 400x400 | 400/200/100 | 2.54/2.39/2.36 | 3017/936/843 |
| WAIFU2X-NCNN-VULKAN | 400x400 | 800x800 | 400/200/100 | 1.17/1.04/1.02 | 2430/638/197 |
| waifu2x-cui | 400x400 | 800x800 | 400/200/100 | 2.91/2.43/2.7 | 3202/1389/1178 |
| WAIFU2X-NCNN-VULKAN | 1000x1000 | 2000x2000 | 400/200/100 | 2.35/2.26/2.46 | 2430/638/197 |
| waifu2x-cui | 1000x1000 | 2000x2000 | 400/200/100 | 4.04/3.79/4.35 | 3258/1582/1175 |
| WAIFU2X-NCNN-VULKAN | 2000x2000 | 4000x4000 | 400/200/100 | 6.46/6.59/7.49 | 2430/686/213 |
| waifu2x-cui | 2000x2000 | 4000x4000 | 400/200/100 | 7.01/7.54/10.11 | 3258/1499/1200 |
| WAIFU2X-NCNN-VULKAN | 4000x4000 | 8000x8000 | 400/200/100 | 22.78/23.78/27.61 | 2448/654/213 |
| waifu2x-cui | 4000x4000 | 8000x8000 | 400/200/100 | 18.45/21.85/31.82 | 3325/1652/1236 |
| 圖像大小 | 目標大小 | 塊大小 | 總時間 | GPU內存(MB) | |
|---|---|---|---|---|---|
| WAIFU2X-NCNN-VULKAN | 200x200 | 400x400 | 400/200/100 | 0.74/0.75/0.72 | 482/482/142 |
| waifu2x-cui | 200x200 | 400x400 | 400/200/100 | 2.04/1.99/1.99 | 995/546/459 |
| WAIFU2X-NCNN-VULKAN | 400x400 | 800x800 | 400/200/100 | 0.95/0.83/0.81 | 1762/482/142 |
| waifu2x-cui | 400x400 | 800x800 | 400/200/100 | 2.08/2.12/2.11 | 995/546/459 |
| WAIFU2X-NCNN-VULKAN | 1000x1000 | 2000x2000 | 400/200/100 | 1.52/1.41/1.44 | 1778/482/142 |
| waifu2x-cui | 1000x1000 | 2000x2000 | 400/200/100 | 2.72/2.60/2.68 | 1015/570/459 |
| WAIFU2X-NCNN-VULKAN | 2000x2000 | 4000x4000 | 400/200/100 | 3.45/3.42/3.63 | 1778/482/142 |
| waifu2x-cui | 2000x2000 | 4000x4000 | 400/200/100 | 3.90/4.01/4.35 | 1015/521/462 |
| WAIFU2X-NCNN-VULKAN | 4000x4000 | 8000x8000 | 400/200/100 | 11.16/11.29/12.07 | 1796/498/158 |
| waifu2x-cui | 4000x4000 | 8000x8000 | 400/200/100 | 9.24/9.81/11.16 | 995/546/436 |

convert origin.jpg -resize 200% output.png
convert origin.jpg -filter Lanczos -resize 200% output.png
waifu2x-ncnn-vulkan.exe -i origin.jpg -o output.png -n 2 -s 2