-
Notifications
You must be signed in to change notification settings - Fork 2
/
infer.sh
executable file
·48 lines (39 loc) · 952 Bytes
/
infer.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
#!/bin/sh
helpFunction() {
echo "Options not found"
exit 1
}
get_abs_filename() {
echo "$(cd "$(dirname "$1")" && pwd)/$(basename "$1")"
}
while getopts "d:f:p:m:s:l:c:" opt
do
case "$opt" in
d ) d="$OPTARG" ;;
f ) f="$OPTARG" ;;
p ) p="$OPTARG" ;;
m ) m="$OPTARG" ;;
s ) s="$OPTARG" ;;
l ) l="$OPTARG" ;;
c ) c="$OPTARG" ;;
? ) helpFunction ;;
esac
done
if [ -z "$d" ] || [ -z "$p" ] || [ -z "$m" ]
then
echo "Some or all of the parameters are empty";
helpFunction
fi
f=$(get_abs_filename "$f")
d=$(get_abs_filename "$d")
l=$(get_abs_filename "$l")
p=$(get_abs_filename "$p")
export CUDA_VISIBLE_DEVICES="$c"
cd ./train/tasks/semantic/
./infer.py -d "$d" \
-f "$f" \
-l "$l" \
-p "$p" \
-m "$m" \
-s "$s"
# ./infer.sh -d /Dataset/ -f cfgs/ -l ./logs/ddrnet_aug5_T/ -m ddrnet -p ./logs/infer/ddrnet_aug5_T -s valid -c 0