-
Notifications
You must be signed in to change notification settings - Fork 2
/
clip.sh
executable file
·37 lines (35 loc) · 1.25 KB
/
clip.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
MODEL="clip"
FILE1="ViT-B32-encode_image.onnx"
FILE2="ViT-B32-encode_image.onnx.prototxt"
FILE3="ViT-B32-encode_text.onnx"
FILE4="ViT-B32-encode_text.onnx.prototxt"
#download
if [ ! "$1" = "-h" ] && [ ! "$1" = "--help" ]; then
if [ ! -e ${FILE1} ]; then
echo "Downloading onnx file... save path: ${FILE1}"
curl https://storage.googleapis.com/ailia-models/${MODEL}/${FILE1} -o ${FILE1}
fi
fi
if [ ! "$1" = "-h" ] && [ ! "$1" = "--help" ]; then
if [ ! -e ${FILE2} ]; then
echo "Downloading onnx file... save path: ${FILE2}"
curl https://storage.googleapis.com/ailia-models/${MODEL}/${FILE2} -o ${FILE2}
fi
echo "ONNX file and Prototxt file are prepared!"
fi
if [ ! "$1" = "-h" ] && [ ! "$1" = "--help" ]; then
if [ ! -e ${FILE3} ]; then
echo "Downloading onnx file... save path: ${FILE3}"
curl https://storage.googleapis.com/ailia-models/${MODEL}/${FILE3} -o ${FILE3}
fi
fi
if [ ! "$1" = "-h" ] && [ ! "$1" = "--help" ]; then
if [ ! -e ${FILE4} ]; then
echo "Downloading onnx file... save path: ${FILE4}"
curl https://storage.googleapis.com/ailia-models/${MODEL}/${FILE4} -o ${FILE4}
fi
echo "ONNX file and Prototxt file are prepared!"
fi
#execute
./${MODEL} $*