Tensorflow Object Detection API 安装 配置 运行demo

本文详述了TensorFlow Object Detection API的安装配置过程,包括依赖安装、环境变量设置、Python库安装、COCO API配置及Python-tk安装。并提供了运行自带DEMO的步骤,适合初学者快速上手。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

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.youkuaiyun.com/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.youkuaiyun.com/linolzhang/article/details/73730463

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

风中凌乱的小精灵

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值