雷

  • 首页

  • 关于

  • 标签

  • 分类

  • 归档

  • 站点地图

qt,NCNN,Darknet,多线程

发表于 2020-01-14 分类于 ncnn , qt , 多线程

集成了qt开发环境, 自定义NCNN(darknet53 yoloV3), 多线程开发模板

获取darknet2ncnn

https://github.com/xiangweizeng/darknet2ncnn

按照md文件编译环境

安装qt开发环境

下载qt: http://download.qt.io/archive/qt/5.13/5.13.2/qt-opensource-linux-x64-5.13.2.run

安装:

1
2
3

sudo chmod 777 ./qt-opensource-linux-x64-5.13.2.run
./qt-opensource-linux-x64-5.13.2.run

新建工程:qt widgets application

配置qt里的.pro文件

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74

QT += gui
QT += core
QT += widgets

CONFIG += c++11
CONFIG -= app_bundle

# The following define makes your compiler emit warnings if you use
# any Qt feature that has been marked deprecated (the exact warnings
# depend on your compiler). Please consult the documentation of the
# deprecated API in order to know how to port your code away from it.
DEFINES += QT_DEPRECATED_WARNINGS

# You can also make your code fail to compile if it uses deprecated APIs.
# In order to do so, uncomment the following line.
# You can also select to disable deprecated APIs only up to a certain version of Qt.
#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0

# 配置源码cpp文件
SOURCES += \
main.cpp \
mainwindow.cpp \
mythread.cpp

# 配置自定义变量, 防止配置文件过长
usrLocInc = /usr/local/include
usrLocLib = /usr/local/lib
NCNN_DIR = /home/ray/ncnn
DARKNET_DIR = /home/ray/darknet2ncnn

# 配置所用的库头文件
INCLUDEPATH += $${usrLocInc} \
$${usrLocInc}/opencv4 \
$${NCNN_DIR}/build/install/include/ncnn \
$${DARKNET_DIR}/include \
$${NCNN_DIR}/src

# 配置所用库so文件
LIBS += $${usrLocLib}/libopencv_highgui.so \
$${usrLocLib}/libopencv_core.so \
$${usrLocLib}/libopencv_imgproc.so \
$${usrLocLib}/libopencv_imgcodecs.so \
$${usrLocLib}/libopencv_video.so \
$${usrLocLib}/libopencv_videoio.so \
$${usrLocLib}/libopencv_calib3d.so \
$${usrLocLib}/libopencv_features2d.so \
$${usrLocLib}/libopencv_flann.so \
$${usrLocLib}/libopencv_objdetect.so \
$${usrLocLib}/libopencv_photo.so \
$${usrLocLib}/libopencv_stitching.so \
$${NCNN_DIR}/build/install/lib/libncnn.a \
$${DARKNET_DIR}/libdarknet2ncnn.a


# 配置 openmp
QMAKE_CXXFLAGS += -fopenmp
LIBS += -fopenmp


# Default rules for deployment.
qnx: target.path = /tmp/$${TARGET}/bin
else: unix:!android: target.path = /opt/$${TARGET}/bin
!isEmpty(target.path): INSTALLS += target

# 配置ui文件
FORMS += \
mainwindow.ui

# 配置源码头文件
HEADERS += \
mainwindow.h \
mythread.h \
portablesleep.h

完整模板代码:

https://github.com/radiumray/qtDarkNetNcnnThread

# ncnn # 多线程
NCNN环境搭建,Opencv与ncnn开发环境配置模板
端到端自动驾驶
  • 文章目录
  • 站点概览
ray

ray

17 日志
23 分类
18 标签
RSS
  1. 1. 获取darknet2ncnn
  2. 2. 安装qt开发环境
  3. 3. 配置qt里的.pro文件
  4. 4. 完整模板代码:
0%
© 2020 ray
由 Hexo 强力驱动 v3.9.0
|
主题 – NexT.Pisces v7.3.0