Skip to content
This repository has been archived by the owner on May 13, 2022. It is now read-only.

Dynamic Link Library for Waifu2x implemented with NCNN and Vulkan & 用NCNN和Vulkan实现的Waifu2x的动态链接库版本

License

Notifications You must be signed in to change notification settings

Aloento/Waifu2x-Vulkan-Library

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Waifu2x-Vulkan-Library

For English

用NCNN和Vulkan实现的Waifu2x的动态链接库版本
即开即用版:https://github.com/Aloento/YourWaifu2x

关于

本库是 ArknightsAssetStudio 的一部分
Wrapper相关代码大多由 @zuoziqi 编写

对Waifu2x的介绍请参阅
https://github.com/nagadomi/waifu2x
对Waifu2x_NCNN_Vulkan的介绍请参阅
https://github.com/nihui/waifu2x-ncnn-vulkan

使用方法

使用本库非常简单
假设我们的目标运行环境是 Windows10

获取

发布的库稳定版本
OpenMP依赖库(非必要)
模型

自行编译

安装依赖

拉取源码

git clone [email protected]:Aloento/Waifu2x-Vulkan-Library.git
cd Waifu2x-Vulkan-Library
git submodule update --init --recursive

修改代码以符合需求

生成传统DLL
  • 注释掉 wrapper.h 中的第12行,并将第11行解除注释
  • 删除 CMakeLists.txt 中第229行的 wrapper_wrap.cxx
  • 进行编译
mkdir build
cd build
cmake ../src
cmake --build . -j 4

随后你将得到名为 libWaifu2x.dll 的文件
它可以通过任何Native方式加载,如JNA和P/Invoke

生成目标语言代码

假设我们要生成给在Windows下C#使用的代码

cd src
swig -c++ -csharp wrapper_win.i
mkdir build
cd build
cmake ../
cmake --build . -j 4

随后,生成的*.cs文件即可给C#项目使用
不要忘记复制生成的 libWaifu2x.dll

调用

具体调用和使用范例请参阅
https://github.com/Aloento/Waifu2x-Vulkan-CSharp

About

Dynamic Link Library for Waifu2x implemented with NCNN and Vulkan & 用NCNN和Vulkan实现的Waifu2x的动态链接库版本

Topics

Resources

License

Stars

Watchers

Forks

Languages

  • C 74.9%
  • C++ 22.4%
  • CMake 2.6%
  • SWIG 0.1%