-
Notifications
You must be signed in to change notification settings - Fork 235
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
postprocessing: Split existing postproc stages into loadable so files
Split the existing postprocessing stages into 3 .so files: - Core stages - OpenCV stages - TFLite stages These are installed into the /<system lib>/rpicam-apps-postproc/ directory. Additionally, switch enable_tflite and enable_opencv meson option types to "feature". Signed-off-by: Naushir Patuck <[email protected]>
- Loading branch information
Showing
4 changed files
with
61 additions
and
32 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
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,55 +1,85 @@ | ||
posproc_libdir = get_option('prefix') / get_option('libdir') / 'rpicam-apps-pp' | ||
posproc_libdir = get_option('prefix') / get_option('libdir') / 'rpicam-apps-postproc' | ||
|
||
conf_data = configuration_data() | ||
conf_data.set('POSTPROC_LIB_DIR', '"' + posproc_libdir + '"') | ||
configure_file(output : 'postproc_lib.h', configuration : conf_data) | ||
|
||
# Core postprocessing framework files. | ||
rpicam_app_src += files([ | ||
'hdr_stage.cpp', | ||
'histogram.cpp', | ||
'motion_detect_stage.cpp', | ||
'negate_stage.cpp', | ||
'post_processing_stage.cpp', | ||
'pwl.cpp', | ||
]) | ||
|
||
post_processing_headers = files([ | ||
'histogram.hpp', | ||
'object_detect.hpp', | ||
'post_processing_stage.hpp', | ||
'pwl.hpp', | ||
'segmentation.hpp', | ||
'tf_stage.hpp', | ||
# Core postprocessing stages. | ||
core_postproc_src = files([ | ||
'hdr_stage.cpp', | ||
'motion_detect_stage.cpp', | ||
'negate_stage.cpp', | ||
]) | ||
|
||
enable_opencv = get_option('enable_opencv') | ||
opencv_dep = dependency('opencv4', required : false) | ||
if enable_opencv and opencv_dep.found() | ||
rpicam_app_src += files([ | ||
core_postproc_lib = shared_module('core-postproc', core_postproc_src, | ||
include_directories : '../..', | ||
dependencies : libcamera_dep, | ||
cpp_args : cpp_arguments, | ||
install : true, | ||
install_dir : posproc_libdir, | ||
name_prefix : '', | ||
) | ||
|
||
# OpenCV based postprocessing stages. | ||
enable_opencv = false | ||
opencv_dep = dependency('opencv4', required : get_option('enable_opencv')) | ||
if opencv_dep.found() | ||
opencv_postproc_src = files([ | ||
'sobel_cv_stage.cpp', | ||
'face_detect_cv_stage.cpp', | ||
'annotate_cv_stage.cpp', | ||
'plot_pose_cv_stage.cpp', | ||
'object_detect_draw_cv_stage.cpp', | ||
]) | ||
rpicam_app_dep += opencv_dep | ||
else | ||
enable_opencv = false | ||
|
||
opencv_postproc_lib = shared_module('opencv-postproc', opencv_postproc_src, | ||
include_directories : '../..', | ||
dependencies : [libcamera_dep, opencv_dep], | ||
cpp_args : cpp_arguments, | ||
install : true, | ||
install_dir : posproc_libdir, | ||
name_prefix : '', | ||
) | ||
enable_opencv = true | ||
endif | ||
|
||
enable_tflite = get_option('enable_tflite') | ||
tflite_dep = dependency('tensorflow-lite', required : false) | ||
if enable_tflite and tflite_dep.found() | ||
rpicam_app_src += files([ | ||
# TFlite based postprocessing stages. | ||
enable_tflite = false | ||
tflite_dep = dependency('tensorflow-lite', required : get_option('enable_tflite')) | ||
if tflite_dep.found() | ||
tflite_postproc_src = files([ | ||
'tf_stage.cpp', | ||
'object_classify_tf_stage.cpp', | ||
'pose_estimation_tf_stage.cpp', | ||
'object_detect_tf_stage.cpp', | ||
'segmentation_tf_stage.cpp', | ||
]) | ||
rpicam_app_dep += tflite_dep | ||
else | ||
enable_tflite = false | ||
|
||
tflite_postproc_lib = shared_module('tflite-postproc', tflite_postproc_src, | ||
include_directories : '../..', | ||
dependencies : [libcamera_dep, tflite_dep], | ||
cpp_args : cpp_arguments, | ||
install : true, | ||
install_dir : posproc_libdir, | ||
name_prefix : '', | ||
) | ||
enable_tflite = true | ||
endif | ||
|
||
post_processing_headers = files([ | ||
'histogram.hpp', | ||
'object_detect.hpp', | ||
'post_processing_stage.hpp', | ||
'pwl.hpp', | ||
'segmentation.hpp', | ||
'tf_stage.hpp', | ||
]) | ||
|
||
install_headers(post_processing_headers, subdir: meson.project_name() / 'post_processing_stages') |