tensorflow object detection 框架介绍和使用
支持多种对象监测模型,包括SSDK/faster-RCNN/Mask-RCNN
支持不同的backend模型,包括mobilenet
https://github.com/tensorflow/models/tree/master/research/object_detection
预训练模型结构解释
frozen_inference_graph.pb
model.ckpt.xxx
pipeline.config
graph.pbtxt
model{
{... add model config herer..}
}
train_config:{
{..add train_config here...}
}
train_input_reader:{
{.. add train input configuration here...}
}
eval_config:{}
eval_input_reader:{
{.. add eval input reader here...}
}
配置文件模版说明与输入数据
模版位置: object_detection\samples\configs
导出和使用
导出PB文件,tensorflow推理调用。
OpenCV4深度神经网络(DNN)模块
基于Tiny DNN改进,只支持推理
支持多种深度学习框架导出模型读取(Tensorflow/caffe/torch/Darknet)
https://github.com/opencv/opencv/tree/master/samples/dnn
支持任务
图像分类 对象检测 人脸检测 图像分割 姿态评估 文本检测 图像分割化
来自tensorflow onject detection框架的模型转化
加载与推理调用
-加载模型
Net net=readNetFromTensofrflow(model,config)
net.setPreferableBackend(DNN_BACKEND_OPENCV)
net.setPrefereableTarget(DNN_TARGET_CPU)
-设置输入
net.setInput(blob,"data")
-推理预测
Mat detection = net.forward("detection_out");
IE 加速(OpenVINO)
配置IE支持
安装OpenVINO最新版本