"mmdet/datasets/base_semseg_dataset.py" did not exist on "6515fb96bc12fdced88f9163a8b7360abd917655"
run-benchmark.sh 1.34 KB
Newer Older
benjaminwan's avatar
benjaminwan committed
1
2
3
#!/usr/bin/env bash

function PrepareVar(){
benjaminwan's avatar
benjaminwan committed
4
5
6
7
8
9
10
11
12
13
14
15
echo "onnxruntime: 1)CPU(默认), 2)GPU(cuda)"
read -p "" ONNX_TYPE
if [ $ONNX_TYPE == 1 ]; then
  ONNX_TYPE="CPU"
  GPU_INDEX=-1
elif [ $ONNX_TYPE == 2 ]; then
  ONNX_TYPE="CUDA"
  GPU_INDEX=0
else
  echo -e "输入错误!Input Error!"
fi
EXE_PATH=${sysOS}-${ONNX_TYPE}-BIN
benjaminwan's avatar
benjaminwan committed
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
}

sysOS=`uname -s`
NUM_THREADS=1
if [ $sysOS == "Darwin" ];then
    #echo "I'm MacOS"
    NUM_THREADS=$(sysctl -n hw.ncpu)
elif [ $sysOS == "Linux" ];then
    #echo "I'm Linux"
    NUM_THREADS=$(grep ^processor /proc/cpuinfo | wc -l)
else
    echo "Other OS: $sysOS"
fi

echo "Setting the Number of Threads=$NUM_THREADS Using an OpenMP Environment Variable"
set OMP_NUM_THREADS=$NUM_THREADS

PrepareVar

echo "请输入循环次数"
read -p "" LOOP_COUNT

TARGET_IMG=images/1.jpg
if [ ! -f "$TARGET_IMG" ]; then
echo "找不到待识别的目标图片:${TARGET_IMG},请打开本文件并编辑TARGET_IMG"
exit
fi

./${EXE_PATH}/benchmark --version
./${EXE_PATH}/benchmark --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 $NUM_THREADS \
--padding 50 \
--maxSideLen 1024 \
--boxScoreThresh 0.5 \
--boxThresh 0.3 \
56
--unClipRatio 1.6 \
benjaminwan's avatar
benjaminwan committed
57
58
--doAngle 1 \
--mostAngle 1 \
benjaminwan's avatar
benjaminwan committed
59
--GPU $GPU_INDEX \
benjaminwan's avatar
benjaminwan committed
60
--loopCount $LOOP_COUNT