-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathvalgrind-memcheck.sh
More file actions
executable file
·36 lines (32 loc) · 969 Bytes
/
Copy pathvalgrind-memcheck.sh
File metadata and controls
executable file
·36 lines (32 loc) · 969 Bytes
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
#!/bin/bash
## script for 内存泄露检查
# ========== macOS ==========
# https://github.com/LouisBrunner/valgrind-macos
# brew tap LouisBrunner/valgrind
# brew install --HEAD LouisBrunner/valgrind/valgrind
# ========== linux ==========
# https://www.valgrind.org/
# apt install valgrind
NUM_THREADS=1
set OMP_NUM_THREADS=$NUM_THREADS
TARGET_IMG=../images/1.jpg
if [ ! -f "$TARGET_IMG" ]; then
echo "找不到待识别的目标图片:${TARGET_IMG},请打开本文件并编辑TARGET_IMG"
exit
fi
##### run test on MacOS or Linux
valgrind --tool=memcheck --leak-check=full --leak-resolution=med --track-origins=yes --vgdb=no --log-file=valgrind-memcheck.txt \
./build/PaddleOcrJni --models models \
--det dbnet.onnx \
--cls angle_net.onnx \
--rec crnn_lite_lstm.onnx \
--keys keys.txt \
--image $TARGET_IMG \
--numThread $NUM_THREADS \
--padding 50 \
--maxSideLen 1024 \
--boxScoreThresh 0.6 \
--boxThresh 0.3 \
--unClipRatio 2.0 \
--doAngle 1 \
--mostAngle 1