Closed jacobsgomez closed 5 years ago
Summarize what I am going to do:
Summarize what I am going to do:
- Create cone training images based on labelImg tool.
- Know how to restore COCO pre-trained model in tensorflow
- Train the model based on it.
Yes, I'm going to push a .zip of the dataset to our branch tonight. I'll touch base with you via slack.
We have made progress on detecting cone objects. Following are the steps to reproduce after merging codes into codebase:
python version Use anaconda python package
switch to working directory “object_detection/models/research”
Need to check tensor flow environment https://github.com/tensorflow/models/blob/master/research/object_detection/g3doc/installation.md
create python executable files ./bin/protoc object_detection/protos/*.proto --python_out=.
prepare training data and annotations put training images under “images” put annotation xml files under “annotations”
transform images data into tensorflow format
python3 object_detection/dataset_tools/create_cone_tf_record.py --label_map_path=object_detection/data/cone_label_map.pbtxt --data_dir=pwd
—output_dir=pwd
copy tf record into model’s data directory cp cone* FULL_CONE_BUCKET_SSD_MODEL/data/
Review config file of tensor flow FULL_CONE_BUCKET_SSD_MODEL/models/model/ssd_mobilenet_v1_coco.config
Begin training task
python3 object_detection/legacy/train.py \
--pipeline_config_path=${PIPELINE_CONFIG_PATH} \
--train_dir=${MODEL_DIR} \
--num_train_steps=${NUM_TRAIN_STEPS} \
--sample_1_of_n_eval_examples=$SAMPLE_1_OF_N_EVAL_EXAMPLES \
--alsologtostder
Export model python3 object_detection/export_inference_graph.py \ --inut_type image_tensor \ --pipeline_config_path FULL_CONE_BUCKET_SSD_MODEL/models/model/ssd_mobilenet_v1_coco.config \ --trained_checkpoint_prefix FULL_CONE_BUCKET_SSD_MODEL/models/model/train/model.ckpt-0 \ --output_directory FULL_CONE_BUCKET_SSD_MODEL/models/export
Use model to predict cones Switch to object_detection directory cd object_detection put target images in directory in “test_images” directories ** execute prediction script python3 object_detection_tutorial.py
check output images in “out_images/test_images” directorypython version
TODO:
The current label map used in our algorithm randomly classifies all cones in the dataset.
It's necessary to retrain a new model and patch the cone label into:
models/research/object-detection/data/COCO_complete_label_map.pbtxt