forked from pengzhou1108/RGB-N
-
Notifications
You must be signed in to change notification settings - Fork 0
/
test_faster_rcnn.sh
executable file
·109 lines (100 loc) · 2.38 KB
/
test_faster_rcnn.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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
#!/bin/bash
set -x
set -e
export PYTHONUNBUFFERED="True"
GPU_ID=$1
DATASET=$2
NET=$3
OUTPUT_DIR=$5
array=( $@ )
len=${#array[@]}
EXTRA_ARGS=${array[@]:3:$len}
EXTRA_ARGS_SLUG=${EXTRA_ARGS// /_}
case ${DATASET} in
casia)
TRAIN_IMDB="casia_train_all"
TEST_IMDB="casia_test_all_1"
ITERS=110000
ANCHORS="[8,16,32,64]"
RATIOS="[0.5,1,2]"
;;
dvmm)
TRAIN_IMDB="dist_train"
TEST_IMDB="dist_test"
ITERS=90000
ANCHORS="[8,16,32,64]"
RATIOS="[0.5,1,2]"
;;
dist_fake)
TRAIN_IMDB="dist_cover_train_single"
TEST_IMDB="dist_cover_test_single"
ITERS=25000
ANCHORS="[8,16,32,64]"
RATIOS="[0.5,1,2]"
;;
pascal_voc)
TRAIN_IMDB="voc_2007_trainval"
TEST_IMDB="voc_2007_test"
ITERS=70000
ANCHORS="[8,16,32]"
RATIOS="[0.5,1,2]"
;;
NIST)
TRAIN_IMDB="dist_NIST_train_new_2"
TEST_IMDB="dist_NIST_test_new_2"
ITERS=32000
ANCHORS="[8,16,32,64]"
RATIOS="[0.5,1,2]"
;;
pascal_voc_0712)
TRAIN_IMDB="voc_2007_trainval+voc_2012_trainval"
TEST_IMDB="voc_2007_test"
ITERS=110000
ANCHORS="[8,16,32]"
RATIOS="[0.5,1,2]"
;;
coco)
TRAIN_IMDB="coco_train_filter_single"
TEST_IMDB="coco_test_filter_single"
ITERS=60000
ANCHORS="[8,16,32,64]"
RATIOS="[0.5,1,2]"
;;
swapme)
TRAIN_IMDB="face_faceswap_rcnn_train_only"
TEST_IMDB="face_faceswap_rcnn_test"
ITERS=40001
ANCHORS="[8,16,32,64]"
RATIOS="[0.5,1,2]"
;;
*)
echo "No dataset given"
exit
;;
esac
LOG="./logs/test_${NET}_${TRAIN_IMDB}_${EXTRA_ARGS_SLUG}.txt.`date +'%Y-%m-%d_%H-%M-%S'`"
exec &> >(tee -a "$LOG")
echo Logging output to "$LOG"
set +x
if [[ ! -z ${EXTRA_ARGS_SLUG} ]]; then
NET_FINAL=output/${OUTPUT_DIR}/${TRAIN_IMDB}/${EXTRA_ARGS_SLUG}/${NET}_faster_rcnn_iter_${ITERS}.ckpt
else
NET_FINAL=output/${NET}/${TRAIN_IMDB}/default/${NET}_faster_rcnn_iter_${ITERS}.ckpt
fi
set -x
if [[ ! -z ${EXTRA_ARGS_SLUG} ]]; then
python3 ./tools/test_net.py \
--imdb ${TEST_IMDB} \
--model ${NET_FINAL} \
--cfg ./cfgs/${NET}.yml \
--tag ${EXTRA_ARGS_SLUG} \
--net ${NET} \
--set ANCHOR_SCALES ${ANCHORS} ANCHOR_RATIOS ${RATIOS} ${EXTRA_ARGS}
else
python3 ./tools/test_net.py \
--imdb ${TEST_IMDB} \
--model ${NET_FINAL} \
--cfg ./cfgs/${NET}.yml \
--net ${NET} \
--set ANCHOR_SCALES ${ANCHORS} ANCHOR_RATIOS ${RATIOS} ${EXTRA_ARGS}
fi