-
Notifications
You must be signed in to change notification settings - Fork 5
/
run.sh
executable file
·74 lines (71 loc) · 2.07 KB
/
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
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
71
72
73
74
#!/bin/bash
ci_bt=`date '+%s'`
CURRENT_DIR=$(cd $(dirname $0); pwd)
export no_proxy=bcebos.com
export py_version=python
export MODEL_PATH=${CURRENT_DIR}/../models
export DATA_PATH=${CURRENT_DIR}/../data
export TOOLS_PATH=${CURRENT_DIR}/../tools
export ground_truth_file=ground_truth.yaml
cd ${MODEL_PATH}
rm -rf ./*
cd ${TOOLS_PATH}
$py_version ${TOOLS_PATH}/download_models.py
cd ${DATA_PATH}
rm -rf ./*
unset http_proxy
unset https_proxy
wget -q https://bj.bcebos.com/paddlehub/fastdeploy/coco_dataset_ci.tgz
wget -q https://bj.bcebos.com/paddlehub/fastdeploy/imagenet_dataset_ci.tgz
wget -q https://bj.bcebos.com/paddlehub/fastdeploy/cityscapes.tgz
wget -q https://bj.bcebos.com/paddlehub/fastdeploy/ICDAR2017_10.tgz
for i in `ls | grep 'tar\|tgz'`
do
tar -zxvf $i >/dev/null
done
echo ${CURRENT_DIR}
cd ${CURRENT_DIR}
rm -rf result.txt ./infer_result/*
cases=`find ./ -name "test*.py" | sort`
echo $cases
ignore="test_efficientnetb0_small.py
test_efficientnetb7.py
test_ghostnet_x1_3_ssld.py
test_inceptionv3.py
test_mobilenetv1_ssld.py
test_mobilenetv1_x0_25.py
test_mobilenetv2_ssld.py
test_mobilenetv3_large_x1_0_ssld.py
test_mobilenetv3_small_x0_35_ssld.py
test_pphgnet_base_ssld.py
test_pphgnet_tiny_ssld.py
test_pp_lcnet.py
test_pp_lcnetv2.py
test_shufflenetv2_x0_25.py"
bug=0
job_bt=`date '+%s'`
echo "============ failed cases =============" >> result.txt
for file in ${cases}
do
echo ${file}
if [[ ${ignore} =~ ${file##*/} ]]; then
echo "跳过"
else
$py_version -m pytest --disable-warnings -sv ${file}
if [[ $? -ne 0 && $? -ne 5 ]]; then
echo ${file} >> result.txt
bug=`expr ${bug} + 1`
fi
fi
done
job_et=`date '+%s'`
echo "total bugs: "${bug} >> result.txt
#if [ ${bug} != 0 ]; then
# cp result.txt ${output_dir}/result_${py_version}.txt
#fi
cat result.txt
total_cost=$(expr $job_et - $ci_bt)
case_cost=$(expr $job_et - $job_bt)
echo "case_cost: $case_cost s"
echo "total_cost: $total_cost s"
exit ${bug}