1 Star 0 Fork 3

Tangerine/rknn-yolov8

Create your Gitee Account
Explore and code with more than 12 million developers,Free private repositories !:)
Sign up
文件
Clone or Download
CMakeLists.txt 2.29 KB
Copy Edit Raw Blame History
Tangerine authored 2024-11-08 21:41 . 首次提交
# 设置最低版本号
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")
link_directories(
mpp_api
mk_api
)
# 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(RGA_DIR ${3RDPARTY_PATH}/rga/${DEVICE_NAME})
set(RGA_LIB ${RGA_DIR}/lib/Linux/${LIB_ARCH}/librga.so)
find_package(OpenCV REQUIRED)
# 输出OpenCV信息
message(STATUS "include path: ${OpenCV_INCLUDE_DIRS}")
message(STATUS "${OpenCV_VERSION}")
# 寻找Eigen3
set(EIGEN_VERSION 3.3)
find_package(Eigen3 ${EIGEN_VERSION} QUIET)
# 用来搜索头文件的目录
include_directories(
${OpenCV_INCLUDE_DIRS}
${RKNN_API_INCLUDE_PATH}
${CMAKE_CURRENT_SOURCE_DIR}/src
${RGA_DIR}/include
${CMAKE_CURRENT_LIST_DIR}/mpp_api/include
${CMAKE_CURRENT_LIST_DIR}/mk_api/include
)
# 构建预处理和后处理库
add_library(nn_process SHARED
src/process/preprocess.cpp
src/process/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}
)
# yolov8_lib
add_library(yolov8_lib SHARED src/task/yolov8.cpp)
# 链接库
target_link_libraries(yolov8_lib
rknn_engine
nn_process
)
# draw_lib
add_library(draw_lib SHARED src/draw/cv_draw.cpp)
# 链接库
target_link_libraries(draw_lib
${OpenCV_LIBS}
)
# 测试yolov8_img
add_executable(yolov8_img src/yolov8_img.cpp)
# 链接库
target_link_libraries(yolov8_img
draw_lib
yolov8_lib
)
# 测试yolov8_video
add_executable(yolov8_video src/yolov8_video.cpp)
# 链接库
target_link_libraries(yolov8_video
draw_lib
yolov8_lib
)
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/tangerine_yun/rknn-yolov8.git
git@gitee.com:tangerine_yun/rknn-yolov8.git
tangerine_yun
rknn-yolov8
rknn-yolov8
master

Search

0d507c66 1850385 C8b1a773 1850385