代码拉取完成,页面将自动刷新
cmake_minimum_required(VERSION 3.13)
project(yolov5)
add_definitions(-std=c++14)
add_definitions(-DAPI_EXPORTS)
option(CUDA_USE_STATIC_CUDA_RUNTIME OFF)
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_BUILD_TYPE Debug)
find_package(CUDA REQUIRED)
if(WIN32)
enable_language(CUDA)
endif(WIN32)
include_directories(${PROJECT_SOURCE_DIR}/include)
# include and link dirs of cuda and tensorrt, you need adapt them if yours are different
# cuda
include_directories(/usr/local/cuda/include)
link_directories(/usr/local/cuda/lib64)
# tensorrt
include_directories(/usr/include/aarch64-linux-gnu/)
link_directories(/usr/lib/aarch64-linux-gnu/)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wall -Ofast -g -Wfatal-errors -D_MWAITXINTRIN_H_INCLUDED")
cuda_add_library(myplugins SHARED yololayer.cu)
target_link_libraries(myplugins nvinfer cudart)
find_package(OpenCV REQUIRED)
include_directories(${OpenCV_INCLUDE_DIRS})
include_directories(/opt/MVS/include)
link_directories(${OpenCV_LIBRARY_DIRS})
link_directories("/opt/MVS/lib/aarch64")
link_libraries("/opt/MVS/lib/aarch64/libMvCameraControl.so")
cuda_add_executable(yolov5 calibrator.cpp yolov5.cpp preprocess.cu serialPort.cpp serialPort.hpp HIKCam.cpp HIKCam.hpp)
target_link_libraries(yolov5 nvinfer)
target_link_libraries(yolov5 cudart)
target_link_libraries(yolov5 myplugins)
target_link_libraries(yolov5 ${OpenCV_LIBS})
target_link_libraries(yolov5 -lMvCameraControl)
target_link_libraries(yolov5 libMvCameraControl.so)
add_executable(yolov5-cls calibrator.cpp yolov5_cls.cpp serialPort.cpp serialPort.hpp HIKCam.cpp HIKCam.hpp)
target_link_libraries(yolov5-cls nvinfer)
target_link_libraries(yolov5-cls cudart)
target_link_libraries(yolov5-cls myplugins)
target_link_libraries(yolov5-cls ${OpenCV_LIBS})
target_link_libraries(yolov5-cls -lMvCameraControl)
target_link_libraries(yolov5-cls libMvCameraControl.so)
if(UNIX)
add_definitions(-O3 -pthread)
endif(UNIX)
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。