forked from Cysu/dgd_person_reid
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmake_dbs.sh
executable file
·39 lines (33 loc) · 962 Bytes
/
make_dbs.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
#!/usr/bin/env bash
RAW=external/raw
EXP=external/exp
CAFFE=external/caffe
cd $(dirname ${BASH_SOURCE[0]})/../
make_db () {
ROOT_DIR=$1
DB_DIR=$2
if [[ $# -eq 4 ]]; then
RESIZE_HEIGHT=$3
RESIZE_WIDTH=$4
else
RESIZE_HEIGHT=160
RESIZE_WIDTH=64
fi
for subset in train val test_probe test_gallery; do
if [[ ! -f ${DB_DIR}/${subset}.txt ]]; then
continue
fi
echo "Making ${subset} set"
$CAFFE/build/tools/convert_imageset \
${ROOT_DIR}/ ${DB_DIR}/${subset}.txt ${DB_DIR}/${subset}_lmdb \
-resize_height ${RESIZE_HEIGHT} -resize_width ${RESIZE_WIDTH}
done
echo "Computing images mean"
$CAFFE/build/tools/compute_image_mean \
${DB_DIR}/train_lmdb ${DB_DIR}/mean.binaryproto
}
for d in cuhk03 cuhk01 prid viper 3dpes ilids shinpuhkan; do
echo "Making $d"
python2 tools/make_lists_id_training.py $EXP/datasets/$d $EXP/db/$d
make_db $EXP/datasets/$d $EXP/db/$d
done