signdetect_yolov8.pro 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. QT -= gui
  2. CONFIG += c++11 console
  3. CONFIG -= app_bundle
  4. # The following define makes your compiler emit warnings if you use
  5. # any Qt feature that has been marked deprecated (the exact warnings
  6. # depend on your compiler). Please consult the documentation of the
  7. # deprecated API in order to know how to port your code away from it.
  8. DEFINES += QT_DEPRECATED_WARNINGS
  9. # You can also make your code fail to compile if it uses deprecated APIs.
  10. # In order to do so, uncomment the following line.
  11. # You can also select to disable deprecated APIs only up to a certain version of Qt.
  12. #DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0
  13. # Default rules for deployment.
  14. qnx: target.path = /tmp/$${TARGET}/bin
  15. else: unix:!android: target.path = /opt/$${TARGET}/bin
  16. !isEmpty(target.path): INSTALLS += target
  17. SOURCES += main.cpp \
  18. src/Hungarian.cpp \
  19. src/KalmanTracker.cpp \
  20. src/detect_obstacle.cpp\
  21. $$PWD/../../include/msgtype/rawpic.pb.cc \
  22. $$PWD/../../include/msgtype/lightarray.pb.cc
  23. INCLUDEPATH += include
  24. HEADERS += include/yolo.hpp \
  25. include/infer.hpp \
  26. include/cpm.hpp \
  27. include/imageBuffer.h \
  28. include/Hungarian.h \
  29. include/KalmanTracker.h \
  30. include/detect_obstacle.h
  31. CUDA_SOURCES += src/infer.cu \
  32. src/yolo.cu
  33. DISTFILES += src/infer.cu \
  34. src/yolo.cu
  35. LIBS += -L"/usr/local/lib" \
  36. -lprotobuf
  37. # opencv
  38. INCLUDEPATH += /usr/include/opencv4
  39. LIBS += /usr/lib/aarch64-linux-gnu/libopencv_*.so
  40. # tensorrt
  41. LIBS += /usr/lib/aarch64-linux-gnu/libnvinfer.so \
  42. /usr/lib/aarch64-linux-gnu/libnvinfer_plugin.so
  43. # c++
  44. LIBS += -L/usr/lib/aarch64-linux-gnu -lstdc++fs
  45. # cuda
  46. CUDA_SDK = "/usr/local/cuda" # Path to cuda SDK install
  47. CUDA_DIR = "/usr/local/cuda" # Path to cuda toolkit install
  48. INCLUDEPATH += ../../../include
  49. LIBS += $$PWD/../../../bin/libxmlparam.so \
  50. $$PWD/../../../bin/libivlog.so \
  51. $$PWD/../../../bin/libivfault.so \
  52. $$PWD/../../../bin/libmodulecomm.so
  53. !include(../../../include/common.pri ) {
  54. error( "Couldn't find the common.pri file!" )
  55. }
  56. !include(../../../include/ivprotobuf.pri ) {
  57. error( "Couldn't find the ivprotobuf.pri file!" )
  58. }
  59. !include(../../../include/ivopencv.pri ) {
  60. error( "Couldn't find the ivopencv.pri file!" )
  61. }
  62. INCLUDEPATH += $$PWD/../../include/msgtype
  63. LIBS += -L/usr/lib/aarch64-linux-gnu/ -lglog
  64. #####系统类型,计算能力###########
  65. SYSTEM_NAME = linux # Depending on your system either 'Win32', 'x64', or 'Win64'
  66. SYSTEM_TYPE = 64 # '32' or '64', depending on your system
  67. CUDA_ARCH = sm_72 # Type of CUDA architecture, for example 'compute_10', 'compute_11', 'sm_10'
  68. NVCC_OPTIONS = --use_fast_math
  69. INCLUDEPATH += $$CUDA_DIR/include
  70. QMAKE_LIBDIR += $$CUDA_DIR/lib64/
  71. CUDA_OBJECTS_DIR = ./
  72. # Add the necessary libraries
  73. CUDA_LIBS = -lcuda -lcudart #-lcublas
  74. # The following makes sure all path names (which often include spaces) are put between quotation marks
  75. CUDA_INC = $$join(INCLUDEPATH,'" -I"','-I"','"')
  76. LIBS += $$CUDA_LIBS
  77. # Configuration of the Cuda compiler
  78. CONFIG(debug, debug|release) {
  79. # Debug mode
  80. cuda_d.input = CUDA_SOURCES
  81. cuda_d.output = $$CUDA_OBJECTS_DIR/${QMAKE_FILE_BASE}.o
  82. cuda_d.commands = $$CUDA_DIR/bin/nvcc -D_DEBUG $$NVCC_OPTIONS $$CUDA_INC $$NVCC_LIBS --machine $$SYSTEM_TYPE -arch=$$CUDA_ARCH -c -o ${QMAKE_FILE_OUT} ${QMAKE_FILE_NAME}
  83. cuda_d.dependency_type = TYPE_C
  84. QMAKE_EXTRA_COMPILERS += cuda_d
  85. }
  86. else {
  87. # Release mode
  88. cuda.input = CUDA_SOURCES
  89. cuda.output = $$CUDA_OBJECTS_DIR/${QMAKE_FILE_BASE}.o
  90. cuda.commands = $$CUDA_DIR/bin/nvcc $$NVCC_OPTIONS $$CUDA_INC $$NVCC_LIBS --machine $$SYSTEM_TYPE -arch=$$CUDA_ARCH -c -o ${QMAKE_FILE_OUT} ${QMAKE_FILE_NAME}
  91. cuda.dependency_type = TYPE_C
  92. QMAKE_EXTRA_COMPILERS += cuda
  93. }