-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathrun.sh
70 lines (57 loc) · 1.43 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
#!/bin/bash
# Copyright (c) HP-NTU Digital Manufacturing Corporate Lab, Nanyang Technological University, Singapore.
#
# This source code is licensed under the Apache-2.0 license found in the
# LICENSE file in the root directory of this source tree.
null_error(){
cat >&2 <<-EOF
Error: The value of $1 is NULL, but it is required.
EOF
exit 1
}
no_exist_error(){
cat >&2 <<-EOF
Error: The folder or file $1 does not exist, but it is required.
Please make sure that you have executed download.sh or prepared all required packages manually.
EOF
exit 1
}
usage(){
echo "usge meassage"
}
current_path=$(cd "$(dirname $0)";pwd)
bash ${current_path}/download.sh $1 $2
if [ ! -d "${current_path}/models/" ]; then
no_exist_error ${current_path}/models/
fi
if [ ! -d "${current_path}/dataset/" ]; then
no_exist_error ${current_path}/dataset/
fi
if [ ! -d "${current_path}/scripts/" ]; then
no_exist_error ${current_path}/scripts/
fi
case $1 in
"tx2")
echo "Running Nvidia TX2"
bash ${current_path}/scripts/tx2/tx2.sh $2
;;
"tpu")
echo "Running Edge TPU"
bash ${current_path}/scripts/tpu/tpu.sh $2
;;
"ncs2")
echo "Running Intel NCS2"
bash ${current_path}/scripts/ncs2/ncs2.sh $2
;;
"gpu")
echo "Running Desktop GPU"
bash ${current_path}/scripts/gpu/gpu.sh $2 gpu
;;
"cpu")
echo "Running Desktop CPU"
bash ${current_path}/scripts/gpu/gpu.sh $2 cpu
;;
*)
usage
;;
esac