

GitHub - nihui/realcugan-ncnn-vulkan: real-cugan converter ncnn version, runs fa...
source link: https://github.com/nihui/realcugan-ncnn-vulkan
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

Real-CUGAN ncnn Vulkan
This software is in the early development stage, it may bite your cat
ncnn implementation of Real-CUGAN converter. Runs fast on Intel / AMD / Nvidia / Apple-Silicon with Vulkan API.
realcugan-ncnn-vulkan uses ncnn project as the universal neural network inference framework.
Download
Download Windows/Linux/MacOS Executable for Intel/AMD/Nvidia/Apple-Silicon GPU
https://github.com/nihui/realcugan-ncnn-vulkan/releases
This package includes all the binaries and models required. It is portable, so no CUDA or PyTorch runtime environment is needed :)
About Real-CUGAN
Real-CUGAN (Real Cascade U-Nets for Anime Image Super Resolution)
https://github.com/bilibili/ailab/tree/main/Real-CUGAN
Usages
Example Command
realcugan-ncnn-vulkan.exe -i input.jpg -o output.png
Full Usages
Usage: realcugan-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=-1) -s scale upscale ratio (1/2/3/4, default=2) -t tile-size tile size (>=32/0=auto, default=0) can be 0,0,0 for multi-gpu -c syncgap-mode sync gap mode (0/1/2/3, default=3) -m model-path realcugan model path (default=models-se) -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
andoutput-path
accept either file path or directory pathnoise-level
= noise level, large value means strong denoise effect, -1 = no effectscale
= scale level, 1 = no scaling, 2 = upscale 2xtile-size
= tile size, use smaller value to reduce GPU memory usage, default selects automaticallysyncgap-mode
= sync gap mode, 0 = no sync, 1 = accurate sync, 2 = rough sync, 3 = very rough syncload:proc:save
= thread count for the three stages (image decoding + realcugan upscaling + image encoding), using larger values may increase GPU usage and consume more GPU memory. You can tune this configuration with "4:4:4" for many small-size images, and "2:2:2" for large-size images. The default setting usually works fine for most situations. If you find that your GPU is hungry, try increasing thread count to achieve faster processing.format
= the format of the image to be output, png is better supported, however webp generally yields smaller file sizes, both are losslessly encoded
If you encounter a crash or error, try upgrading your GPU driver:
Build from Source
- Download and setup the Vulkan SDK from https://vulkan.lunarg.com/
- For Linux distributions, you can either get the essential build requirements from package manager
dnf install vulkan-headers vulkan-loader-devel
apt-get install libvulkan-dev
pacman -S vulkan-headers vulkan-icd-loader
- Clone this project with all submodules
git clone https://github.com/nihui/realcugan-ncnn-vulkan.git cd realcugan-ncnn-vulkan git submodule update --init --recursive
- Build with CMake
- You can pass -DUSE_STATIC_MOLTENVK=ON option to avoid linking the vulkan loader library on MacOS
mkdir build cd build cmake ../src cmake --build . -j 4
Sample Images
Original Image
Upscale 2x with ImageMagick
convert origin.jpg -resize 200% output.png
Upscale 2x with ImageMagick Lanczo4 Filter
convert origin.jpg -filter Lanczos -resize 200% output.png
Upscale 2x with Real-CUGAN
realcugan-ncnn-vulkan.exe -i origin.jpg -o output.png -s 2 -n 1 -x
Original Real-CUGAN Project
Other Open-Source Code Used
- https://github.com/Tencent/ncnn for fast neural network inference on ALL PLATFORMS
- https://github.com/webmproject/libwebp for encoding and decoding Webp images on ALL PLATFORMS
- https://github.com/nothings/stb for decoding and encoding image on Linux / MacOS
- https://github.com/tronkko/dirent for listing files in directory on Windows
Recommend
-
161
A Vulkan-based translation layer for Direct3D 9/10/11 which allows running 3D applications on Linux using Wine. For the current status of the project, please refer to the proj...
-
98
README.md ? volk
-
155
README.md waifu2x-ncnn-vulkan waifu2x converter ncnn version, runs fast on intel / amd / nvidia with vulkan waifu2x-ncnn-vulkan use ncnn project...
-
11
Vulkan C++ examples and demos A comprehensive collection of open source C++ examples for Vulkan®, the new generation graphics and compute API from Khronos. Table of Contents...
-
10
scop is a 3D model viewer made with Vulkan, C++20 and GLFW. Features scop can load Wavefront .obj files and is controllable with GUI Compiling Make sure you have the libraries by running git submodule ini...
-
11
The release includes new Provisional Vulkan Video extensions NVIDIA has announced the availability of a new Vulkan GeForce Graphics driver update, namely version 458.17 beta, which adds new extensio...
-
16
Layers Overview and Configuration Vulkan supports intercepting or hooking API entry points via a layer framework. A layer can intercept all or any subset of Vulkan API entry points. Multiple layers can be chained together to cascad...
-
7
Apress Source Code This repository accompanies Ray Tracing Gems II: Next Generation Rendering with DXR, Vulkan, and OptiX by Adam Marrs, Peter Shirley, and Ingo Wald (Apress...
-
7
Vulkan update: version 1.1 conformance for Raspberry Pi 4 Igalia’s Iago Toral is back with another Vulkan update. It has been almost a year since we
-
9
Vulkan update: version 1.2 conformance for Raspberry Pi 4 Long before Raspberry Pi happened, I used to design graphics processing units (GPUs) for a living: along with James Adams, G...
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK