1 Star 0 Fork 0

cowherd/YOLOv8-TensorRT-CPP

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
CMakeLists.txt 1.32 KB
一键复制 编辑 原始数据 按行查看 历史
cyrusbehr 提交于 2024-04-14 15:34 . Bumped TensorRT version to 10.0
cmake_minimum_required(VERSION 3.22)
project(YOLOv8_TensorRT_CPP)
# Use ccache to speed up rebuilds
include(cmake/ccache.cmake)
# Set C++ version and optimization level
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Ofast -DNDEBUG -Wno-deprecated-declarations")
# CMake Options
option(ENABLE_BENCHMARKS "Benchmark the preprocessing, inference, and post processing" OFF)
if (ENABLE_BENCHMARKS)
add_compile_definitions(ENABLE_BENCHMARKS)
endif()
find_package(OpenCV REQUIRED)
# TODO: Specify the path to TensorRT root dir
set(TensorRT_DIR /home/cyrus/work/libs/TensorRT-10.0.0.6/)
# Build the TensorRT inference engine library
# TensorRT is found and linked by the tensorrt-cpp-api
add_subdirectory(libs/tensorrt-cpp-api)
# Build the YoloV8 library
add_library(YoloV8_TRT SHARED src/yolov8.cpp)
target_link_libraries(YoloV8_TRT PUBLIC tensorrt_cpp_api ${OpenCV_LIBS})
target_include_directories(YoloV8_TRT PUBLIC libs/tensorrt-cpp-api/src)
# Build and link the executables
add_executable(detect_object_image src/object_detection_image.cpp)
target_link_libraries(detect_object_image YoloV8_TRT)
add_executable(benchmark src/benchmark.cpp)
target_link_libraries(benchmark YoloV8_TRT)
add_executable(detect_object_video src/object_detection_video_stream.cpp)
target_link_libraries(detect_object_video YoloV8_TRT)
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/usefordev/YOLOv8-TensorRT-CPP.git
git@gitee.com:usefordev/YOLOv8-TensorRT-CPP.git
usefordev
YOLOv8-TensorRT-CPP
YOLOv8-TensorRT-CPP
main

搜索帮助