1 Star 0 Fork 15

wanggguoq/OcrLiteNcnn

forked from benjaminwan/OcrLiteNcnn 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
build.bat 2.06 KB
一键复制 编辑 原始数据 按行查看 历史
@ECHO OFF
chcp 65001
cls
@SETLOCAL
echo "========请先参考README.md准备好编译环境========"
echo.
echo "========编译选项========"
echo "请注意:项目默认使用Release库,除非您自行编译Debug版的ncnn和Opencv,否则请不要选择Debug编译"
echo "请输入编译选项并回车: 1)Release, 2)Debug"
set BUILD_TYPE=Release
set /p flag=
if %flag% == 1 (set BUILD_TYPE=Release)^
else if %flag% == 2 (set BUILD_TYPE=Debug)^
else (echo 输入错误!Input Error!)
echo.
echo "请选择要使用的ncnn库选项并回车: 1)ncnn(CPU),2)ncnn(vulkan)"
set BUILD_NCNN_VULKAN="CPU"
set /p flag=
if %flag% == 1 (set BUILD_NCNN_VULKAN="CPU")^
else if %flag% == 2 (set BUILD_NCNN_VULKAN="GPU")^
else (echo "输入错误!Input Error!")
echo.
echo "请注意:如果选择2)JNI动态库时,必须安装配置Oracle JDK"
echo "请选择编译输出类型并回车: 1)BIN可执行文件,2)JNI动态库,3)C动态库"
set /p flag=
if %flag% == 1 (set BUILD_OUTPUT="BIN")^
else if %flag% == 2 (set BUILD_OUTPUT="JNI")^
else if %flag% == 3 (set BUILD_OUTPUT="CLIB")^
else (echo 输入错误!Input Error!)
echo.
echo "VS版本: 1)vs2017-x64,2)vs2017-x86, 3)vs2019-x64, 4)vs2019-x86"
set BUILD_CMAKE_T="v141"
set BUILD_CMAKE_A="x64"
set /p flag=
if %flag% == 1 (
set BUILD_CMAKE_T="v141"
set BUILD_CMAKE_A="x64"
)^
else if %flag% == 2 (
set BUILD_CMAKE_T="v141"
set BUILD_CMAKE_A="Win32"
)^
else if %flag% == 3 (
set BUILD_CMAKE_T="v142"
set BUILD_CMAKE_A="x64"
)^
else if %flag% == 4 (
set BUILD_CMAKE_T="v142"
set BUILD_CMAKE_A="Win32"
)^
else (echo 输入错误!Input Error!)
echo.
mkdir win-%BUILD_OUTPUT%-%BUILD_NCNN_VULKAN%-%BUILD_CMAKE_A%
pushd win-%BUILD_OUTPUT%-%BUILD_NCNN_VULKAN%-%BUILD_CMAKE_A%
cmake -T "%BUILD_CMAKE_T%,host=x64" -A %BUILD_CMAKE_A% ^
-DCMAKE_INSTALL_PREFIX=install ^
-DCMAKE_BUILD_TYPE=%BUILD_TYPE% -DOCR_OUTPUT=%BUILD_OUTPUT% -DOCR_VULKAN=%BUILD_NCNN_VULKAN% ..
cmake --build . --config %BUILD_TYPE% -j %NUMBER_OF_PROCESSORS%
cmake --build . --config %BUILD_TYPE% --target install
popd
GOTO:EOF
@ENDLOCAL
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/wanggguoq/ocr-lite-ncnn.git
git@gitee.com:wanggguoq/ocr-lite-ncnn.git
wanggguoq
ocr-lite-ncnn
OcrLiteNcnn
master

搜索帮助

0d507c66 1850385 C8b1a773 1850385