forked from CaoWGG/TensorRT-CenterNet
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
update cmakelists.txt and change ctdetforward_kernel
- Loading branch information
Showing
24 changed files
with
169 additions
and
154 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,47 +1,14 @@ | ||
cmake_minimum_required(VERSION 3.5) | ||
project(ctdet_trt) | ||
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/lib) | ||
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/lib) | ||
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}) | ||
|
||
set(CMAKE_BUILD_TYPE Debug) | ||
set(GPU_ARCHS 61) ## config your GPU_ARCHS | ||
set(CMAKE_BUILD_TYPE Release) | ||
set(GPU_ARCHS 61) ## config your GPU_ARCHS,See [here](https://developer.nvidia.com/cuda-gpus) for finding what maximum compute capability your specific GPU supports. | ||
set(TENSORRT_ROOT /usr/local/TensorRT-5.0.2.6) | ||
add_subdirectory(onnx-tensorrt) | ||
|
||
find_package(CUDA REQUIRED) | ||
|
||
find_path(TENSORRT_INCLUDE_DIR NvInfer.h | ||
HINTS ${TENSORRT_ROOT} ${CUDA_TOOLKIT_ROOT_DIR} | ||
PATH_SUFFIXES include/) | ||
message(STATUS "Found TensorRT headers at ${TENSORRT_INCLUDE_DIR}") | ||
find_library(TENSORRT_LIBRARY_INFER nvinfer | ||
HINTS ${TENSORRT_ROOT} ${TENSORRT_BUILD} ${CUDA_TOOLKIT_ROOT_DIR} | ||
PATH_SUFFIXES lib lib64 lib/x64) | ||
set(TENSORRT_LIBRARY ${TENSORRT_LIBRARY_INFER} | ||
nvonnxparser nvonnxparser_runtime) | ||
|
||
message(STATUS ${TENSORRT_LIBRARY}) | ||
find_package(OpenCV REQUIRED) | ||
link_directories(${OpenCV_LIBRARIES_DIRS}) | ||
|
||
include_directories(include ${OpenCV_INCLUDE_DIRS} ${CUDA_INCLUDE_DIRS} | ||
${TENSORRT_INCLUDE_DIR} ${CUDNN_INCLUDE_DIR} ${CUDNN_INCLUDE_DIR} ${TENSORRT_INCLUDE_DIR} onnx-tensorrt ) | ||
|
||
file(GLOB CPP_SRC src/*.cpp) | ||
file(GLOB CU_SRC src/*.cu) | ||
|
||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wall -Ofast") | ||
|
||
list(APPEND CUDA_NVCC_FLAGS "-D_FORCE_INLINES -Xcompiler -fPIC") | ||
|
||
|
||
cuda_add_library(ctdet SHARED src/python_api.cpp ${CPP_SRC} ${CU_SRC}) | ||
target_include_directories(ctdet PUBLIC ${CUDA_INCLUDE_DIRS} ${TENSORRT_INCLUDE_DIR} ${CUDNN_INCLUDE_DIR}) | ||
target_link_libraries(ctdet ${TENSORRT_LIBRARY} ${OpenCV_LIBS}) | ||
|
||
|
||
cuda_add_executable(buildEngine example/buildEngine.cpp ${CPP_SRC} ${CU_SRC}) | ||
target_link_libraries(buildEngine ${OpenCV_LIBS} ${TENSORRT_LIBRARY}) | ||
|
||
cuda_add_executable(runDet example/runDet.cpp ${CPP_SRC} ${CU_SRC}) | ||
target_link_libraries(runDet ${OpenCV_LIBS} ${TENSORRT_LIBRARY}) | ||
## build | ||
add_subdirectory(onnx-tensorrt) | ||
add_subdirectory(src) | ||
add_subdirectory(example) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
cmake_minimum_required(VERSION 3.5) | ||
project(example) | ||
|
||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wall -Ofast") | ||
include_directories(../include | ||
../onnx-tensorrt) | ||
|
||
add_executable(buildEngine buildEngine.cpp) | ||
target_link_libraries(buildEngine ctdet) | ||
|
||
add_executable(runDet runDet.cpp) | ||
target_link_libraries(runDet ctdet) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
cmake_minimum_required(VERSION 3.5) | ||
project(ctdet_trt) | ||
find_package(CUDA REQUIRED) | ||
|
||
find_path(TENSORRT_INCLUDE_DIR NvInfer.h | ||
HINTS ${TENSORRT_ROOT} ${CUDA_TOOLKIT_ROOT_DIR} | ||
PATH_SUFFIXES include/) | ||
message(STATUS "Found TensorRT headers at ${TENSORRT_INCLUDE_DIR}") | ||
find_library(TENSORRT_LIBRARY_INFER nvinfer | ||
HINTS ${TENSORRT_ROOT} ${TENSORRT_BUILD} ${CUDA_TOOLKIT_ROOT_DIR} | ||
PATH_SUFFIXES lib lib64 lib/x64) | ||
message(STATUS "Found TensorRT libs ${TENSORRT_LIBRARY_INFER}") | ||
|
||
find_package(OpenCV REQUIRED) | ||
link_directories(${OpenCV_LIBRARIES_DIRS}) | ||
|
||
file(GLOB CPP_SRC *.cpp) | ||
file(GLOB CU_SRC *.cu) | ||
|
||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wall -Ofast") | ||
list(APPEND CUDA_NVCC_FLAGS "-D_FORCE_INLINES -Xcompiler -fPIC") | ||
|
||
include_directories(${CUDA_INCLUDE_DIRS} | ||
${TENSORRT_INCLUDE_DIR} | ||
${OpenCV_INCLUDE_DIRS} | ||
../include | ||
../onnx-tensorrt) | ||
|
||
cuda_add_library(ctdet SHARED ${CPP_SRC} ${CU_SRC}) | ||
target_link_libraries(ctdet | ||
${TENSORRT_LIBRARY_INFER} | ||
${OpenCV_LIBS} | ||
nvonnxparser | ||
nvonnxparser_runtime) |
Oops, something went wrong.