Open junxnone opened 5 years ago
[ ] Tensorflow detection model zoo
[ ] Quick Start: Training a pet detector
[ ] Configuring the Instance Segmentation Pipeline
Set the fine_tune_checkpoint in config files.
fine_tune_checkpoint: "/path/to/your/models/model.ckpt"
[ ] faster_rcnn_inception_resnet_v2_atrous_pets.config
[ ] faster_rcnn_inception_v2_pets.config
[ ] faster_rcnn_resnet101_pets.config
[ ] faster_rcnn_resnet152_pets.config
[ ] faster_rcnn_resnet50_pets.config
[ ] mask_rcnn_resnet101_pets.config
[ ] rfcn_resnet101_pets.config
[ ] ssd_inception_v2_pets.config - ssd_inception_v2_coco_2018_01_28.tar.gz
[ ] ssd_inception_v3_pets.config
[ ] ssd_mobilenet_v1_0.75_depth_quantized_300x300_pets_sync.config
[ ] ssd_mobilenet_v1_focal_loss_pets.config
[x] ssd_mobilenet_v1_pets.config - ssd_mobilenet_v1_coco_2018_01_28.tar.gz
wget http://www.robots.ox.ac.uk/~vgg/data/pets/data/images.tar.gz wget http://www.robots.ox.ac.uk/~vgg/data/pets/data/annotations.tar.gz tar -xvf annotations.tar.gz tar -xvf images.tar.gz
python object_detection/dataset_tools/create_pet_tf_record.py \ --label_map_path=object_detection/data/pet_label_map.pbtxt \ --data_dir=`pwd` \ --output_dir=`pwd` cp pet_faces_train.record-* object_detection/data/ cp pet_faces_val.record-* object_detection/data/ sed -i "s|PATH_TO_BE_CONFIGURED|"YOUR_OBJECT_DETECTION_PATH"/data|g" \ object_detection/samples/configs/faster_rcnn_resnet101_pets.config
YOUR_OBJECT_DETECTION_PATH is the models/research/object_detection
cd models/research export PYTHONPATH=$PYTHONPATH:`pwd`:`pwd`/slim
PIPELINE_CONFIG_PATH=/work/tf/models/research/object_detection/samples/configs/ssd_mobilenet_v1_pets.config MODEL_DIR=./modeldir NUM_TRAIN_STEPS=50000 SAMPLE_1_OF_N_EVAL_EXAMPLES=1 python object_detection/model_main.py \ --pipeline_config_path=${PIPELINE_CONFIG_PATH} \ --model_dir=${MODEL_DIR} \ --num_train_steps=${NUM_TRAIN_STEPS} \ --sample_1_of_n_eval_examples=$SAMPLE_1_OF_N_EVAL_EXAMPLES \ --alsologtostderr
The trainig model will save in the modeldir ($MODEL_DIR) folder The checkpoint will typically consist of three files:
python object_detection/export_inference_graph.py \ --input_type image_tensor \ --pipeline_config_path object_detection/samples/configs/ssd_mobilenet_v1_pets.config \ --trained_checkpoint_prefix model.ckpt-$1 \ --output_directory exported_graphs
$1 is the CHECKPOINT_NUMBER. The exported files will save into exported_graphs folder. $ tree ../exported_graphs/ ../exported_graphs/ ├── checkpoint ├── frozen_inference_graph.pb ├── model.ckpt.data-00000-of-00001 ├── model.ckpt.index ├── model.ckpt.meta ├── pipeline.config └── saved_model ├── saved_model.pb └── variables Test the model refer to the object_detection_tutorial.ipynb to modify to read the local model.
$1 is the CHECKPOINT_NUMBER. The exported files will save into exported_graphs folder.
$ tree ../exported_graphs/ ../exported_graphs/ ├── checkpoint ├── frozen_inference_graph.pb ├── model.ckpt.data-00000-of-00001 ├── model.ckpt.index ├── model.ckpt.meta ├── pipeline.config └── saved_model ├── saved_model.pb └── variables
refer to the object_detection_tutorial.ipynb to modify to read the local model.
Reference
[ ] Tensorflow detection model zoo
[ ] Quick Start: Training a pet detector
[ ] Configuring the Instance Segmentation Pipeline
Models
Set the fine_tune_checkpoint in config files.
[ ] faster_rcnn_inception_resnet_v2_atrous_pets.config
[ ] faster_rcnn_inception_v2_pets.config
[ ] faster_rcnn_resnet101_pets.config
[ ] faster_rcnn_resnet152_pets.config
[ ] faster_rcnn_resnet50_pets.config
[ ] mask_rcnn_resnet101_pets.config
[ ] rfcn_resnet101_pets.config
[ ] ssd_inception_v2_pets.config - ssd_inception_v2_coco_2018_01_28.tar.gz
[ ] ssd_inception_v3_pets.config
[ ] ssd_mobilenet_v1_0.75_depth_quantized_300x300_pets_sync.config
[ ] ssd_mobilenet_v1_focal_loss_pets.config
[x] ssd_mobilenet_v1_pets.config - ssd_mobilenet_v1_coco_2018_01_28.tar.gz
Download
Convert the Pets dataset to tfrecord format
YOUR_OBJECT_DETECTION_PATH is the models/research/object_detection
Training
The trainig model will save in the modeldir ($MODEL_DIR) folder The checkpoint will typically consist of three files:
Export the Model