记录Tensorflow Object Detection API训练,测试

 

使用Tensorflow Object DetectionAPI进行目标检测

目标检测架构:SSD

深度学习框架:TensorFlow

深度神经网络:MobileNet

 

目标检测步骤总结如下:

1.      收集500+张包含有待检测目标的图片,最少100张;

2.      使用软件LabelImg对图片进行标注;所谓标注即是在图片上画框定位目标,LabelImg会创建xml文件描述目标的相关信息;

3.      将数据集分成训练数据集,测试数据集;

4.      将上面的数据集分别生成TFRecords文件;

5.      配置训练用.config文件;

6.      训练;

7.      导出训练后的graph;

8.      测试

 

软件环境:Windows10, Python 3.6

 

No.1收集数据

待检测目标:外观不良中的缺损

it's better using 200+ different picture to training without rotation, flip,translation

 

No.2图片标注

标注软件:LabelImg

下载链接:https://tzutalin.github.io/labelImg/

使用方法介绍:https://blog.gtwang.org/useful-tools/labelimg-graphical-image-annotation-tool-tutorial/

标注后的图片都会对应生成.xml文件

 

No.3将数据集分成训练数据集,测试数据集;

文件目录树结构如下:

object_detection/images

-train(90张图片(.jpg文件),对应的xml文件)

-test(10张图片(.jpg文件),对应的xml文件)

 

No.4生成TFRecords文件

用脚本 xml_to_csv.py将xml文件转换成.csv文件;按照下图修改脚本中的xml文件路径以及输出的csv文件的路径;

使用脚本 generate_tfrecord.py,将csv文件,以及图片信息生成TensorFlow训练需要的TFRecord 文件;

需要在脚本里设定目标检测的类别

(2018.03.02) Add prepare inputs from object_detection/g3doc/using_your_own_dataset

# object_detection/g3doc/using_your_own_dataset
# Preparing Inputs

To use your own dataset in Tensorflow Object Detection API, you must convert it
into the [TFRecord file format](https://www.tensorflow.org/api_guides/python/python_io#tfrecords_format_details).
This document outlines how to write a script to generate the TFRecord file.

## Label Maps

Each dataset is required to have a label map associated with it. This label map
defines a mapping from string c
  • 4
    点赞
  • 31
    收藏
    觉得还不错? 一键收藏
  • 52
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 52
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值