Skip to content

nihui/srmd-ncnn-vulkan

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SRMD ncnn Vulkan

ncnn implementation of SRMD super resolution.

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

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) or directory
  -o output-path       output image path (png) 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, default=400)
  -m model-path        srmd model path (default=models-srmd)
  -g gpu-id            gpu device to use (default=0)
  -j load:proc:save    thread count for load/proc/save (default=1:2:2)
  • 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
  • tile-size = tile size, use smaller value to reduce GPU memory usage, default is 400
  • load:proc:save = thread count for the three stages (image decoding srmd upscaling image encoding), use larger value may increase GPU utility and consume more GPU memory. You can tune this configuration as "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, do increase thread count to achieve faster processing.

If you encounter crash or error, try to upgrade 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

ncnn Project (>=20200219)

Other Open-Source Code Used