-
Notifications
You must be signed in to change notification settings - Fork 15
/
run-test.bat
70 lines (60 loc) · 1.49 KB
/
run-test.bat
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
chcp 65001
:: Set Param
@ECHO OFF
@SETLOCAL
echo "Setting the Number of Threads=%NUMBER_OF_PROCESSORS% Using an OpenMP Environment Variable"
set OMP_NUM_THREADS=%NUMBER_OF_PROCESSORS%
:MainExec
echo "Gpu版本测试前请先安装Vulkan SDK v1.2.162.0,https://vulkan.lunarg.com/sdk/home"
echo "请输入测试选项并回车: 1)CPU-x64, 2)CPU-x86, 3)GPU-x64, 4)GPU-x86"
set GPU_INDEX=-1
set /p flag=
if %flag% == 1 (call :PrepareCpuX64)^
else if %flag% == 2 (call :PrepareCpuX86)^
else if %flag% == 3 (call :PrepareGpuX64)^
else if %flag% == 4 (call :PrepareGpuX86)^
else (echo 输入错误!Input Error!)
SET TARGET_IMG=images/1.jpg
if not exist %TARGET_IMG% (
echo "找不到待识别的目标图片:%TARGET_IMG%,请打开本文件并编辑TARGET_IMG"
PAUSE
exit
)
if exist %EXE_PATH%\install\bin (
SET EXE_PATH=%EXE_PATH%\install\bin
)
%EXE_PATH%\OcrLiteNcnn.exe --version
%EXE_PATH%\OcrLiteNcnn.exe --models models ^
--det dbnet_op ^
--cls angle_op ^
--rec crnn_lite_op ^
--keys keys.txt ^
--image %TARGET_IMG% ^
--numThread %NUMBER_OF_PROCESSORS% ^
--padding 50 ^
--maxSideLen 0 ^
--boxScoreThresh 0.6 ^
--boxThresh 0.3 ^
--unClipRatio 2.0 ^
--doAngle 1 ^
--mostAngle 1 ^
--GPU %GPU_INDEX%
echo.
GOTO:MainExec
:PrepareCpuX64
set EXE_PATH=win-BIN-CPU-x64
set GPU_INDEX=-1
GOTO:EOF
:PrepareCpuX86
set EXE_PATH=win-BIN-CPU-Win32
set GPU_INDEX=-1
GOTO:EOF
:PrepareGpuX64
set EXE_PATH=win-BIN-GPU-x64
set GPU_INDEX=0
GOTO:EOF
:PrepareGpuX86
set EXE_PATH=win-BIN-GPU-Win32
set GPU_INDEX=0
GOTO:EOF
@ENDLOCAL