-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlaunch.sh
executable file
·77 lines (61 loc) · 1.26 KB
/
launch.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
75
76
77
PARSED_OPTIONS=$(getopt -n "$0" -o h --long "help,task:,data:,model:,vis:" -- "$@")
if [ $# -eq 0 ];
then
echo 'No arguments provided. Use --help option for more details.'
exit 1
fi
eval set -- "$PARSED_OPTIONS"
while true;
do
case "$1" in
-h|--help)
echo -e "usage $0 -h display help \n \
--help display help \n \
--task name of the folder containing the task \n \
--data name of the data file (zip format; name without the .zip) \n \
--vis use of visual features or not (bool)"
shift
exit 0;;
--task)
if [ -n "$2" ];
then
task_name=$2
fi
shift 2;;
--data)
if [ -n "$2" ];
then
data_name=$2
fi
shift 2;;
--model)
if [ -n "$2" ];
then
model_name=$2
fi
shift 2;;
--vis)
if [ -n "$2" ];
then
vis=$2
fi
shift 2;;
--)
shift;
break;;
esac
done
# Data name
datafile_name=${data_name}.zip
mkdir data/
cp ../${datafile_name} ./data/
cd data/
# Unzip data files
unzip ${datafile_name}
# Move files out of the folder
mv ./${data_name}/* ./
# Return to OpenKiwi folder
cd ..
# Move the pre-trained predictor
mkdir -p runs/predictor
cp ../best_model.torch ./runs/predictor/