-
Notifications
You must be signed in to change notification settings - Fork 1
/
run.sh
executable file
·37 lines (31 loc) · 921 Bytes
/
run.sh
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
#!/bin/bash
set -e
set -x
precision=qint8_mixed_float16
dynamic_shape=false
batch_size=1
image_num=1000
infer_mode=infer_python
magicmind_model=${MODEL_PATH}/yolov5_pytorch_model_${precision}_${dynamic_shape}
if [ ${dynamic_shape} == 'false' ];then
magicmind_model="${magicmind_model}_${batch_size}"
fi
# 0. export model
cd ${PROJ_ROOT_PATH}/export_model
bash run.sh
# 1. gen model
if [ ! -f ${magicmind_model} ];then
cd ${PROJ_ROOT_PATH}/gen_model
bash run.sh ${magicmind_model} ${precision} ${batch_size} ${dynamic_shape}
else
echo "MagicMind model: ${magicmind_model} already exists!"
fi
# 2 infer
if [ ${infer_mode} == "infer_cpp" ];then
cd ${PROJ_ROOT_PATH}/infer_cpp
bash run.sh ${magicmind_model} ${batch_size} ${image_num}
fi
if [ ${infer_mode} == "infer_python" ];then
cd ${PROJ_ROOT_PATH}/infer_python
bash run.sh ${magicmind_model} ${batch_size} ${image_num}
fi