在 tensorflow 对象检测 API 中管理类 [英] Managing classes in tensorflow object detection API

查看:37
本文介绍了在 tensorflow 对象检测 API 中管理类的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开展一个项目,该项目要求仅识别视频或来自摄像机的实时流中的人物.我目前正在使用 python 的 tensorflow 对象识别 API,并且我尝试了不同的预训练模型和冻结推理图.我只想识别人和汽车,所以我不需要我的神经网络来识别所有 90 个基于 mobilenet 或 rcnn 的冻结推理图的类,因为这似乎减慢了过程,而这 90 个中的 89 个类我的项目中不需要类.我必须训练自己的模型还是有办法修改推理图和现有模型?对于你们中的一些人来说,这可能是一个菜鸟问题,但请注意,我只使用了一个月的 tensorflow 和机器学习.提前致谢

I'm working on a project that requires the recognition of just people in a video or a live stream from a camera. I'm currently using the tensorflow object recognition API with python, and i've tried different pre-trained models and frozen inference graphs. I want to recognize only people and maybe cars so i don't need my neural network to recognize all 90 classes that come with the frozen inference graphs, based on mobilenet or rcnn, as it seems this slows the process, and 89 of this 90 classes are not needed in my project. Do i have to train my own model or is there a way to modify the inference graphs and the existing models? This is probably a noob question for some of you, but mind that i've worked with tensorflow and machine learning for just one month. Thanks in advance

推荐答案

是的,你必须训练自己的模型.让我们用简短的话说一些方法如何做.

Yes, you have to train own model. Let's see in short words some ways how to do.

选项 1.当您想尽可能多地应用迁移知识时,您可以冻结 CNN 层.之后,您使用分类器(密集层)的维度更改检测到的类的数量.分类器是 CNN 架构中的最新部分.现在,您应该只重新训练分类器.

OPTION 1. When you want to apply transfer knowledge as maximum as possible, you can froze the CNN layers. After, you change a quantity of detected classes with dimension of classifier (dense layers). The classifier is the latest part in CNN architecture. Now, you should retrain only classifier.

选项 2.假设您想对 CNN 的第一层应用转移知识(例如,冻结前 2-3 个 CNN 层)并使用分类器重新训练 CNN 的其余部分.之后,您使用分类器的维度更改检测到的类的数量.现在,您应该重新训练其余的 CNN 层和分类器.

OPTION 2. Assuming, you want to apply transfer knowledge for first layers of CNN (for example, froze first 2-3 CNN layers) and retrain rest of CNN with classifier. After, you change a quantity of detected classes with dimension of classifier. Now, you should retrain rest of CNN layers and classifier.

选项 3.假设你想用分类器重新训练整个 CNN.之后,您使用分类器的维度更改检测到的类的数量.现在,您应该使用分类器重新训练整个 CNN.

OPTION 3. Assuming, you want to retrain whole CNN with classifier. After, you change a quantity of detected classes with dimension of classifier. Now, you should retrain whole CNN with classifier.

一般来说,Tensorflow 对象检测 API 是初学者的良好开端!如何处理您的问题,您可以查看 这里 关于整个过程的更多细节和额外的解释 此处.

Generally, the Tensorflow Object Detection API is a good start for beginners! How to proceed with your problem you can see here more detail about whole process and extra explanation here.

这篇关于在 tensorflow 对象检测 API 中管理类的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆