-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d620fbd
commit 83bee43
Showing
20 changed files
with
547 additions
and
1,813 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,48 +1,21 @@ | ||
cmake_minimum_required(VERSION 2.6) | ||
cmake_minimum_required(VERSION 3.3 FATAL_ERROR) | ||
|
||
project(face-recognition-tensorrt) | ||
set (CMAKE_CXX_STANDARD 17) | ||
set(DEMO face_recognition_demo) | ||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-narrowing") | ||
|
||
set(TARGET_NAME "face-recognition-tensorrt") | ||
set(CMAKE_CXX_STANDARD 17) | ||
file(GLOB SRC "*.cpp") | ||
add_executable(${DEMO} ${SRC}) | ||
|
||
# Find necessary libraries | ||
find_package(OpenCV REQUIRED) | ||
find_package(CUDA REQUIRED) | ||
find_package(ncnn REQUIRED) | ||
|
||
include_directories(${CMAKE_CURRENT_SOURCE_DIR} | ||
${OpenCV_INCLUDE_DIRS} | ||
${CUDA_INCLUDE_DIRS}) | ||
target_link_libraries(${DEMO} ${OpenCV_LIBS} tensorflowlite ${NCNN_LIB} ncnn jsoncpp) | ||
|
||
set(CUDA_NVCC_PLAGS ${CUDA_NVCC_PLAGS};-std=c++11;-g;-G;-gencode;arch=compute_30;code=sm_30) | ||
if (GPU_DELEGATE) | ||
add_definitions(-DGPU_DELEGATE) | ||
target_link_libraries(${DEMO} tensorflowlite_gpu_delegate m EGL GLESv2) | ||
endif() | ||
|
||
file(GLOB CUDA_SOURCES "*.cu") | ||
|
||
cuda_add_library(yolov5_plugin SHARED ${CUDA_SOURCES}) | ||
|
||
# TensorRT libs usage | ||
list(APPEND TensorRT_PLUGINS "nvinfer") | ||
list(APPEND TensorRT_PLUGINS "nvinfer_plugin") | ||
list(APPEND TensorRT_PLUGINS "nvparsers") | ||
|
||
foreach(libName ${TensorRT_PLUGINS}) | ||
message(STATUS "libName: ${libName}") | ||
find_library(TensorRT_${libName}_lib NAMES ${libName} "/usr" PATH_SUFFIXES lib) | ||
list(APPEND TensorRT_PLUGIN_LIBS "${TensorRT_${libName}_lib}") | ||
endforeach() | ||
|
||
file(GLOB SOURCES "*.cpp") | ||
|
||
add_executable(${CMAKE_PROJECT_NAME} ${SOURCES}) | ||
target_link_libraries(${CMAKE_PROJECT_NAME} | ||
${OpenCV_LIBS} | ||
${TensorRT_PLUGIN_LIBS} | ||
${CUDA_LIBRARIES} | ||
${CUDA_CUBLAS_LIBRARIES} | ||
${NCNN_LIB} | ||
yolov5_plugin | ||
ncnn | ||
jsoncpp) | ||
|
||
# Copy models to built folder | ||
file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/data DESTINATION ${CMAKE_CURRENT_BINARY_DIR}) | ||
file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/face_database DESTINATION ${CMAKE_CURRENT_BINARY_DIR}) |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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
Oops, something went wrong.