ubuntu20.04使用C++与ONNXRuntime对yolov8目标检测模型进行推理预测(源码)
立即下载
资源介绍:
ubuntu20.04使用C++与ONNXRuntime对yolov8目标检测模型进行推理预测(源码)
cmake_minimum_required(VERSION 3.10)
project(yolov8_ort)
set(CMAKE_BUILD_TYPE "Debug")
find_package(OpenCV REQUIRED)
include_directories("include/" ${OpenCV_INCLUDE_DIRS})
add_executable(yolov8_ort
src/utils.cpp
src/yolov8Predictor.cpp
src/main.cpp
)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
target_compile_features(yolov8_ort PRIVATE cxx_std_17)
target_link_libraries(yolov8_ort ${OpenCV_LIBS})
# onnxruntime include
target_include_directories(yolov8_ort PRIVATE
"/home/user/tools/onnxruntime-linux-x64-gpu-1.13.1/include/")
# onnxruntime lib
target_link_libraries(yolov8_ort
"/home/user/tools/onnxruntime-linux-x64-gpu-1.13.1/lib/libonnxruntime.so" )