Tensorflow Object Detection API

一、需要安装的依赖如下:

1.下载Tensorflow Object Detection API模型

下载地址:https://github.com/tensorflow/models

本地地址:E:\lh\senior\internship\models-master

2.安装配置Protobuf

(1)下载Protobuf

下载地址:https://github.com/protocolbuffers/protobuf/releases

本地地址:E:\lh\senior\internship\protoc-3.4.0-win32

(2)将解压后的bin文件夹路径添加到环境变量中

(3)打开cmd,输入 protoc:输出如下信息则表示添加环境变量成功

(4)将下载的tensorflow object detection文件解压,找到文件夹下的\models-master\research\object_detection\protos目录,利用Protoc将目录中的.proto文件编译成py文件。

cmd下使用cd命令进入到\models\research文件夹下

执行下面的命令:protoc object_detection/protos/*.proto --python_out=.

命令执行结束后:

5)添加环境变量

6)检测是否安装成功

3.安装需要的python库:pillow,  lxml, matplotlib, jupyter

(1)cmd下进入python安装目录下的\Scripts目录

(2)安装Cpython

(3)安装contextlib2

(4)安装pillow

(5)安装lxml

(6)安装jupyter

(7)安装matplotlib

4.COCO API的配置

(1)下载

下载地址:https://github.com/cocodataset/cocoapi

本地地址:E:\lh\senior\internship\cocoapi-master

copy the pycocotools subfolder to the tensorflow/models/research directory

(2)在cmd窗口,cd到\cocoapi-master\PythonAPI目录,执行 python setup.py install命令

出现如下错误:

下载对应的Microsoft Visual C++ 14.0:

https://go.microsoft.com/fwlink/?LinkId=691126

https://github.com/philferriere/cocoapi/raw/master/img/install.png

(3)重启后重新执行(2)

5.Python-tk的安装配置

windows下python3.2版本之后是自动安装tkinter的,检查方法如下:

如果出现下面的界面,说明已经安装

 

二、运行自带DEMO

(1)CMD中找到models-master文件夹下

(2)输入:jupyter-notebook

(3)浏览器打开jupyter

(4)找到research\object_detection\object_detection_tutorial.ipynb

(5)点击Cell->Run all,等待结果

 

三、参考教程

1.tensorflow的安装教程
https://tensorflow.google.cn/install/pip

2.Tensorflow object detection API 详细配置教程
https://blog.csdn.net/zj1131190425/article/details/80711857

3.Tensorflow object detection API下载链接
https://github.com/tensorflow/models/tree/master/research/object_detection

4.COCOAPI下载配置链接
https://github.com/philferriere/cocoapi

API使用和原理
https://blog.csdn.net/linolzhang/article/details/73730463

Logo

CSDN联合极客时间,共同打造面向开发者的精品内容学习社区,助力成长!

更多推荐