Giter Site home page Giter Site logo

srmd-ncnn-vulkan's Introduction

SRMD ncnn Vulkan

CI download

ncnn implementation of SRMD super resolution.

srmd-ncnn-vulkan uses ncnn project as the universal neural network inference framework.

Download Windows/Linux/MacOS Executable for Intel/AMD/Nvidia GPU

https://github.com/nihui/srmd-ncnn-vulkan/releases

This package includes all the binaries and models required. It is portable, so no CUDA or Caffe runtime environment is needed :)

Usages

Example Command

srmd-ncnn-vulkan.exe -i input.jpg -o output.png -n 3 -s 2

Full Usages

Usage: srmd-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/4/5/6/7/8/9/10, default=3)
  -s scale             upscale ratio (2/3/4, default=2)
  -t tile-size         tile size (>=32/0=auto, default=0) can be 0,0,0 for multi-gpu
  -m model-path        srmd model path (default=models-srmd)
  -g gpu-id            gpu device to use (default=0) 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 and output-path accept either file path or directory path
  • noise-level = noise level, large value means strong denoise effect, -1 = no effect
  • scale = scale level, 2 = upscale 2x, 3 = upscale 3x, 4 = upscale 4x
  • tile-size = tile size, use smaller value to reduce GPU memory usage, default selects automatically
  • load:proc:save = thread count for the three stages (image decoding + waifu2x 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:

Sample Images

Original Image

origin

Upscale 4x with ImageMagick Lanczo4 Filter

convert origin.jpg -resize 400% output.png

browser

Upscale 4x with waifu2x scale=2 model=upconv_7_photo twice

waifu2x-ncnn-vulkan.exe -i origin.jpg -o 2x.png -s 2 -m models-upconv_7_photo
waifu2x-ncnn-vulkan.exe -i 2x.png -o 4x.png -s 2 -m models-upconv_7_photo

waifu2x

Upscale 4x with srmd noise=3 scale=4

srmd-ncnn-vulkan.exe -i origin.jpg -o output.png -n 3 -s 4

srmd

Original SRMD Project

Other Open-Source Code Used

srmd-ncnn-vulkan's People

Contributors

mavericktse avatar nihui avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

srmd-ncnn-vulkan's Issues

Your Results in New Super-Resolution Benchmarks

Hello,

MSU Graphics & Media Lab Video Group has recently launched two new Super-Resolution Benchmarks.

Your method achieved 19th place in Video Upscalers Benchmark: Quality Enhancement in 'Animation 4x' category. We look forward to your future work!

We would be grateful for your feedback on our work.

[Unrelated request for ESRGAN]

Thanks for the work!
Can you consider implement ESRGAN in ncnn, please? お願い!
It seems like it's the State-of-the-art of super resolution and would be really really nice to have.

Anyway, thanks again!

Wrong number of arguments to ncnn API functions?

I get a lot of errors related to the ncnn API functions like the following when trying to compile:

ninja
[13/15] Building CXX object CMakeFiles/srmd-ncnn-vulkan.dir/srmd.cpp.o
FAILED: CMakeFiles/srmd-ncnn-vulkan.dir/srmd.cpp.o
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++   -I. -isystem /usr/local/include/ncnn -isystem /usr/local/include -Xclang -fopenmp -I/usr/local/opt/libomp/include -O3 -DNDEBUG -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk -fPIE   -Xclang -fopenmp -I/usr/local/opt/libomp/include -MD -MT CMakeFiles/srmd-ncnn-vulkan.dir/srmd.cpp.o -MF CMakeFiles/srmd-ncnn-vulkan.dir/srmd.cpp.o.d -o CMakeFiles/srmd-ncnn-vulkan.dir/srmd.cpp.o -c ../srmd.cpp
../srmd.cpp:123:31: error: no matching member function for call to 'create'
                srmd_preproc->create(srmd_preproc_tta_int8s_spv_data, sizeof(srmd_preproc_tta_int8s_spv_data), "srmd_preproc_tta_int8s", specializations, 9, 10);
                ~~~~~~~~~~~~~~^~~~~~
/usr/local/include/ncnn/pipeline.h:44:9: note: candidate function not viable: requires 4 arguments, but 6 were provided
    int create(VkShaderModule shader_module, const std::vector<vk_specialization_type>& specializations, int binding_count, int push_constant_count);

The same thing happens when trying to compile nihui/waifu2x-ncnn-vulkan. In all cases, candidate function not viable: requires m arguments, but n were provided. I compiled and installed ncnn from https://github.com/Tencent/ncnn.

Do you have any insight into what's going on?

Deblur request

Hi,

Is it possible for you to somehow make this work on image deblurring also ?

关于srmd 模型param文件里的一个问题

up ,srmd_x4.param 第一个conv的weight_data_size是21888 这个如果没有问题的话 那意味着输入图像的channel size是19?33128*19=21888?那这个输入的预处理是怎么做成19通道的呢?

vkEnumeratePhysicalDevices failed -3

run with ubuntu18.04 error but my windows pc run success, Ubuntu Nvidia RTX2080TI*2 Driver Version: 460.56
vkEnumeratePhysicalDevices failed -3
invalid gpu device

-j 2:2:2 causes my single-GPU system to entirely crash

Can -j 2 (and similar things) be blocked on single GPU systems? I think some motherboards might be better about this but not mine. Mine does a complete restart without warning if I use -j 2 or -j 2:2:2.

I am not sure entirely what the issue and my motherboard/CPU is a bit dated, but I know that using -j 1:1:1 works fine.

scale=1

Hello, could there be an option for no scaling, and just denoising?

16bit

Can you add in or enable saving to 16bit/channel (48bit PNG)?
I have tried exporting images with AVISynth with 8 bit and 16bit, but it always saves back to 8bit/channel (24bit PNG).
Thanks for your time.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.