run-test.bat 1.33 KB
Newer Older
benjaminwan's avatar
benjaminwan committed
1
2
3
4
5
6
7
8
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
benjaminwan's avatar
benjaminwan committed
9
echo "请输入测试选项并回车: 1)CPU-x64, 2)CPU-x86, 3)CUDA-x64"
benjaminwan's avatar
benjaminwan committed
10
11
12
set /p flag=
if %flag% == 1 (call :PrepareCpuX64)^
else if %flag% == 2 (call :PrepareCpuX86)^
benjaminwan's avatar
benjaminwan committed
13
else if %flag% == 3 (call :PrepareCudaX64)^
benjaminwan's avatar
benjaminwan committed
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
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%\RapidOcrOnnx.exe --version
%EXE_PATH%\RapidOcrOnnx.exe --models models ^
--det ch_PP-OCRv3_det_infer.onnx ^
--cls ch_ppocr_mobile_v2.0_cls_infer.onnx ^
--rec ch_PP-OCRv3_rec_infer.onnx  ^
--keys ppocr_keys_v1.txt ^
--image %TARGET_IMG% ^
--numThread %NUMBER_OF_PROCESSORS% ^
--padding 50 ^
--maxSideLen 1024 ^
--boxScoreThresh 0.5 ^
--boxThresh 0.3 ^
39
--unClipRatio 1.6 ^
benjaminwan's avatar
benjaminwan committed
40
--doAngle 1 ^
benjaminwan's avatar
benjaminwan committed
41
42
--mostAngle 1 ^
--GPU %GPU_INDEX%
benjaminwan's avatar
benjaminwan committed
43
44
45
46
47

echo.
GOTO:MainExec

:PrepareCpuX64
benjaminwan's avatar
benjaminwan committed
48
49
set EXE_PATH=win-BIN-CPU-x64
set GPU_INDEX=-1
benjaminwan's avatar
benjaminwan committed
50
51
52
GOTO:EOF

:PrepareCpuX86
benjaminwan's avatar
benjaminwan committed
53
54
55
56
57
58
59
set EXE_PATH=win-BIN-CPU-Win32
set GPU_INDEX=-1
GOTO:EOF

:PrepareCudaX64
set EXE_PATH=win-BIN-CUDA-x64
set GPU_INDEX=0
benjaminwan's avatar
benjaminwan committed
60
61
62
GOTO:EOF

@ENDLOCAL