opencv 调用 TensorFlow 训练好的模型

官方教程

背景

opencv 要使用 TensorFlow object_detection 自定义数据集训练后的模型

方法

opencv 提供了 load TensorFlow model 的方法

retval = cv.dnn.readNetFromTensorflow(bufferModel, bufferConfig)
  • 其中 bufferModel 可以使用 TensorFlow models object_detection 内的 export_inference_graph.py 导出
python export_inference_graph.py \
--input_type image_tensor \
--pipeline_config_path data/ssd_mobilenet_v1.config  \
--trained_checkpoint_prefix training/model.ckpt-***  \
--output_directory output_inference_graph
 python tf_text_graph_ssd.py \
--input /path/to/model.pb \
--config /path/to/example.config \
--output /path/to/graph.pbtx 
©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

友情链接更多精彩内容