This repository has been archived by the owner on Sep 5, 2022. It is now read-only.
forked from rbgirshick/py-faster-rcnn
-
Notifications
You must be signed in to change notification settings - Fork 1
/
test_faster_rcnn.sh
executable file
·130 lines (113 loc) · 3.44 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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
#!/bin/bash
# ON KENT's PC
# ./experiments/scripts/test_faster_rcnn.sh 0 VGG16 pascal_voc ~/Documents/ML/models/py-faster-rcnn/output/downloaded_pascal/VGG16_faster_rcnn_final.caffemodel
# CAM2 2017
#./experiments/scripts/test_faster_rcnn.sh 0 VGG16 pascal_voc ~/Documents/CAM2/image_team/faster_rcnn/frcnn_caffe/py-faster-rcnn/output/gpu0_end2end_vgg16_12_25_2016/voc_2007_trainval/vgg16_faster_rcnn_iter_70000.caffemodel
#./tools/reval.py --imdb cam2_2017_trainval output/faster_rcnn_end2end/cam2_2017_trainval/vgg16_faster_rcnn_iter_70000/
#./experiments/scripts/test_faster_rcnn.sh 0 VGG16 cam2 ~/Documents/CAM2/image_team/faster_rcnn/frcnn_caffe/py-faster-rcnn/output/gpu0_end2end_vgg16_12_25_2016/voc_2007_trainval/vgg16_faster_rcnn_iter_70000.caffemodel
# PASCAL VOC 2007
#./experiments/scripts/test_faster_rcnn.sh 0 VGG16 pascal_voc ~/Documents/CAM2/image_team/faster_rcnn/frcnn_caffe/py-faster-rcnn/output/gpu0_end2end_vgg16_12_25_2016/voc_2007_trainval/vgg16_faster_rcnn_iter_70000.caffemodel
set -x
set -e
export PYTHONUNBUFFERED="True"
GPU_ID=$1
NET=$2
NET_lc=${NET,,}
DATASET=$3
NET_FINAL=$4
CORG_DIR=$5
VIS_DIR=$6
array=( $@ )
len=${#array[@]}
EXTRA_ARGS=${array[@]:6:$len}
EXTRA_ARGS_SLUG=${EXTRA_ARGS// /_}
case $DATASET in
imagenet)
TRAIN_IMDB="imagenet_train"
#TEST_IMDB="imagenet_test"
#TEST_IMDB="imagenet_very_short_train"
TEST_IMDB="imagenet_val1"
PT_DIR="imagenet"
ITERS=100000
;;
pascal_voc)
TRAIN_IMDB="voc_2007_trainval"
TEST_IMDB="voc_2007_test"
PT_DIR="pascal_voc"
ITERS=70000
;;
pascal_voc_2012)
TRAIN_IMDB="voc_2012_trainval"
TEST_IMDB="voc_2012_val"
PT_DIR="pascal_voc"
ITERS=70000
;;
coco)
# This is a very long and slow training schedule
# You can probably use fewer iterations and reduce the
# time to the LR drop (set in the solver to 350,000 iterations).
TRAIN_IMDB="coco_2014_train"
TEST_IMDB="coco_2014_val"
PT_DIR="coco"
ITERS=490000
;;
cam2)
# this is cam2 data :-)
TRAIN_IMDB="cam2_2017_trainval"
#TEST_IMDB="cam2_2017_test" #"cam2_2017_trainval"
TEST_IMDB="cam2_2017_all" #"cam2_2017_trainval"
PT_DIR="cam2"
ITERS=10000
;;
sun)
TRAIN_IMDB="sun_2012_train"
#TEST_IMDB="sun_2012_taste"
TEST_IMDB="sun_2012_test"
PT_DIR="sun"
ITERS=10000
;;
caltech)
TRAIN_IMDB="caltech_2009_train"
TEST_IMDB="caltech_2009_test"
PT_DIR="caltech"
ITERS=10000
;;
kitti)
TRAIN_IMDB="kitti_2013_train"
#TEST_IMDB="kitti_2013_val"
TEST_IMDB="kitti_2013_train"
PT_DIR="kitti"
ITERS=70000
;;
*)
echo "No dataset given"
exit
;;
esac
# original command -- set here for testing with associated prototxt to caffemodel
# ./tools/test_net.py --gpu ${GPU_ID} \
# --vis ${VIS_DIR} \
# --def models/${PT_DIR}/${NET}/faster_rcnn_end2end/test.prototxt \
# --net ${NET_FINAL} \
# --imdb ${TEST_IMDB} \
# --cfg experiments/cfgs/faster_rcnn_end2end.yml \
# ${EXTRA_ARGS}
# CORG says: "The original model is trained on the loaded corg file."
if [ "${CORG_DIR}" != "" ]; then
echo "corg"
DEF=models/${CORG_DIR}/${NET}/faster_rcnn_end2end/test_corg.prototxt
else
echo "NOT corg"
if [ "${DATASET}" == "pascal_voc_2012" ]; then
DATASET="pascal_voc"
fi
DEF=models/${DATASET}/${NET}/faster_rcnn_end2end/test.prototxt
fi
./tools/test_net.py --gpu ${GPU_ID} \
--vis ${VIS_DIR} \
--def ${DEF} \
--net ${NET_FINAL} \
--imdb ${TEST_IMDB} \
--cfg experiments/cfgs/faster_rcnn_end2end.yml \
${EXTRA_ARGS}
#--def models/imagenet/${NET}/faster_rcnn_end2end/test.prototxt \