赞
踩
使用 https://github.com/wangzhaode/yolov8-mnn.git 进行图片检测推理
1,下载MNN
2,ubuntu编译MNN
cd MNN\
mkdir build && cd build && cmake .. -DMNN_BUILD_OPENCV=ON -DMNN_IMGCODECS=ON && make -j8
3,新建CLion共享动态库工程
新建src,include,libs目录
将MNN/include,MNN/tools/cv/include下的文件添加到include
将MNN/build/libMNN.so,MNN/build/express/libMNN_Express.so,MNN/build/tools/cv/libMNNOpenCV.so 添加到libs
编写CMakeLists.txt
cmake_minimum_required(VERSION 3.25)
project(MNNTestSo)
set(CMAKE_CXX_STANDARD 17)
# include dir
include_directories(${CMAKE_CURRENT_LIST_DIR}/include/)
# libs dir
link_directories(${CMAKE_CURRENT_LIST_DIR}/libs)
# target
add_library(MNNTestSo SHARED ${CMAKE_CURRENT_LIST_DIR}/src/library.cpp ${CMAKE_CURRENT_LIST_DIR}/src/library.h)
# link
if (MSVC)
target_link_libraries(MNNTestSo MNN)
else ()
target_link_libraries
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。