-
Notifications
You must be signed in to change notification settings - Fork 54
/
export.sh
executable file
·58 lines (52 loc) · 1.61 KB
/
export.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
#!/bin/bash
usage()
{
echo
echo "Usage: ./export.sh <model_name>"
echo
echo "where <model_name> could be one of the following:"
echo " ssd_mobilenet_v1_egohands"
echo " ssd_mobilenet_v2_egohands"
echo " ssdlite_mobilenet_v2_egohands"
echo " ssd_inception_v2_egohands"
echo " rfcn_resnet101_egohands"
echo " faster_rcnn_resnet50_egohands"
echo " faster_rcnn_resnet101_egohands"
echo " faster_rcnn_inception_v2_egohands"
echo " faster_rcnn_inception_resnet_v2_atrous_egohands"
echo
exit
}
if [ $# -ne 1 ]; then
usage
fi
case $1 in
ssd_mobilenet_v1_egohands | \
ssd_mobilenet_v2_egohands | \
ssdlite_mobilenet_v2_egohands | \
ssd_inception_v2_egohands )
MODEL_DIR=$1
NUM_TRAIN_STEPS=20000
;;
rfcn_resnet101_egohands | \
faster_rcnn_resnet50_egohands | \
faster_rcnn_resnet101_egohands | \
faster_rcnn_inception_v2_egohands | \
faster_rcnn_inception_resnet_v2_atrous_egohands )
MODEL_DIR=$1
NUM_TRAIN_STEPS=50000
;;
* )
usage
esac
PIPELINE_CONFIG_PATH=configs/${MODEL_DIR}.config
CHECKPOINT_PREFIX=${MODEL_DIR}/model.ckpt-${NUM_TRAIN_STEPS}
OUTPUT_DIR=model_exported
# clear old exported model
rm -rf ${OUTPUT_DIR}
PYTHONPATH=`pwd`/models/research:`pwd`/models/research/slim \
python3 ./models/research/object_detection/export_inference_graph.py \
--input_type=image_tensor \
--pipeline_config_path=${PIPELINE_CONFIG_PATH} \
--trained_checkpoint_prefix=${CHECKPOINT_PREFIX} \
--output_directory=${OUTPUT_DIR}