forked from FreeApe/VGG-or-MobileNet-SSD
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gen_model.sh
executable file
·43 lines (37 loc) · 1.37 KB
/
gen_model.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
#!/bin/sh
if test -z $1 ;then
echo usage: $0 CLASSNUM
echo " for voc the classnum is 21"
exit 1
fi
echo $1 |grep '^[0-9]*$' >/dev/null 2>&1
if [ $? != 0 ];then
echo usage: $0 CLASSNUM
echo " for voc the classnum is 21"
exit 1
fi
cls_num=$1
cls_num3=$(expr $1 \* 3)
cls_num6=$(expr $1 \* 6)
target_dir=mobile_ssd_head_shoulder
trainfile=examples/$target_dir/MobileNetSSD_train.prototxt
testfile=examples/$target_dir/MobileNetSSD_test.prototxt
deploybnfile=examples/$target_dir/MobileNetSSD_deploy_bn.prototxt
deployfile=examples/$target_dir/MobileNetSSD_deploy.prototxt
mkdir -p examples/$target_dir
cp template/MobileNetSSD_train_template.prototxt $trainfile
sed -i "s/cls6x/${cls_num6}/g" $trainfile
sed -i "s/cls3x/${cls_num3}/g" $trainfile
sed -i "s/cls1x/${cls_num}/g" $trainfile
cp template/MobileNetSSD_test_template.prototxt $testfile
sed -i "s/cls6x/${cls_num6}/g" $testfile
sed -i "s/cls3x/${cls_num3}/g" $testfile
sed -i "s/cls1x/${cls_num}/g" $testfile
#cp template/MobileNetSSD_deploy_bn_template.prototxt $deploybnfile
#sed -i "s/cls6x/${cls_num6}/g" $deploybnfile
#sed -i "s/cls3x/${cls_num3}/g" $deploybnfile
#sed -i "s/cls1x/${cls_num}/g" $deploybnfile
cp template/MobileNetSSD_deploy_template.prototxt $deployfile
sed -i "s/cls6x/${cls_num6}/g" $deployfile
sed -i "s/cls3x/${cls_num3}/g" $deployfile
sed -i "s/cls1x/${cls_num}/g" $deployfile