包括用于对象检测的Darknet Yolov3 [英] Include darknet Yolov3 for object detection

查看:78
本文介绍了包括用于对象检测的Darknet Yolov3的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

不幸的是,我对C ++和Visual Studio的处理经验不足.我必须实现一个C ++应用程序,在其中可以将yolo或darknet集成为一个库并灵活使用.我正在使用Windows和Visual Studio 2015.

我查看了

  • 我还将我的 opencv \ build \ include 路径添加到其他包含目录,即 opencv \ x64 \ vc14 \ lib 添加到附加库目录 opencv_world320.dll 文件到链接器的 Input 字段.

  • 我还设置了 x64 发布

现在,我不知道如何进行.仅创建 source.cpp 并执行 #include"darknet.h" 似乎无效.我收到很多错误,例如: darknet_no_gpu.exe'(Win32):已加载'C:\ Windows \ System32 \ kernel32.dll'.找不到或打开PDB文件..在回购协议中,在很多地方都提到您必须构建解决方案,但是这究竟是什么意思,或者我后来得到的确切信息是什么?

有人知道我能解决我的问题吗?我真的很高兴有任何建议!

解决方案

要在C ++应用程序中使用Yolo v3,可以使用此处找到yolo dll的C ++ API.

要将Yolo DLL添加到VS项目中,您必须...

...将Build设置为发布x64
...在配置属性"选项卡中为发布x64 配置以下属性:

  • Project-> Configuration Properties-> C/C ++-> General-> Additional Include Directories下添加头文件( yolo_v2_class.hpp )的文件夹的路径

  • Project-> Configuration Properties-> Linker-> General-> Additional Library Directories 下添加lib文件( yolo_cpp_dll.lib )的文件夹路径.strong>

  • 项目->配置属性->链接器->输入->其他依赖项

  • 下添加 yolo_cpp_dll.lib >

...将 pthreadVC2.dll yolo_cpp_dll.dll 放在您的.exe文件附近(您可以在 build/darknet/x64 (如果您已经构建了 yolo_cpp_dll.sln yolo_cpp_dll_no_gpu.sln )

感谢 @glm_java 在使用yolo dll时解决了我的运行时问题!

如果您对如何构建或编译这些解决方案还有其他疑问,请随时问我!

Unfortunately I am not very experienced with C++ and the handling of Visual Studio. I have to implement a C++ application, in which I can integrate yolo or darknet as a library and use it flexibly. I'm using Windows and Visual Studio 2015.

I have looked at the following repo. What I have tried so far:

  • I have installed CUDA (although I want to run the model on the CPU for testing purposes), Cudnn and Opencv
  • I opened the vs solution from build\darknet\darknet_no_gpu.sln from the AlexeyAb repo with Visual Studio. Inside the repo there are a lot of header and C-files :

  • I also added my opencv\build\include path to the Additional Include Directories, the opencv\x64\vc14\lib to the Additonal Library Directories and the opencv_world320.dllfile to the linker Input field.

  • I also set x64 and Release

Now, I don't know how to proceed. Just creating a source.cpp and do a #include "darknet.h" seems not to work. I get a lot of errors like: darknet_no_gpu.exe' (Win32): Loaded 'C:\Windows\System32\kernel32.dll'. Cannot find or open the PDB file.. In the repo it is mentioned at several places that you have to build the solution but what exactly does this mean or what exactly do I get afterwards and do with it?

Does anyone know how I could solve my problem? I'm really glad for any advice!

解决方案

For using Yolo v3 in a C++ application you can use the Alexey AB darknet repo.
Just build the yolo_cpp_dll.sln or the yolo_cpp_dll_no_gpu.sln in the build/darknet folder depending on whether you need GPU support or not.
There's also an example console application provided in the repository, that already integrates the yolo dll and it's features (see build/darknet/yolo_console_dll.sln).
You can find more information on how to get those solutions to work and how to use darknet as a dll library here.
The C++ API of the yolo dll can be found here.

To add the Yolo DLL to a VS project, you have to ...

... set Build to Release x64
... configure following properties in "Configuration Properties" tab for Release x64:

  • add the path of the folder of the header file (yolo_v2_class.hpp) under Project->Configuration Properties->C/C++->General->Additional Include Directories

  • add the path of the folder of the lib file (yolo_cpp_dll.lib) under Project->Configuration Properties->Linker->General->Additional Library Directories

  • add yolo_cpp_dll.lib under Project->Configuration Properties->Linker->Input->Additional Dependencies

... put pthreadVC2.dll and yolo_cpp_dll.dll close to your .exe file (you can find those dlls in build/darknet/x64 if you already built the yolo_cpp_dll.sln or the yolo_cpp_dll_no_gpu.sln)

Thanks to @glm_java for fixing my runtime issue when using the yolo dll!

If you have further questions, on how to build or compile these solutions, feel free to ask me!

这篇关于包括用于对象检测的Darknet Yolov3的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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