赞
踩
1.使用 labelImg 标注物体,产生 .xml 文件命令:
python labelImg.py
2.将物体 .xml 文件转换成 .csv文件命令:
python xml_to_csv.py
3.将test_images\train 全部拷贝到data 路径下(有两个.csv 文件):
将.cvs 文件转换成.record文件命令:
python generate_tfrecord.py --csv_input=data/cup_train.csv --output_path=data/cup_train.record
python generate_tfrecord.py --csv_input=data/cup_test.csv --output_path=data/cup_test.record
4.开始训练数据命令:
python model_main_tf2.py -pipeline_config_path=training/ssd_mobilenet_v2_320x320_coco17_tpu-8.config --model_dir=training --alsologtostderr
5.可视化训练模型命令:
tensorboard --logdir training --bind_all
6.导出训练模型命令:
python exporter_main_v2.py --input_type image_tensor --pipeline_config_path=training/ssd_mobilenet_v2_320x320_coco17_tpu-8.config --trained_checkpoint_dir=training --output_directory=training/train_export
7.打开测试程序命令:
jupyter notebook
8.导出 tflite 文件命令:
- #tensorflow1.x
- python2 export_tflite_ssd_graph.py --pipeline_config_path ssd_mobilenet_v1_coco_2018_01_28/pipeline.config --trained_checkpoint_prefix ssd_mobilenet_v1_coco_2018_01_28/model.ckpt --output_directory ssd_mobilenet_v1_coco_2018_01_28/
-
- #tensorflow2.0
- python3 export_tflite_graph_tf2.py --pipeline_config_path=training_tf2/ssd_mobilenet_v2_320x320_coco17_tpu-8.config --trained_checkpoint_dir=training_tf2/ --output_directory=training_tf2/train_export
-
-
- python3 export_tflite_model_tf2.py \
- --pipeline_config_path training_tf2/ssd_mobilenet_v2_320x320_coco17_tpu-8.config \
- --trained_checkpoint_dir training_tf2 \
- --output_directory training_tf2/train_export \
- --keypoint_label_map_path training_tf2/train_export/label_cup.txt \
- --max_detections 10 \
- --centernet_include_keypoints true \
- --config_override " \
- model{ \
- center_net { \
- image_resizer { \
- fixed_shape_resizer { \
- height: 320 \
- width: 320 \
- } \
- } \
- } \
- }" \
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。