-
Notifications
You must be signed in to change notification settings - Fork 2
/
resnet50.sh
executable file
·49 lines (45 loc) · 1.43 KB
/
resnet50.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
#!/bin/bash
MODEL="resnet50"
FILE1="${MODEL}.opt.onnx"
FILE2="${MODEL}.opt.onnx.prototxt"
status=0
for n in "$@"
do
if [ "$n" = "-a" ] || [ "$n" = "--arch" ]; then
status=1
elif [ $status -eq 1 ]; then
if [ "$n" = "${MODEL}" ]; then
FILE1="${MODEL}.onnx"
FILE2="${MODEL}.onnx.prototxt"
elif [ "$n" = "${MODEL}.opt" ]; then
FILE1="${MODEL}.opt.onnx"
FILE2="${MODEL}.opt.onnx.prototxt"
elif [ "$n" = "${MODEL}_pytorch" ]; then
FILE1="${MODEL}_pytorch.onnx"
FILE2="${MODEL}_pytorch.onnx.prototxt"
else
break;
fi
status=0
else
status=0
fi
done
#download
if [ ! "$1" = "-h" ] && [ ! "$1" = "--help" ] && [ $status -eq 0 ]; then
if [ ! -e ${FILE1} ]; then
echo "Downloading onnx file... save path: ${FILE1}"
curl https://storage.googleapis.com/ailia-models/${MODEL}/${FILE1} -o ${FILE1}
# wget https://storage.googleapis.com/ailia-models/${MODEL}/${FILE1}
fi
fi
if [ ! "$1" = "-h" ] && [ ! "$1" = "--help" ] && [ $status -eq 0 ]; then
if [ ! -e ${FILE2} ]; then
echo "Downloading onnx file... save path: ${FILE2}"
curl https://storage.googleapis.com/ailia-models/${MODEL}/${FILE2} -o ${FILE2}
# wget https://storage.googleapis.com/ailia-models/${MODEL}/${FILE2}
fi
echo "ONNX file and Prototxt file are prepared!"
fi
#execute
./${MODEL} $*