TensorFlow models object_detection解析

TensorFlow models object_detection目标检测解析

简介

  • TensorFlow的models中集合了近年来深度学习在各种领域上的应用。这里讲述其中的目标识别object_detection目标检测的使用以及踩得坑。
  • 链接:https://github.com/tensorflow/models/tree/master/research/object_detection
  • 在默认配置好环境的条件下(安装TensorFlow,Python及相关库),download上述链接到本地。

1、用软件labelme或者labelimg制作自己的数据集

2、用xml_to_csv.py将数据集转为CSV格式

3、修改generate_tfrecord.py

对应位置修改为自己要识别的类别
在这里插入图片描述
在对应生成labelmap.pbtxt
在这里插入图片描述
之后运行generate_tfrecord.py,生成tfrecord

4、在configs文件夹中找配置文件,修改参数

参数教程

在g3doc里有讲解。
模型的配置文件标准

使用fine_tune,下载预训练模型

下载的预训练模型要删除checkpoint才行。

5、运行train.py训练

示例:
–logtostderr
–train_dir=D:\Jupyter\TensorFlow-Object-Detection-API-Tutorial-Train-Multiple-Objects-Windows-10-master\SSD_2019_11_4
–pipeline_config_path=D:\Jupyter\TensorFlow-Object-Detection-API-Tutorial-Train-Multiple-Objects-Windows-10-master\SSD_2019_11_4\faster_rcnn_inception_v2_coco.config

6、运行export_inference_graph.py将训练的模型参数固定

示例:

–pipeline_config_path=D:\Jupyter\TensorFlow-Object-Detection-API-Tutorial-Train-Multiple-Objects-Windows-10-master\SSD_2019_11_4\pipeline.config #配置文件位置
–trained_checkpoint_prefix=D:\Jupyter\TensorFlow-Object-Detection-API-Tutorial-Train-Multiple-Objects-Windows-10-master\SSD_2019_11_4\model.ckpt-1610 #训练模型位置
–output_directory=D:\Jupyter\TensorFlow-Object-Detection-API-Tutorial-Train-Multiple-Objects-Windows-10-master\SSD_2019_11_4\saved_model #保存路径
生成:
在这里插入图片描述

模型测试

直接修改使用object_detection_tutorial.ipynb即可

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值