当前位置:   article > 正文

Qt+YOLOv4实现目标检测_yolo+qt

yolo+qt

环境:

系统:win10 (显卡:NVIDIA GTX 1050)

Yolo版本:V4

cuda:11.2

cudnn:8.1.1

opencv:3.4.15

VS:2019

1.编译前准备

    1.1 opencv

    首先要安装opencv,下载地址如下

https://opencv.org/

    安装3.4.16就可以了

    1.2 安装cuda和cudnn

    安装教程可以参考我这篇文章。

    深度学习GPU环境CUDA安装教程

2.编译YOLO

    YOLO下载地址:‍

https://github.com/AlexeyAB/darknethttps://codechina.csdn.net/mirrors/alexeyab/darknet?utm_source=csdn_github_accelerator

    用记事本打开yolo_cpp_dll.vcxproj

    将里面的版本换成自己的版本,文件中有两处修改。

    修改完成后,打开yolo_cpp_dll.sln,然后选择release,然后生成。

    生成完后就会得到DLL和LIB。

    然后将头文件和库拷贝到自己工程目录下。

3.构建项目

    3.1 添加头文件路径和库

  1. #OPENCV
  2. INCLUDEPATH += E:/build/include/
  3. INCLUDEPATH += E:/build/include/opencv/
  4. INCLUDEPATH += E:/build/include/opencv2/
  5. LIBS += -LE:/build/x64/vc15/lib/ -lopencv_world3415
  6. #YOLO
  7. INCLUDEPATH += $$PWD/yolov4/include/
  8. LIBS += -L$$PWD/yolov4/lib/ -lyolo_cpp_dll

    3.2 添加宏和头文件

  1. //
  2. #define OPENCV
  3. #define GPU
  4. #include "yolo_v2_class.hpp"
  5. //
  6. #include <opencv2\opencv.hpp>
  7. #include "opencv2/highgui/highgui.hpp"
  8. using namespace cv;

    3.3 要下载这几个文件

    里面有权重文件。

  1. https://pan.baidu.com/s/1c-clykwyKHGQp2ENnJjFoA
  2. 密码:d6lz

    3.4 最后运行程序

    结果如下:

    测试源码地址:

https://download.csdn.net/download/qq_40732350/33811403

参考链接:

  1. https://link.zhihu.com/?target=https%3A//pjreddie.com/media/files/yolov3.weights
  2. https://blog.csdn.net/weixin_42448226/article/details/105752224
  3. https://www.cnblogs.com/ivint/p/14298388.html
  4. https://github.com/gyutaebbb/yolo-qt
  5. https://github.com/AlexeyAB/darknet
  6. 1、https://blog.csdn.net/lixudem/article/details/106993430?utm_medium=distribute.pc_relevant.none-task-blog-BlogCommendFromMachineLearnPai2-6.control&depth_1-utm_source=distribute.pc_relevant.none-task-blog-BlogCommendFromMachineLearnPai2-6.control
  7. 2、https://blog.csdn.net/sinat_41852207/article/details/90906309?utm_medium=distribute.pc_relevant.none-task-blog-OPENSEARCH-5.control&depth_1-utm_source=distribute.pc_relevant.none-task-blog-OPENSEARCH-5.control
  8. 3、https://blog.csdn.net/alansss/article/details/104448347?ops_request_misc=%257B%2522request%255Fid%2522%253A%2522161095690516780271532753%2522%252C%2522scm%2522%253A%252220140713.130102334.pc%255Fall.%2522%257D&request_id=161095690516780271532753&biz_id=0&utm_medium=distribute.pc_search_result.none-task-blog-2~all~first_rank_v2~rank_v29-3-104448347.first_rank_v2_pc_rank_v29&utm_term=win10%E7%BC%96%E8%AF%91yolov3%E6%97%B6%E6%8A%A5%E9%94%99error%20MSB3721&spm=1018.2226.3001.4187
  9. 4、https://blog.csdn.net/jin739738709/article/details/90342696
  10. 5、https://blog.csdn.net/stjuliet/article/details/87884976?ops_request_misc=%257B%2522request%255Fid%2522%253A%2522161102361916780269894467%2522%252C%2522scm%2522%253A%252220140713.130102334.pc%255Fall.%2522%257D&request_id=161102361916780269894467&biz_id=0&utm_medium=distribute.pc_search_result.none-task-blog-2~all~first_rank_v2~rank_v29-3-87884976.first_rank_v2_pc_rank_v29&utm_term=%E4%BD%BF%E7%94%A8yolo%E7%9A%84%E5%8A%A8%E6%80%81%E9%93%BE%E6%8E%A5%E5%BA%93&spm=1018.2226.3001.4187

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/盐析白兔/article/detail/553125
推荐阅读
相关标签
  

闽ICP备14008679号