代码拉取完成,页面将自动刷新
同步操作将从 Tangerine/rknn-yolov5 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
# 设置最低版本号
cmake_minimum_required(VERSION 3.11 FATAL_ERROR)
# 设置项目名称
project(rk3588-demo VERSION 0.0.1 LANGUAGES CXX)
# 输出系统信息
message(STATUS "System: ${CMAKE_SYSTEM_NAME} ${CMAKE_SYSTEM_VERSION}")
# 设置编译器
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
# 设置库架构
set(LIB_ARCH "aarch64")
set(DEVICE_NAME "RK3588")
# rknn_api 文件夹路径
set(RKNN_API_PATH ${CMAKE_CURRENT_SOURCE_DIR}/librknn_api)
# rknn_api include 路径
set(RKNN_API_INCLUDE_PATH ${RKNN_API_PATH}/include)
# rknn_api lib 路径
set(RKNN_API_LIB_PATH ${RKNN_API_PATH}/${LIB_ARCH}/librknnrt.so)
# 寻找OpenCV库,使用自定义的OpenCV_DIR
set(3RDPARTY_PATH ${CMAKE_CURRENT_SOURCE_DIR}/3rdparty)
set(OpenCV_DIR ${3RDPARTY_PATH}/opencv/opencv-linux-${LIB_ARCH}/share/OpenCV)
find_package(OpenCV REQUIRED)
# 输出OpenCV信息
message(STATUS "include path: ${OpenCV_INCLUDE_DIRS}")
# 用来搜索头文件的目录
include_directories(
${OpenCV_INCLUDE_DIRS}
${RKNN_API_INCLUDE_PATH}
${CMAKE_CURRENT_SOURCE_DIR}/src
${RGA_DIR}/include
)
# 构建预处理和后处理库
add_library(nn_process SHARED
src/process/preprocess.cpp
src/process/yolov5_postprocess.cpp
)
# 链接库
target_link_libraries(nn_process
${OpenCV_LIBS}
)
# 构建自定义封装API库
add_library(rknn_engine SHARED src/engine/rknn_engine.cpp)
# 链接库
target_link_libraries(rknn_engine
${RKNN_API_LIB_PATH}
)
# yolov5_lib
add_library(yolov5_lib SHARED src/task/yolov5.cpp)
# 链接库
target_link_libraries(yolov5_lib
rknn_engine
nn_process
)
# draw_lib
add_library(draw_lib SHARED src/draw/cv_draw.cpp)
# 链接库
target_link_libraries(draw_lib
${OpenCV_LIBS}
)
# 测试自yolov5
add_executable(yolov5_test src/yolov5_test.cpp)
# 链接库
target_link_libraries(yolov5_test
draw_lib
yolov5_lib
)
# 测试自yolov5
add_executable(test src/test.cpp)
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。