-
Notifications
You must be signed in to change notification settings - Fork 23
/
Copy pathCMakeLists.txt
156 lines (139 loc) · 3.51 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
cmake_minimum_required(VERSION 2.8.12)
project(darknet_ros)
find_package(CUDA REQUIRED)
find_package(OpenCV REQUIRED)
find_package(catkin REQUIRED COMPONENTS
cv_bridge
roscpp
rospy
std_msgs
image_transport
message_generation
)
add_message_files(
FILES
bbox.msg
bbox_array.msg
)
generate_messages(
DEPENDENCIES
std_msgs
)
set(
CUDA_NVCC_FLAGS
${CUDA_NVCC_FLAGS};
-O3
-gencode arch=compute_20,code=[sm_20,sm_21]
-gencode arch=compute_30,code=sm_30
-gencode arch=compute_35,code=sm_35
-gencode arch=compute_50,code=[sm_50,compute_50]
-gencode arch=compute_52,code=[sm_52,compute_52]
-gencode arch=compute_53,code=sm_53
-gencode arch=compute_61,code=sm_61
-gencode arch=compute_62,code=sm_62
)
add_definitions(-DGPU -DOPENCV -O4 -g)
catkin_package(
CATKIN_DEPENDS message_runtime
)
set(DARKNET_DIR "darknet")
set(DARKNET_SRC_DIR "${DARKNET_DIR}/src")
include_directories(
/usr/local/cuda/include
src
${DARKNET_DIR}/include
${DARKNET_SRC_DIR}
${catkin_INCLUDE_DIRS}
${OpenCV_INCLUDE_DIRS}
)
link_directories(
/usr/local/cuda/lib64
)
set(DARKNET_SRC_FILES
${DARKNET_SRC_DIR}/activation_layer.c
${DARKNET_SRC_DIR}/activations.c
${DARKNET_SRC_DIR}/avgpool_layer.c
${DARKNET_SRC_DIR}/batchnorm_layer.c
${DARKNET_SRC_DIR}/blas.c
${DARKNET_SRC_DIR}/box.c
${DARKNET_SRC_DIR}/col2im.c
${DARKNET_SRC_DIR}/compare.c
${DARKNET_SRC_DIR}/connected_layer.c
${DARKNET_SRC_DIR}/convolutional_layer.c
${DARKNET_SRC_DIR}/cost_layer.c
${DARKNET_SRC_DIR}/crnn_layer.c
${DARKNET_SRC_DIR}/crop_layer.c
${DARKNET_SRC_DIR}/cuda.c
${DARKNET_SRC_DIR}/data.c
${DARKNET_SRC_DIR}/deconvolutional_layer.c
#${DARKNET_SRC_DIR}/demo.c
${DARKNET_SRC_DIR}/detection_layer.c
${DARKNET_SRC_DIR}/dropout_layer.c
${DARKNET_SRC_DIR}/gemm.c
${DARKNET_SRC_DIR}/gru_layer.c
${DARKNET_SRC_DIR}/im2col.c
${DARKNET_SRC_DIR}/image.c
${DARKNET_SRC_DIR}/layer.c
${DARKNET_SRC_DIR}/list.c
${DARKNET_SRC_DIR}/local_layer.c
${DARKNET_SRC_DIR}/lstm_layer.c
${DARKNET_SRC_DIR}/matrix.c
${DARKNET_SRC_DIR}/maxpool_layer.c
${DARKNET_SRC_DIR}/network.c
${DARKNET_SRC_DIR}/normalization_layer.c
${DARKNET_SRC_DIR}/option_list.c
${DARKNET_SRC_DIR}/parser.c
${DARKNET_SRC_DIR}/region_layer.c
${DARKNET_SRC_DIR}/reorg_layer.c
${DARKNET_SRC_DIR}/rnn_layer.c
${DARKNET_SRC_DIR}/route_layer.c
${DARKNET_SRC_DIR}/shortcut_layer.c
${DARKNET_SRC_DIR}/softmax_layer.c
${DARKNET_SRC_DIR}/tree.c
${DARKNET_SRC_DIR}/utils.c
${DARKNET_SRC_DIR}/activation_kernels.cu
${DARKNET_SRC_DIR}/avgpool_layer_kernels.cu
${DARKNET_SRC_DIR}/blas_kernels.cu
${DARKNET_SRC_DIR}/col2im_kernels.cu
${DARKNET_SRC_DIR}/convolutional_kernels.cu
${DARKNET_SRC_DIR}/crop_layer_kernels.cu
${DARKNET_SRC_DIR}/deconvolutional_kernels.cu
${DARKNET_SRC_DIR}/dropout_layer_kernels.cu
${DARKNET_SRC_DIR}/im2col_kernels.cu
${DARKNET_SRC_DIR}/maxpool_layer_kernels.cu
${DARKNET_SRC_DIR}/network_kernels.cu
)
cuda_add_executable(single_image_test
src/single_image_test.cpp
src/run_yolo.cpp
"${DARKNET_SRC_FILES}"
)
cuda_add_executable(yolo_ros
src/yolo_ros.cpp
src/run_yolo.cpp
"${DARKNET_SRC_FILES}"
)
target_link_libraries(single_image_test
m
pthread
stdc++
cuda
cudart
cublas
curand
${catkin_LIBRARIES}
${OpenCV_LIBRARIES}
)
target_link_libraries(yolo_ros
m
pthread
stdc++
cuda
cudart
cublas
curand
${catkin_LIBRARIES}
${OpenCV_LIBRARIES}
)
add_dependencies(single_image_test darknet_ros_generate_messages_cpp)
add_dependencies(yolo_ros darknet_ros_generate_messages_cpp)