Skip to content

Commit 80078b3

Browse files
committed
update ndk & readme
1 parent 8a22718 commit 80078b3

File tree

10 files changed

+22
-17
lines changed

10 files changed

+22
-17
lines changed

README_CHS.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,11 @@
5858
2. (举例转换onnx模型到mnn格式)直接输入命令 `MNNConvert -f ONNX --modelFile "{onnx_path}" --MNNModel "{mnn_path}" --bizCode biz --fp16 --info --detectSparseSpeedUp`
5959
3. 修改mnn模型文件名,使包含缩放倍率信息,如:`4xabcdefg.mnn`或者`abc-x4-def.mnn`或者者`abc_4x_def.mnn`,并复制mnn模型到设置的自定义模型目录中。如果文件名包含关键字`Grayscale` `Gray2YCbCr` `Gray2YUV` `YCbCr` `YUV`则应用相应的色彩空间。
6060

61+
## 在线/脚本快速转换 mnn 模型
62+
1. 你可以通过如下网址在线转换mnn模型。输入pth/onnx模型文件,点击按钮并等待即可得到mnn文件。下载转换好的mnn模型并复制到自定义模型目录中即可。
63+
https://huggingface.co/spaces/tumuyan2/model2mnn
64+
2. 这个仓库同时也提供了Windows版本的bat,这需要一些Python的使用经验。简单讲打包下载仓库文件,在python环境中安装必要的依赖,然后打开`pth2onnx.bat`并拖入pth文件即可转换pth到onnx,同理可以用`onnx2mnn.bat`转换onnx到mnn。
65+
6166
## 为 RealSR-NCNN-Android-GUI 增加更多ncnn模型
6267

6368
RealSR-NCNN-Android-GUI 在 ver 1.7.6 以上的版本可以自动加载自定义模型。

RealSR-NCNN-Android-CLI/Anime4k/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,6 @@ android {
2323
path file('src/main/jni/CMakeLists.txt')
2424
}
2525
}
26-
ndkVersion '25.2.9519653'
26+
ndkVersion '29.0.13599879 rc2'
2727
namespace 'com.tumuyan.ncnn.realsr'
2828
}

RealSR-NCNN-Android-CLI/MNN-SR/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,5 @@ android {
1919
path file('src/main/jni/CMakeLists.txt')
2020
}
2121
}
22-
ndkVersion '29.0.13113456 rc1'
22+
ndkVersion '29.0.13599879 rc2'
2323
}

RealSR-NCNN-Android-CLI/MNN-SR/src/main/jni/CMakeLists.txt

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1+
cmake_minimum_required(VERSION 3.5)
12
project(mnnsr-ncnn)
2-
3-
cmake_minimum_required(VERSION 3.4.1)
43
set(CMAKE_CXX_STANDARD 20)
54
set(CMAKE_CXX_STANDARD_REQUIRED ON)
65
set(CMAKE_INSTALL_RPATH "$ORIGIN")
@@ -102,30 +101,30 @@ message(STATUS "TARGET_ARCH: ${TARGET_ARCH}")
102101
include_directories(${mnn_DIR}/include)
103102
#include_directories(${mnn_DIR}/${ANDROID_ABI}/include/MNN)
104103

105-
104+
message(STATUS "Find mnn in: ${mnn_DIR}")
106105
if (EXISTS ${MNN_LIB})
107-
message(STATUS "find mnn: ${MNN_LIB}")
106+
#message(STATUS "find mnn: ${MNN_LIB}")
108107
else ()
109-
message(STATUS "mnn library not found!")
108+
message(STATUS " mnn library not found!")
110109
set(MNN_LIB "${mnn_DIR}/${ANDROID_ABI}/libMNN.so")
111110
endif ()
112-
message(STATUS "find mnn result: ${MNN_LIB}")
111+
message(STATUS "Found mnn: ${MNN_LIB}")
113112

114113

115114
add_library(ncnn SHARED IMPORTED)
116115
include_directories(${ncnn_DIR}/${TARGET_ARCH}/include/ncnn)
117116
# set_target_properties(ncnn PROPERTIES IMPORTED_LOCATION ${ncnn_LIB})
118117

119118

120-
message(STATUS "find ncnn in: ${ncnn_DIR}/${TARGET_ARCH}/lib")
119+
message(STATUS "Find ncnn in: ${ncnn_DIR}/${TARGET_ARCH}/lib")
121120
find_library(NCNN_LIB NAMES ncnn libncnn PATHS "${ncnn_DIR}/${TARGET_ARCH}/lib")
122121
if (EXISTS ${NCNN_LIB})
123-
message(STATUS "Found ncnn: ${NCNN_LIB}")
122+
#message(STATUS "Found ncnn: ${NCNN_LIB}")
124123
else ()
125-
message(STATUS "ncnn library not found!")
124+
message(STATUS " ncnn library not found!")
126125
set(NCNN_LIB "${ncnn_DIR}/${TARGET_ARCH}/lib/libncnn.so")
127126
endif ()
128-
message(STATUS "find ncnn result: ${NCNN_LIB}")
127+
message(STATUS "Found ncnn: ${NCNN_LIB}")
129128

130129
set(OpenCV_STATIC ON)
131130
find_package(OpenCV REQUIRED)

RealSR-NCNN-Android-CLI/RealCUGAN/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,6 @@ android {
2222
path file('src/main/jni/CMakeLists.txt')
2323
}
2424
}
25-
ndkVersion '25.2.9519653'
25+
ndkVersion '29.0.13599879 rc2'
2626
namespace 'com.tumuyan.ncnn.realsr'
2727
}

RealSR-NCNN-Android-CLI/RealSR/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,6 @@ android {
2222
path file('src/main/jni/CMakeLists.txt')
2323
}
2424
}
25-
ndkVersion '25.2.9519653'
25+
ndkVersion '29.0.13599879 rc2'
2626
namespace 'com.tumuyan.ncnn.realsr'
2727
}

RealSR-NCNN-Android-CLI/Resize/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,6 @@ android {
2222
path file('src/main/jni/CMakeLists.txt')
2323
}
2424
}
25-
ndkVersion '25.2.9519653'
25+
ndkVersion '29.0.13599879 rc2'
2626
namespace 'com.tumuyan.ncnn.realsr'
2727
}

RealSR-NCNN-Android-CLI/SRMD/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,6 @@ android {
2222
path file('src/main/jni/CMakeLists.txt')
2323
}
2424
}
25-
ndkVersion '25.2.9519653'
25+
ndkVersion '29.0.13599879 rc2'
2626
namespace 'com.tumuyan.ncnn.realsr'
2727
}

RealSR-NCNN-Android-CLI/Waifu2x/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,6 @@ android {
2222
path file('src/main/jni/CMakeLists.txt')
2323
}
2424
}
25-
ndkVersion '25.2.9519653'
25+
ndkVersion '29.0.13599879 rc2'
2626
namespace 'com.tumuyan.ncnn.realsr'
2727
}

RealSR-NCNN-Android-GUI/app/src/main/res/values-zh/strings.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
\n常见错误:https://note.youdao.com/s/3xv6h5iv
1313
\n模型和算法的说明:https://note.youdao.com/s/6XlIFbWt
1414
\n添加更多模型: https://note.youdao.com/s/XEv68sBU (包含waifu2x realsr real-esrgan模型,欢迎在酷安、github或者这篇笔记的评论区讨论这些额外的模型)
15+
\n在线转换mnn模型:https://huggingface.co/spaces/tumuyan2/model2mnn
1516
\n爱发电打赏: https://afdian.com/a/tumuyan
1617

1718
\n\n\n本应用除使用下拉选项中的预设参数外,还支持在输入框内输入命令。

0 commit comments

Comments
 (0)