Giter Club home page Giter Club logo

hpc203 / yolopv2-opencv-onnxrun-cpp-py Goto Github PK

View Code? Open in Web Editor NEW
68.0 1.0 7.0 408 KB

分别使用OpenCV、ONNXRuntime部署YOLOPV2目标检测+可驾驶区域分割+车道线分割,一共包含54个onnx模型,依然是包含C++和Python两个版本的程序。仅仅只依赖OpenCV就能运行,彻底摆脱对任何深度学习框架的依赖。

C++ 60.41% Python 39.59%
autonomous-driving cpp drivable-area-segmentation lane-lines-detection object-detection onnxruntime opencv-dnn python yolopv2

yolopv2-opencv-onnxrun-cpp-py's Introduction

yolopv2-opencv-onnxrun-cpp-py

分别使用OpenCV、ONNXRuntime部署YOLOPV2目标检测+可驾驶区域分割+车道线分割,一共包含54个onnx模型,依然是包含C++和Python两个版本的程序

由于模型文件数量比较多,无法直接上传到github,因此把模型文件上传到百度云盘。 链接: https://pan.baidu.com/s/1aOflEqusdGZT2mhQI-ckqg 密码: w6g9

54个onnx模型文件,占用的磁盘空间是7.84G,其中

(1).onnx_post文件夹里的onnx文件,是把最后3个yolo层在经过decode之后,经过torch.cat(z, 1)合并成一个张量,并且还包含nms的。 因此在加载onnx_post文件夹里的onnx文件做推理之后的后处理非常简单,只需要过滤置信度低的检测框。但是经过程序运行实验,onnxruntime能加载 onnx文件做推理并且结果正常,但是opencv的dnn模块不能。

(2). onnx_split文件夹里的onnx文件,是把最后3个yolo层在经过decode之后,经过torch.cat(z, 1)合并成一个张量。 因此在加载onnx_split文件夹里的onnx文件做推理之后的后处理,包括过滤置信度低的检测框,然后执行nms去除重叠度高的检测框。 经过程序运行实验,onnxruntime能加载onnx文件做推理并且结果正常,而opencv的dnn模块能加载onnx文件,但是在forward函数报错。

(3). onnx文件夹里的onnx文件, 是不包含最后3个yolo层的。因此在加载onnx文件夹里的onnx文件做推理之后的后处理,包括 3个yolo层分别做decode,过滤置信度低的检测框,执行nms去除重叠度高的检测框,一共3个步骤。 经过程序运行实验,onnxruntime和opencv的dnn模块都能加载onnx文件做推理并且结果正常。

yolopv2-opencv-onnxrun-cpp-py's People

Contributors

hpc203 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

yolopv2-opencv-onnxrun-cpp-py's Issues

Models for Europe ;)

Would u link models through google drive for example? We can't sign up for baidu, therefore use your trained models and code is useless without your awesome models :D

Yolov5-Seg&Classification

Hi, thanks for your work.
Is it possible to support Yolov5-Seg and Yolov5-Classification(v6.2)?

Thanks in advance.

Provide Gdrive link

Hi, thank you for sharing.
Unfortunately, I don't have access to the Baidu link. Is it possible to share with Gdrive?

Thank you in advance.

报错

image
我可以运行opencv文件夹里的代码,但onnxruntime里的代码会报错,这是什么原因呢

Opencv dnn onnx_importer.cpp failed

Thanks for the sharing. I tried the opencv code to import onnx/yolopv2_480x640.onnx but failed. My terminal output is

terminate called after throwing an instance of 'cv::Exception'
  what():  OpenCV(4.4.0) /tmp/third_party/opencv-4.4.0/modules/dnn/src/onnx/onnx_importer.cpp:1410: error: (-2:Unspecified error) in function 'void cv::dnn::dnn4_v20200609::ONNXImporter::populateNet(cv::dnn::dnn4_v20200609::Net)'
>  (expected: 'shapes.depth() == CV_32S'), where
>     'shapes.depth()' is 5 (CV_32FC1)
> must be equal to
>     'CV_32S' is 4 (CV_32SC1)

Aborted (core dumped)

Have you met this before? How can i fix this? Thanks.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.