@@ -7,9 +7,9 @@ add_compile_options(-std=c++11)
7
7
## Optional parts of library
8
8
set (opencv_contrib OFF )
9
9
set (zbar_lib OFF )
10
- set (TensorFlow OFF )
11
10
set (DLib OFF )
12
11
set (igraph OFF )
12
+ set (torch OFF )
13
13
14
14
## Find catkin macros and libraries
15
15
## if COMPONENTS list like find_package(catkin REQUIRED COMPONENTS xyz)
@@ -39,6 +39,15 @@ if(DLib)
39
39
add_subdirectory (/home/anton/Lib/dlib dlib_build )
40
40
endif (DLib )
41
41
42
+ if (torch )
43
+ #set(CMAKE_PREFIX_PATH "${CMAKE_PREFIX_PATH}/home/anton/Libs/libtorch")
44
+ list (APPEND CMAKE_PREFIX_PATH "/home/anton/Lib/libtorch" )
45
+ message (${CMAKE_PREFIX_PATH} )
46
+ find_package (Torch REQUIRED )
47
+ set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${TORCH_CXX_FLAGS} " )
48
+ endif (torch )
49
+
50
+
42
51
43
52
################################################
44
53
## Declare ROS messages, services and actions ##
@@ -123,6 +132,7 @@ set( EOD_SRC
123
132
src/lib/detectors/ExtractedInfoStringChecker.cpp
124
133
src/lib/detectors/UnitTranslationExtracter.cpp
125
134
src/lib/detectors/SquareObjectDistanceDetector.cpp
135
+ src/lib/detectors/TorchYOLOv7Detector.cpp
126
136
127
137
# lib relations
128
138
src/lib/relations/ImageRangeRelation.cpp
@@ -148,9 +158,6 @@ add_executable(
148
158
${EOD_SRC}
149
159
)
150
160
151
- if (TensorFlow )
152
- target_compile_definitions (extended_object_detection_node PUBLIC USE_TF )
153
- endif (TensorFlow )
154
161
155
162
if (opencv_contrib )
156
163
target_compile_definitions (extended_object_detection_node PUBLIC USE_OPENCV_CONTRIB )
@@ -168,6 +175,10 @@ if(igraph)
168
175
target_compile_definitions (extended_object_detection_node PUBLIC USE_IGRAPH )
169
176
endif (igraph )
170
177
178
+ if (torch )
179
+ target_compile_definitions (extended_object_detection_node PUBLIC USE_TORCH )
180
+ endif (torch )
181
+
171
182
#collect hsv color c++ utility
172
183
add_executable (
173
184
hsv_color_params_collector_node
@@ -499,11 +510,30 @@ if(igraph)
499
510
)
500
511
endif (igraph )
501
512
513
+ if (torch )
514
+ set_property (TARGET extended_object_detection_node PROPERTY CXX_STANDARD 14 )
515
+ set_property (TARGET offline_video PROPERTY CXX_STANDARD 14 )
516
+ set_property (TARGET offline_image PROPERTY CXX_STANDARD 14 )
517
+
518
+ target_link_libraries (extended_object_detection_node
519
+ ${TORCH_LIBRARIES}
520
+ )
521
+
522
+ target_link_libraries (offline_video
523
+ ${TORCH_LIBRARIES}
524
+ )
525
+
526
+ target_link_libraries (offline_image
527
+ ${TORCH_LIBRARIES}
528
+ )
529
+ endif (torch )
530
+
502
531
503
532
target_link_libraries (extended_object_detection_node
504
533
${OpenCV_LIBRARIES}
505
534
${TinyXML_LIBRARIES}
506
535
${catkin_LIBRARIES}
536
+
507
537
)
508
538
509
539
target_link_libraries (hsv_color_params_collector_node
0 commit comments