-
Notifications
You must be signed in to change notification settings - Fork 102
/
eval.sh
41 lines (38 loc) · 909 Bytes
/
eval.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
#!/bin/sh
helpFunction()
{
echo "Options not found"
exit 1
}
get_abs_filename() {
echo "$(cd "$(dirname "$1")" && pwd)/$(basename "$1")"
}
while getopts "d:p:m:s:n:c:u:g" opt
do
case "$opt" in
d ) d="$OPTARG" ;;
p ) p="$OPTARG" ;;
m ) m="$OPTARG" ;;
s ) s="$OPTARG" ;;
n ) n="$OPTARG" ;;
g ) g="$OPTARG" ;;
u ) u="$OPTARG" ;;
c ) c="$OPTARG" ;;
? ) helpFunction ;;
esac
done
if [ -z "$d" ] || [ -z "$p" ] || [ -z "$m" ]
then
echo "Some or all of the options are empty";
helpFunction
fi
if [ -z "$u" ]
then u='false'
fi
d=$(get_abs_filename "$d")
p=$(get_abs_filename "$p")
m=$(get_abs_filename "$m")
export CUDA_VISIBLE_DEVICES="$g"
cd ./train/tasks/semantic/; ./infer.py -d "$d" -l "$p" -m "$m" -n "$n" -s "$s" -u "$u" -c "$c"
echo "finishing infering.\n Starting evaluating"
./evaluate_iou.py -d "$d" -p "$p" --split "$s" -m "$m"