Skip to content

Commit

Permalink
build: Install JSON assets
Browse files Browse the repository at this point in the history
Install the postprocessing JSON config assets as part of the meson
install stage. They are put into <prefix>/share/rpi-camera-assets/

Signed-off-by: Naushir Patuck <naush@raspberrypi.com>
  • Loading branch information
naushir committed Jun 26, 2024
1 parent b2b8331 commit 4ec534b
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 4 deletions.
23 changes: 20 additions & 3 deletions post_processing_stages/hailo/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@ hailo_postproc_lib = configure_file(output : 'hailo_postproc_lib.h', configurati
hailo_deps = [hailort_dep, hailo_tappas_dep, libcamera_dep]

# Hailo Tappas PP config files to be installed
assets_dir = meson.project_source_root() / 'assets'
hailopp_config_files = [assets_dir / 'yolov5_personface.json']
hailopp_config_files = files([
assets_dir / 'yolov5_personface.json',
])

hailo_postprocessing_src = files([
# Base stage
Expand All @@ -20,15 +21,31 @@ hailo_postprocessing_src = files([
'hailo_classifier.cpp',
])

postproc_assets += files([
assets_dir / 'hailo_classifier.json',
assets_dir / 'hailo_yolov5_personface.json',
assets_dir / 'hailo_yolov6_inference.json',
assets_dir / 'hailo_yolov8_inference.json',
assets_dir / 'hailo_yolox_inference.json',
])

if opencv_dep.found()
hailo_postprocessing_src += files([
# Pose estimation
'hailo_yolov8_pose.cpp',
# Instance segmentation
'hailo_yolov5_segmentation.cpp'
])

postproc_assets += files([
assets_dir / 'hailo_yolov8_pose.json',
assets_dir / 'hailo_yolov5_segmentation.json',
])

hailo_deps + opencv_dep
hailopp_config_files += assets_dir / 'yolov5seg.json'
hailopp_config_files += files([
assets_dir / 'yolov5seg.json',
])
endif

hailo_cpp_arguments = ['-Wno-ignored-qualifiers', '-Wno-unused-parameter', '-Wno-extra']
Expand Down
29 changes: 28 additions & 1 deletion post_processing_stages/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ conf_data = configuration_data()
conf_data.set('POSTPROC_LIB_DIR', '"' + posproc_libdir + '"')
configure_file(output : 'postproc_lib.h', configuration : conf_data)

# JSON (and other assets)
assets_dir = meson.project_source_root() / 'assets'
postproc_assets = []

# Core postprocessing framework files.
rpicam_app_src += files([
'histogram.cpp',
Expand All @@ -18,6 +22,13 @@ core_postproc_src = files([
'negate_stage.cpp',
])

# Core assets
postproc_assets += files([
assets_dir / 'hdr.json',
assets_dir / 'motion_detect.json',
assets_dir / 'negate.json',
])

core_postproc_lib = shared_module('core-postproc', core_postproc_src,
include_directories : '../..',
dependencies : libcamera_dep,
Expand All @@ -39,6 +50,13 @@ if opencv_dep.found()
'object_detect_draw_cv_stage.cpp',
])

# OpenCV assets
postproc_assets += files([
assets_dir / 'sobel_cv.json',
assets_dir / 'face_detect_cv.json',
assets_dir / 'annotate_cv.json',
])

opencv_postproc_lib = shared_module('opencv-postproc', opencv_postproc_src,
include_directories : '../..',
dependencies : [libcamera_dep, opencv_dep],
Expand All @@ -57,11 +75,19 @@ 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',
'pose_estimation_tf_stage.cpp',
'segmentation_tf_stage.cpp',
])

# TFlite assets
postproc_assets += files([
assets_dir / 'object_classify_tf.json',
assets_dir / 'object_detect_tf.json',
assets_dir / 'pose_estimation_tf.json',
assets_dir / 'segmentation_tf.json',
])

tflite_postproc_lib = shared_module('tflite-postproc', tflite_postproc_src,
include_directories : '../..',
dependencies : [libcamera_dep, tflite_dep],
Expand Down Expand Up @@ -93,3 +119,4 @@ post_processing_headers = files([
])

install_headers(post_processing_headers, subdir: meson.project_name() / 'post_processing_stages')
install_data(postproc_assets, install_dir : get_option('datadir') / 'rpi-camera-assets')

0 comments on commit 4ec534b

Please sign in to comment.