ONNX

保姆教程 | YOLOv5在建筑工地中安全帽佩戴检测的应用

孤街浪徒 提交于 2021-02-17 04:31:21
点击上方 “ 机器学习与生成对抗网络 ”,关注"星标" 获取有趣、好玩的前沿干货! 教程来自: https://github.com/PeterH0323/Smart_Construction 编辑:AI深度前沿视线 一、YOLO v5训练自己数据集教程 1.1 创建自己的数据集配置文件 1.2 创建每个图片对应的标签文件 1.3 文件放置规范 1.4 聚类得出先验框(可选) 1.5 选择一个你需要的模型 1.6 开始训练 1.7 看训练之后的结果 二、侦测 三、检测危险区域内是否有人 3.1 危险区域标注方式 3.2 执行侦测 3.3 效果:在危险区域里面的人体会被 红色框 选出来 四、生成 ONNX 五、增加数据集的分类 该项目是使用 YOLOv5 v2.x 来训练在智能工地安全领域中头盔目标检测的应用,先来一波演示! 指标 yolov5s 为基础训练, epoch = 50 分类 P R mAP0.5 总体 0.884 0.899 0.888 人体 0.846 0.893 0.877 头 0.889 0.883 0.871 安全帽 0.917 0.921 0.917 对应的 权重文件 :https://pan.baidu.com/share/init?surl=ELPhtW-Q4G8UqEr4YrV_5A,提取码: b981 yolov5m 为基础训练, epoch =

Tensorflow to ONNX conversion

限于喜欢 提交于 2021-02-10 20:22:44
问题 I'm currently trying to convert a saved (and working) .pb file that I created with this tutorial (https://github.com/thtrieu/darkflow) into a onnx file. I'm using winML tools at the moment but the result of the conversion doesn't work at all (the input parameters are wrong + the whole architecture is not correct). My input parameter (as specified on the very bottom of the readme): input:0 Output node: ouput:0 I want to use the converted model inside a UWP application that's running on a

Tensorflow to ONNX conversion

懵懂的女人 提交于 2021-02-10 20:19:37
问题 I'm currently trying to convert a saved (and working) .pb file that I created with this tutorial (https://github.com/thtrieu/darkflow) into a onnx file. I'm using winML tools at the moment but the result of the conversion doesn't work at all (the input parameters are wrong + the whole architecture is not correct). My input parameter (as specified on the very bottom of the readme): input:0 Output node: ouput:0 I want to use the converted model inside a UWP application that's running on a

How could I convert onnx model to tensorflow saved model?

感情迁移 提交于 2021-02-07 06:56:43
问题 I am trying to use tf-serving to deploy my torch model. I have exported my torch model to onnx. How could I generate the pb model for tf-serving ? 回答1: Use the onnx/onnx-tensorflow converter tool as a Tensorflow backend for ONNX. Install onnx-tensorflow: pip install onnx-tf Convert using the command line tool: onnx-tf convert -t tf -i /path/to/input.onnx -o /path/to/output.pb Alternatively, you can convert through the python API. import onnx from onnx_tf.backend import prepare onnx_model =

How could I convert onnx model to tensorflow saved model?

耗尽温柔 提交于 2021-02-07 06:56:21
问题 I am trying to use tf-serving to deploy my torch model. I have exported my torch model to onnx. How could I generate the pb model for tf-serving ? 回答1: Use the onnx/onnx-tensorflow converter tool as a Tensorflow backend for ONNX. Install onnx-tensorflow: pip install onnx-tf Convert using the command line tool: onnx-tf convert -t tf -i /path/to/input.onnx -o /path/to/output.pb Alternatively, you can convert through the python API. import onnx from onnx_tf.backend import prepare onnx_model =

PyTorch OCR模型的安卓端部署

风格不统一 提交于 2021-01-30 05:53:25
开发环境选择 本文操作系统为Windows,因为Windows上的安卓模拟器选择较多,并且真机调试也比较方便; 交叉编译在Windows和Ubuntu上都进行了尝试,都可行,但是如果是Ubuntu上交叉编译之后再挪到Windows的话,容易出幺蛾子; 我目前使用的最稳定的工具版本组合是:ndk18、androidstudio4.1、cmake3.10、gradle6.5、MinGW(CodeBlocks自带)。 1. PyTorch模型转NCNN 这一小节是介绍如何将自己重新训练过的PyTorch模型转成ncnn,如果没有重训练需求的话,可以直接跳过这一节。 (1) 整体步骤 理想情况下,从PyTorch转到ncnn只需要下面两步: PyTorch转ONNX torch.onnx._export(model, x, path, opset_version=11) ONNX转NCNN ./onnx2ncnn model.onnx model.param model.bin 遇到问题的适合解决思路如下: convert.png 下面介绍一下我在做ChineseOCRLite中的PSENet模型转换的过程中遇到的问题。 (2)实际操作的时候可能会遇到各种问题 问题1:ReLU6不支持 概述:ReLU6算子在转换的时候容易出现不支持的情况,需要使用其他算子替代 解决:使用torch

Issues with onnxruntime on Ubuntu 16.04

笑着哭i 提交于 2021-01-29 16:57:05
问题 I'm trying to run inference on an ONNX model on Ubuntu 16.04 using onnxruntime. But the import statement gives me this error: >>> import onnxruntime /opt/conda/lib/python3.6/site-packages/onnxruntime/capi/_pybind_state.py:13: UserWarning: Cannot load onnxruntime.capi. Error: '/opt/conda/lib/python3.6/site-packages/onnxruntime/capi/onnxruntime_pybind11_state.cpython-36m-x86_64-linux-gnu.so: cannot enable executable stack as shared object requires: Permission denied' warnings.warn("Cannot load

Can't convert Core ML model to Onnx (then to Tensorflow Lite)

帅比萌擦擦* 提交于 2021-01-27 19:51:26
问题 I'm trying to convert a trained Core ML model to TensorFlow Lite. I find I need convert it to Onnx first. The problems is that I get errors. I've tried with different versions of python, onnxmltools, winmltools and it doesn't seems to work. I also tried docker image of onnx ecosystem with same result. Can any one help me with it? Thanks in advance. Script I used: import coremltools import onnxmltools input_coreml_model = '../model.mlmodel' output_onnx_model = '../model.onnx' coreml_model =

How to resolve the error “cannot import name 'string_int_label_map_pb2' from 'object_detection.protos'”

ⅰ亾dé卋堺 提交于 2020-12-27 07:23:54
问题 My friends and I are partaking in a hackathon and are stuck on this one tutorial on training an object detection model: https://tensorflow-object-detection-api-tutorial.readthedocs.io/en/latest/training.html But after three people have tried to follow the above tutorial to the letter, we are all stuck on the creating TfRecord step: https://tensorflow-object-detection-api-tutorial.readthedocs.io/en/latest/training.html#create-tensorflow-records We get the error message: ImportError: cannot

How to resolve the error “cannot import name 'string_int_label_map_pb2' from 'object_detection.protos'”

被刻印的时光 ゝ 提交于 2020-12-27 07:23:32
问题 My friends and I are partaking in a hackathon and are stuck on this one tutorial on training an object detection model: https://tensorflow-object-detection-api-tutorial.readthedocs.io/en/latest/training.html But after three people have tried to follow the above tutorial to the letter, we are all stuck on the creating TfRecord step: https://tensorflow-object-detection-api-tutorial.readthedocs.io/en/latest/training.html#create-tensorflow-records We get the error message: ImportError: cannot