源码网址:https://github.com/tensorflow
检测样例:https://github.com/tensorflow/models/tree/master
提供了一组预先培训过的检测模型,包括Coco数据集、Kitti数据集、开放图像数据集、AVA V2.1数据集和不自然物种检测数据集。如果您对那些数据集中已经存在的类别感兴趣,那么这些模型对于开箱即用的推断很有用。在新数据集的培训中,它们对于初始化模型也很有用。
比如用于图像分类的Slim,深度文字OCR,以及用于NLP任务的句法分析模型syntaxnet,Seq2Seq with Attention等等。这次公布的Object Detection API同样是放在了tensorflow/models里。
首先,对于目标检测这个任务来说,前面必须有一个像样的ImageNet图像分类模型来充当所谓的特征提取(Feature Extraction)层,比如VGG16、ResNet等网络结构。TensorFlow官方实现这些网络结构的项目是TensorFlow Slim,而这次公布的Object Detection API正是基于Slim的。Slim这个库公布的时间较早,不仅收录了AlexNet、VGG16、VGG19、Inception、ResNet这些比较经典的耳熟能详的卷积网络模型,还有Google自己搞的Inception-Resnet,MobileNet等。
我们在TensorFlow Object Detection API的官方安装指南中,可以看到这样一句代码:
# From tensorflow/models/
export PYTHONPATH=$PYTHONPATH:`pwd`:`pwd`/slim
很显然,这就是用Slim作特征抽取了。另外,以Faster RCNN为例,之前在github上,可以找到各种各样非官方的TensorFlow实现,但是这些实现使用的特征抽取层都不是Slim,而是五花八门的什么都有,另外一方面实现代码大量copy自原始的caffe的实现:rbgirshick/py-faster-rcnn,这次公布的代码里已经一点也找不到原始caffe实现的痕迹了。非官方的Object Detection实现的质量参差不齐,这次Google官方公布的Object Detection API别的不说,代码质量肯定是过的去的,因此以后应该不会有人再造TensorFlow下Faster RCNN、R-FCN、SSD的轮子了。
公布的模型。主要公布了5个在COCO上训练的网络。网络结构分别是SSD+MobileNet、SSD+Inception、R-FCN+ResNet101、Faster RCNN+ResNet101、Faster RCNN+Inception_ResNet。后期应该还会有更多的模型加入进来。
上述每一个模型的冻结权重 (在COCO数据集上训练)可被直接加载使用。
SSD模型使用了轻量化的MobileNet,这意味着它们可以轻而易举地在移动设备中实时使用。谷歌使用了 Fast R-CNN模型需要更多计算资源,但结果更为准确。
COCO数据集
在在实物检测领域,训练模型的最权威数据集就是COCO数据集。
COCO数据集是微软发布的一个可以用来进行图像识别训练的数据集,官方网址为http://mscoco.org 其图像主要从复杂的日常场景中截取,图像中的目标通过精确的segmentation进行位置的标定。
COCO数据集包括91类目标,分两部分发布,前部分于2014年发布,后部分于2015年发布。
coco数据集详解:https://zhuanlan.zhihu.com/p/29393415
检测模型链接:https://github.com/tensorflow/models/blob/master/research/object_detection/g3doc/detection_model_zoo.md
tensorflow models zoo组成部分:
This repository contains a number of different models implemented in TensorFlow:
1、The official models are a collection of example models that use TensorFlow's high-level APIs. They are intended to be well-maintained, tested, and kept up to date with the latest stable TensorFlow API. They should also be reasonably optimized for fast performance while still being easy to read. We especially recommend newer TensorFlow users to start here.
1、官方模型是使用TensorFlow的高级API的示例模型的集合。它们旨在得到良好的维护、测试,并与最新的稳定TensorFlow API保持同步。它们还应该进行合理优化,以实现快速性能,同时仍然易于阅读。我们特别推荐新的TensorFlow用户从这里开始
2、The research models are a large collection of models implemented in TensorFlow by researchers. They are not officially supported or available in release branches; it is up to the individual researchers to maintain the models and/or provide support on issues and pull requests.
2、研究模型是研究人员在TensorFlow中实现的大量模型集合。它们在发布分支中没有官方支持或可用;由单个研究人员维护模型和/或在问题和请求上提供支持。
3、The samples folder contains code snippets and smaller models that demonstrate features of TensorFlow, including code presented in various blog posts.
3、samples文件夹包含代码片段和较小的模型,演示TensorFlow的特性,包括各种博客文章中显示的代码。
4、The tutorials folder is a collection of models described in the TensorFlow tutorials.
4、教程文件夹是TensorFlow教程中描述的模型集合。