forked from opentrack/opentrack
-
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.
- Address review comment opentrack#1306 (comment) - Update ONNXRuntime module to use a specific `onnxruntime` target. - Use OpenCV components instead. NOTE: ONNXRuntinme may provide their own ONNXRuntimeConfig.cmake and ONNXRuntimeVersion.cmake in the future. See microsoft/onnxruntime#3124 for reference
- Loading branch information
Showing
2 changed files
with
32 additions
and
17 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
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,19 +1,25 @@ | ||
include(opentrack-opencv) | ||
find_package(OpenCV QUIET) | ||
find_package(OpenCV QUIET COMPONENTS imgproc core imgcodecs calib3d) | ||
find_package(OpenMP QUIET) # Used to control number of onnx threads. | ||
find_package(ONNXRuntime QUIET) | ||
|
||
if(OpenCV_FOUND AND ONNXRuntime_FOUND AND OpenMP_FOUND) | ||
otr_module(tracker-neuralnet) | ||
target_include_directories(${self} SYSTEM PUBLIC | ||
${OpenCV_INCLUDE_DIRS} "${ONNXRuntime_INCLUDE_DIRS}") | ||
target_link_libraries(${self} "${ONNXRuntime_LIBRARIES}" | ||
opentrack-cv opencv_imgproc opencv_core | ||
opencv_imgcodecs opencv_calib3d | ||
OpenMP::OpenMP_C) | ||
|
||
target_include_directories(${self} | ||
SYSTEM PRIVATE | ||
${OpenCV_INCLUDE_DIRS} | ||
${ONNXRuntime_INCLUDE_DIRS} | ||
) | ||
target_link_libraries(${self} | ||
opentrack-cv | ||
${ONNXRuntime_LIBRARIES} | ||
${OpenCV_LIBS} | ||
OpenMP::OpenMP_C | ||
) | ||
install( | ||
FILES "models/head-localizer.onnx" "models/head-pose.onnx" | ||
FILES "models/head-localizer.onnx" | ||
"models/head-pose.onnx" | ||
DESTINATION "${opentrack-libexec}/models" | ||
PERMISSIONS ${opentrack-perms-file}) | ||
PERMISSIONS ${opentrack-perms-file} | ||
) | ||
endif() |