1 if nnfw_runtime_support_is_available
2 filter_sub_nnfw_sources = ['tensor_filter_nnfw.c']
4 nnstreamer_filter_nnfw_deps = [nnfw_runtime_support_deps, nnstreamer_single_dep]
6 # Check old function (@todo remove this definition later, nnfw ver >= 1.6.0)
7 if not cc.has_header_symbol('nnfw/nnfw.h', 'nnfw_set_input_tensorinfo', dependencies: nnfw_dep)
8 nnstreamer_filter_nnfw_deps += declare_dependency(compile_args: ['-DNNFW_USE_OLD_API=1'])
11 nnfw_plugin_lib = shared_library('nnstreamer_filter_nnfw',
12 filter_sub_nnfw_sources,
13 dependencies: nnstreamer_filter_nnfw_deps,
15 install_dir: filter_subplugin_install_dir
17 static_library('nnstreamer_filter_nnfw',
18 filter_sub_nnfw_sources,
19 dependencies: nnstreamer_filter_nnfw_deps,
21 install_dir: nnstreamer_libdir
24 nnfw_plugin_dep = declare_dependency(link_with: nnfw_plugin_lib,
25 dependencies: nnstreamer_filter_nnfw_deps)
28 if armnn_support_is_available
29 filter_sub_armnn_sources = [
30 'tensor_filter_armnn.cc'
33 if cxx.has_header('armnnCaffeParser/ICaffeParser.hpp')
34 armnn_caffeparserlib = cxx.find_library('armnnCaffeParser', required: true)
35 armnn_caffe_dep = declare_dependency(compile_args: '-DENABLE_ARMNN_CAFFE=1')
36 armnn_support_deps = armnn_support_deps + [ armnn_caffe_dep, armnn_caffeparserlib ]
37 message('ARMNN subplugin is built with Caffe parser.')
39 if cxx.has_header('armnnTfLiteParser/ITfLiteParser.hpp')
40 armnn_tflparserlib = cxx.find_library('armnnTfLiteParser', required: true)
41 armnn_tfl_dep = declare_dependency(compile_args: '-DENABLE_ARMNN_TFLITE=1')
42 armnn_support_deps = armnn_support_deps + [ armnn_tfl_dep, armnn_tflparserlib ]
43 message('ARMNN subplugin is built with TFLite parser.')
46 nnstreamer_filter_armnn_deps = [armnn_support_deps, glib_dep, nnstreamer_single_dep]
48 armnn_plugin_lib = shared_library('nnstreamer_filter_armnn',
49 filter_sub_armnn_sources,
50 dependencies: nnstreamer_filter_armnn_deps,
52 install_dir: filter_subplugin_install_dir
54 static_library('nnstreamer_filter_armnn',
55 filter_sub_armnn_sources,
56 dependencies: nnstreamer_filter_armnn_deps,
58 install_dir: nnstreamer_libdir
61 armnn_plugin_dep = declare_dependency(link_with: armnn_plugin_lib,
62 dependencies: nnstreamer_filter_armnn_deps)
65 tf_ver_dep = disabler()
66 if tf_support_is_available
67 tf_ver = tf_support_deps[0].version()
68 tf_ver_major = tf_ver.split('.')[0]
69 tf_ver_minor = tf_ver.split('.')[1]
70 tf_ver_micro = tf_ver.split('.')[2]
72 tf_ver_dep = declare_dependency (
74 '-DTF_VERSION=' + tf_ver,
75 '-DTF_VERSION_MAJOR=' + tf_ver_major,
76 '-DTF_VERSION_MINOR=' + tf_ver_minor,
77 '-DTF_VERSION_MICRO=' + tf_ver_micro,
80 message('TensorFlow version: ' + tf_ver)
82 filter_sub_tf_sources = ['tensor_filter_tensorflow.cc']
84 nnstreamer_filter_tf_deps = [tf_support_deps, nnstreamer_single_dep]
85 nnstreamer_filter_tf_deps += tf_ver_dep
87 shared_library('nnstreamer_filter_tensorflow',
88 filter_sub_tf_sources,
89 dependencies: nnstreamer_filter_tf_deps,
91 install_dir: filter_subplugin_install_dir
94 static_library('nnstreamer_filter_tensorflow',
95 filter_sub_tf_sources,
96 dependencies: nnstreamer_filter_tf_deps,
98 install_dir: nnstreamer_libdir
102 tflite_ver_dep = disabler()
103 if tflite_support_is_available
104 tflite_ver = tflite_support_deps[0].version()
105 tflite_ver_major = tflite_ver.split('.')[0]
106 tflite_ver_minor = tflite_ver.split('.')[1]
107 tflite_ver_micro = tflite_ver.split('.')[2]
109 tflite_ver_dep = declare_dependency (
111 '-DTFLITE_VERSION=' + tflite_ver,
112 '-DTFLITE_VERSION_MAJOR=' + tflite_ver_major,
113 '-DTFLITE_VERSION_MINOR=' + tflite_ver_minor,
114 '-DTFLITE_VERSION_MICRO=' + tflite_ver_micro,
117 message('TensorFlow-lite version: ' + tflite_ver)
119 if not get_option('skip-tflite-flatbuf-check') and not flatbuf_support_is_available
120 flatbuf_dep = dependency('flatbuffers', required : true, \
121 not_found_message : 'flatbuf devel package should be install to build the tensorflow lite subplugin.')
124 filter_sub_tflite_sources = ['tensor_filter_tensorflow_lite.cc']
126 nnstreamer_filter_tflite_deps = [tflite_support_deps, thread_dep, libdl_dep, glib_dep, nnstreamer_single_dep]
128 # Since tf-1.13, tflite has moved from contrib to core
129 tflite_h_prefix='#include <tensorflow/lite/model.h>'
130 if tflite_ver_minor.to_int() < 13
131 tflite_h_prefix='#include <tensorflow/contrib/lite/model.h>'
134 tflite_compile_args = ['-DTFLITE_SUBPLUGIN_NAME="tensorflow1-lite"']
135 if cxx.has_type('kTfLiteInt8', prefix : tflite_h_prefix)
136 tflite_compile_args += '-DTFLITE_INT8=1'
138 if cxx.has_type('kTfLiteInt16', prefix : tflite_h_prefix)
139 tflite_compile_args += '-DTFLITE_INT16=1'
141 if cxx.has_type('kTfLiteFloat16', prefix : tflite_h_prefix)
142 tflite_compile_args += '-DTFLITE_FLOAT16=1'
144 if cxx.has_type('kTfLiteComplex64', prefix : tflite_h_prefix)
145 tflite_compile_args += '-DTFLITE_COMPLEX64=1'
148 tflite_extra_dep = declare_dependency(
149 compile_args : tflite_compile_args
152 nnstreamer_filter_tflite_deps += tflite_extra_dep
153 nnstreamer_filter_tflite_deps += tflite_ver_dep
155 shared_library('nnstreamer_filter_tensorflow1-lite',
156 filter_sub_tflite_sources,
157 dependencies: nnstreamer_filter_tflite_deps,
159 install_dir: filter_subplugin_install_dir
162 static_library('nnstreamer_filter_tensorflow1-lite',
163 filter_sub_tflite_sources,
164 dependencies: nnstreamer_filter_tflite_deps,
166 install_dir: nnstreamer_libdir
170 tflite2_ver_dep = disabler()
171 if tflite2_support_is_available
172 tflite2_ver = tflite2_support_deps[0].version()
173 tflite2_ver_major = tflite2_ver.split('.')[0]
174 tflite2_ver_minor = tflite2_ver.split('.')[1]
175 tflite2_ver_micro = tflite2_ver.split('.')[2]
177 tflite2_ver_dep = declare_dependency (
179 '-DTFLITE_VERSION=' + tflite2_ver,
180 '-DTFLITE_VERSION_MAJOR=' + tflite2_ver_major,
181 '-DTFLITE_VERSION_MINOR=' + tflite2_ver_minor,
182 '-DTFLITE_VERSION_MICRO=' + tflite2_ver_micro,
185 message('TensorFlow2-lite version: ' + tflite2_ver)
187 # check flatbuffers header
188 ## Note that tizen tflite package has its own flatbuffers header internally.
189 if build_platform != 'tizen' and not cxx.check_header('flatbuffers/flatbuffers.h')
190 error('flatbuffers header files are required to build tensorflow2-lite subplugin. Please install compatible version for tensorflow-lite library. Or disable tflite2-support in meson_options.txt')
193 filter_sub_tflite2_sources = ['tensor_filter_tensorflow_lite.cc']
195 nnstreamer_filter_tflite2_deps = [tflite2_support_deps, thread_dep, libdl_dep, nnstreamer_single_dep]
197 tflite2_compile_args = []
198 tflite2_compile_args += '-DTFLITE_INT8=1'
199 tflite2_compile_args += '-DTFLITE_INT16=1'
200 tflite2_compile_args += '-DTFLITE_FLOAT16=1'
201 tflite2_compile_args += '-DTFLITE_COMPLEX64=1'
203 if cc.has_header('tensorflow2/lite/model.h')
204 tflite2_compile_args += '-DUSE_TENSORFLOW2_HEADER_PATH=1'
207 # Check each delegate linking with given tflite library
210 #include "tensorflow/lite/delegates/xnnpack/xnnpack_delegate.h"
211 TfLiteXNNPackDelegateOptions xnnpack_options = TfLiteXNNPackDelegateOptionsDefault ();
212 int main() {return 0;}
213 ''', dependencies : [tflite2_support_deps, thread_dep], name : 'xnnpack delegate')
214 tflite2_compile_args += '-DTFLITE_XNNPACK_DELEGATE_SUPPORTED'
219 #include "tensorflow/lite/delegates/gpu/delegate.h"
220 TfLiteGpuDelegateOptionsV2 gpu_options = TfLiteGpuDelegateOptionsV2Default ();
221 int main() {return 0;}
222 ''', dependencies : [tflite2_support_deps, libdl_dep], name : 'gpu delegate')
223 tflite2_compile_args += '-DTFLITE_GPU_DELEGATE_SUPPORTED'
228 #include "tensorflow/lite/delegates/nnapi/nnapi_delegate.h"
229 tflite::StatefulNnApiDelegate::StatefulNnApiDelegate ();
230 int main() {return 0;}
231 ''', dependencies : [tflite2_support_deps], name : 'nnapi delegate')
232 tflite2_compile_args += '-DTFLITE_NNAPI_DELEGATE_SUPPORTED'
237 #include "tensorflow/lite/delegates/external/external_delegate.h"
238 TfLiteExternalDelegateOptions external_options = TfLiteExternalDelegateOptionsDefault ("");
239 int main() {return 0;}
240 ''', dependencies : [tflite2_support_deps, libdl_dep], name : 'external delegate')
241 tflite2_compile_args += '-DTFLITE_EXTERNAL_DELEGATE_SUPPORTED'
244 tflite2_custom_compile_args = tflite2_compile_args
245 tflite2_compile_args += '-DTFLITE_SUBPLUGIN_NAME="tensorflow2-lite"'
247 tflite2_extra_dep = declare_dependency(
248 compile_args : tflite2_compile_args
251 nnstreamer_filter_tflite2_deps += tflite2_extra_dep
252 nnstreamer_filter_tflite2_deps += tflite2_ver_dep
254 shared_library('nnstreamer_filter_tensorflow2-lite',
255 filter_sub_tflite2_sources,
256 dependencies: nnstreamer_filter_tflite2_deps,
258 install_dir: filter_subplugin_install_dir
261 static_library('nnstreamer_filter_tensorflow2-lite',
262 filter_sub_tflite2_sources,
263 dependencies: nnstreamer_filter_tflite2_deps,
265 install_dir: nnstreamer_libdir
269 if (get_option('tflite2-custom-support').enabled() or get_option('tflite2-custom-support').auto()) and not meson.is_cross_build()
270 ## Create libtensorflow2-lite-custom.so support.
272 ## @todo This assumes the same tflite version with the above.
273 ## If the user has downloaded libtensorflow-lite manually, it may incur inconsistency.
274 ## @todo This does not use pkgconfig or find_library/meson-dep info
275 ## because it does not allow querying libpath and static/shared of a dependency object.
276 ## @todo If we are allowed to use meson > 0.53, use "FS" module!
279 join_paths(meson.current_source_dir(), 'libtensorflow2-lite.so'),
280 join_paths(meson.current_build_dir(), 'libtensorflow2-lite.so'),
281 join_paths(nnstreamer_libdir, 'libtensorflow2-lite.so'),
282 '/usr/lib/libtensorflow2-lite.so',
283 '/usr/lib64/libtensorflow2-lite.so',
284 './libtensorflow2-lite.so'
287 foreach file : filepaths
288 if run_command('bash', '-c', '[ -f "' + file + '" ]', check : false).returncode() == 0
289 message('Found: ' + file)
293 output: 'libtensorflow2-lite-custom.so',
301 ## No shared tfl lib found. Get static lib and convert it
302 custom_tflite_lib = join_paths(meson.current_build_dir(), 'libtensorflow2-lite-custom.so')
304 filepaths = [join_paths(nnstreamer_libdir, 'libtensorflow2-lite.a'),
305 '/usr/lib/libtensorflow2-lite.a',
306 '/usr/lib64/libtensorflow2-lite.a',
307 './libtensorflow2-lite.a',
308 join_paths(meson.current_build_dir(), 'libtensorflow2-lite.a'),
309 join_paths(meson.current_source_dir(), 'libtensorflow2-lite.a')
312 foreach file : filepaths
313 if run_command('bash', '-c', '[ -f "'+ file + '" ]', check : false).returncode() == 0
314 somake = run_command('gcc', '-shared', '-o', custom_tflite_lib, '-Wl,--whole-archive', file, '-Wl,--no-whole-archive', check : false)
315 if somake.returncode() == 0
316 message('Successfully created libtensorflow2-lite-custom.so from archive: ' + file)
320 error('Cannot create .so from: ' + file)
327 tflite2_custom_compile_args += '-DTFLITE_SUBPLUGIN_NAME="tensorflow2-lite-custom"'
328 tflite2_custom_extra_dep = declare_dependency( compile_args : tflite2_custom_compile_args )
329 tflc_dep = declare_dependency (
330 link_args: ['-L' + meson.current_build_dir(), '-ltensorflow2-lite-custom']
332 shared_library('nnstreamer_filter_tensorflow2-lite-custom',
333 filter_sub_tflite2_sources,
334 dependencies: [tflc_dep, thread_dep, libdl_dep, nnstreamer_single_dep, tflite2_ver_dep, tflite2_custom_extra_dep],
336 install_dir:filter_subplugin_install_dir
338 else # no custom mode built
339 if get_option('tflite2-custom-support').enabled()
340 error('Cannot create tflite2-custom tensor-filter subplugin. No valid .so/.a of tensorflow2-lite found.')
345 if get_option('tflite2-custom-support').enabled()
346 error('tflite2-custom-support requires tflite2-support')
350 if pytorch_support_is_available
351 if cxx.get_id() != 'gcc'
352 error('Pytorch headers (Array.h and reverse_iterator.h) require GCC for license issues. Use GCC or disable pytorch with -Dpytorch-support=disabled.')
355 filter_sub_torch_sources = ['tensor_filter_pytorch.cc']
356 # pytorch sources contain unused parameters
357 ignore_unused_params = declare_dependency(compile_args: ['-Wno-unused-parameter'])
358 pytorch_support_deps += ignore_unused_params
360 nnstreamer_filter_torch_deps = [pytorch_support_deps, nnstreamer_single_dep]
362 shared_library('nnstreamer_filter_pytorch',
363 filter_sub_torch_sources,
364 dependencies: nnstreamer_filter_torch_deps,
366 install_dir: filter_subplugin_install_dir
369 static_library('nnstreamer_filter_pytorch',
370 filter_sub_torch_sources,
371 dependencies: nnstreamer_filter_torch_deps,
373 install_dir: nnstreamer_libdir
377 if caffe2_support_is_available
378 filter_sub_caffe2_sources = ['tensor_filter_caffe2.cc']
380 nnstreamer_filter_caffe2_deps = [caffe2_support_deps, protobuf_dep, glib_dep, nnstreamer_single_dep]
382 shared_library('nnstreamer_filter_caffe2',
383 filter_sub_caffe2_sources,
384 dependencies: nnstreamer_filter_caffe2_deps,
386 install_dir: filter_subplugin_install_dir
389 static_library('nnstreamer_filter_caffe2',
390 filter_sub_caffe2_sources,
391 dependencies: nnstreamer_filter_caffe2_deps,
393 install_dir: nnstreamer_libdir
397 if deepview_rt_support_is_available
398 nnstreamer_filter_deepview_rt_deps = [deepview_rt_support_deps, glib_dep, nnstreamer_single_dep]
400 filter_sub_deepview_rt_sources = ['tensor_filter_deepview_rt.cc']
402 shared_library('nnstreamer_filter_deepview-rt',
403 filter_sub_deepview_rt_sources,
404 dependencies: nnstreamer_filter_deepview_rt_deps,
406 install_dir: filter_subplugin_install_dir
409 static_library('nnstreamer_filter_deepview-rt',
410 filter_sub_deepview_rt_sources,
411 dependencies: nnstreamer_filter_deepview_rt_deps,
413 install_dir: nnstreamer_libdir
418 filter_sub_python3_sources = ['tensor_filter_python3.cc']
420 shared_library('nnstreamer_filter_python3',
421 filter_sub_python3_sources,
422 dependencies: nnstreamer_python3_helper_dep,
424 install_dir: filter_subplugin_install_dir
427 static_library('nnstreamer_filter_python3',
428 filter_sub_python3_sources,
429 dependencies: nnstreamer_python3_helper_dep,
431 install_dir: nnstreamer_libdir
435 if mvncsdk2_support_is_available
436 filter_sub_mvncsdk2_sources = [
437 'tensor_filter_movidius_ncsdk2.c'
440 nnstreamer_filter_mvncsdk2_deps = [mvncsdk2_support_deps, glib_dep, nnstreamer_single_dep]
442 shared_library('nnstreamer_filter_movidius-ncsdk2',
443 filter_sub_mvncsdk2_sources,
444 dependencies: nnstreamer_filter_mvncsdk2_deps,
446 install_dir: filter_subplugin_install_dir
449 static_library('nnstreamer_filter_movidius-ncsdk2',
450 filter_sub_mvncsdk2_sources,
451 dependencies: nnstreamer_filter_mvncsdk2_deps,
453 install_dir: nnstreamer_libdir
457 if get_option('enable-cppfilter')
458 filter_sub_cpp_sources = ['tensor_filter_cpp.cc']
460 nnstreamer_cpp_lib = shared_library('nnstreamer_filter_cpp',
461 filter_sub_cpp_sources,
462 dependencies: nnstreamer_single_dep,
464 install_dir: filter_subplugin_install_dir
466 install_headers(['tensor_filter_cpp.hh'],
469 configure_file(input: 'nnstreamer-cpp.pc.in', output: 'nnstreamer-cpp.pc',
470 install_dir: join_paths(nnstreamer_libdir, 'pkgconfig'),
471 configuration: nnstreamer_install_conf
473 nnstreamer_cpp_dep = declare_dependency(link_with: nnstreamer_cpp_lib,
474 dependencies: nnstreamer_single_dep,
475 include_directories: include_directories('.')
479 if get_option('enable-edgetpu')
480 if not get_option('enable-filter-cpp-class')
481 error ('enable-filter-cpp-class should be set as \'true\' to build the tensor filter for Edge TPU.')
484 edgetpu_dep = dependency('edgetpu', required: false)
485 if not edgetpu_dep.found()
486 # Since the developement package for Ubuntu does not have pkgconfig file,
487 # check that the required header and library files exist in the system
488 # include and lib directories.
489 if cxx.has_header('edgetpu.h')
490 edgetpu_dep = declare_dependency (
491 dependencies: cxx.find_library('edgetpu'),
494 error('failed to resolve the build dependency of the tensor filter for Edge TPU.')
498 nnstreamer_filter_edgetpu_deps = [glib_dep, nnstreamer_single_dep, edgetpu_dep, libdl_dep]
500 if tflite2_support_is_available
501 nnstreamer_filter_edgetpu_deps += [tflite2_support_deps, tflite2_ver_dep]
502 message('build Edge TPU sub-plugin with tensorflow2-lite')
503 elif tflite_support_is_available
504 nnstreamer_filter_edgetpu_deps += [tflite_support_deps, tflite_ver_dep]
505 message('build Edge TPU sub-plugin with tensorflow1-lite')
507 error ('tflite2-support or tflite-support should be set as \'enabled\' to build the tensor filter for Edge TPU.')
510 filter_sub_edgetpu_sources = ['tensor_filter_edgetpu.cc']
512 rpath_edgetpu_test_helper = ''
513 if get_option('enable-test')
515 In order to use the test helper library, add build_rpath.
516 This temporarily overrides the runtime dependency on edge tpu and
517 it is removed after installation.
519 rpath_edgetpu_test_helper = join_paths(meson.build_root(), 'tests/nnstreamer_filter_edgetpu')
522 shared_library('nnstreamer_filter_edgetpu',
523 filter_sub_edgetpu_sources,
524 dependencies: nnstreamer_filter_edgetpu_deps,
526 install_dir: filter_subplugin_install_dir,
527 build_rpath: rpath_edgetpu_test_helper
531 if get_option('enable-openvino')
533 openvino_cpp_args = []
534 openvino_deps += dependency('openvino', required: true)
535 if cxx.has_header('ext_list.hpp')
536 openvino_cpuext_lib = cxx.find_library('cpu_extension', required: true)
537 if openvino_cpuext_lib.found()
538 openvino_cpp_args += '-D__OPENVINO_CPU_EXT__=1'
539 openvino_deps += openvino_cpuext_lib
541 error('Cannot find the shared object, libcpu_extension.')
544 filter_sub_openvino_sources = ['tensor_filter_openvino.cc']
546 nnstreamer_filter_openvino_deps = [glib_dep, nnstreamer_single_dep, openvino_deps]
548 nnstreamer_filter_openvino_so_lib = shared_library('nnstreamer_filter_openvino',
549 filter_sub_openvino_sources,
550 cpp_args: openvino_cpp_args,
551 dependencies: nnstreamer_filter_openvino_deps,
553 install_dir: filter_subplugin_install_dir
556 static_library('nnstreamer_filter_openvino',
557 filter_sub_openvino_sources,
558 cpp_args: openvino_cpp_args,
559 dependencies: nnstreamer_filter_openvino_deps,
561 install_dir: nnstreamer_libdir
564 nnstreamer_filter_openvino_dep = declare_dependency(
565 link_with: nnstreamer_filter_openvino_so_lib,
566 include_directories: include_directories('.')
570 if get_option('enable-vivante')
574 if get_option('enable-mediapipe')
575 if host_machine.system() == 'linux' and host_machine.cpu_family() == 'x86_64'
576 opencv_path = 'bazel-bin/_solib_k8/_U@linux_Uopencv_S_S_Copencv___Uexternal_Slinux_Uopencv_Slib_Sx86_U64-linux-gnu'
578 error('Not Supported System & Architecture. Linux x86_64 is required')
581 cmd = run_command('sh', '-c', 'echo $MEDIAPIPE_HOME', check : true)
582 MEDIAPIPE_HOME = cmd.stdout().strip()
583 if MEDIAPIPE_HOME == ''
584 error('MEDIAPIPE_HOME is not set')
586 message('MEDIAPIPE_HOME: ' + MEDIAPIPE_HOME)
587 # TODO: This is not a portable way to check if a directory exists
588 # After bumping up to 0.53.0, the following line can be replaced with one that uses FS module
589 mediapipe_dir_exist = run_command('[', '-d', MEDIAPIPE_HOME, ']', check : false).returncode()
590 if mediapipe_dir_exist != 0
591 error('Cannot find MEDIAPIPE_HOME: ' + MEDIAPIPE_HOME)
594 mediapipe_incdir = include_directories(
596 join_paths(MEDIAPIPE_HOME, 'bazel-bin'),
597 join_paths(MEDIAPIPE_HOME, 'bazel-mediapipe/external/eigen_archive'),
598 join_paths(MEDIAPIPE_HOME, 'bazel-mediapipe/external/com_google_absl'),
601 run_command('sh', '-c', meson.source_root() + '/tools/development/gen_mediapipe_libs.sh ' + nnstreamer_libdir, check : true)
603 mediapipe_internal_dep = cxx.find_library('mediapipe_internal', dirs: nnstreamer_libdir)
604 mediapipe_external_dep = cxx.find_library('mediapipe_external', dirs: nnstreamer_libdir)
606 opencv_core_dep = cc.find_library('opencv_core', dirs: join_paths(MEDIAPIPE_HOME, opencv_path))
607 opencv_video_dep = cc.find_library('opencv_video', dirs: join_paths(MEDIAPIPE_HOME, opencv_path))
608 opencv_imgcodecs_dep = cc.find_library('opencv_imgcodecs', dirs: join_paths(MEDIAPIPE_HOME, opencv_path))
609 opencv_imgproc_dep = cc.find_library('opencv_imgproc', dirs: join_paths(MEDIAPIPE_HOME, opencv_path))
610 opencv_calib3d_dep = cc.find_library('opencv_calib3d', dirs: join_paths(MEDIAPIPE_HOME, opencv_path))
611 opencv_highgui_dep = cc.find_library('opencv_highgui', dirs: join_paths(MEDIAPIPE_HOME, opencv_path))
612 opencv_videoio_dep = cc.find_library('opencv_videoio', dirs: join_paths(MEDIAPIPE_HOME, opencv_path))
613 opencv_features2d_dep = cc.find_library('opencv_features2d', dirs: join_paths(MEDIAPIPE_HOME, opencv_path))
615 nnstreamer_filter_mediapipe_deps = [
617 nnstreamer_single_dep,
620 opencv_imgcodecs_dep,
625 opencv_features2d_dep,
626 mediapipe_external_dep,
627 mediapipe_internal_dep
630 filter_sub_mp_sources = ['tensor_filter_mediapipe.cc']
632 shared_library('nnstreamer_filter_mediapipe',
633 filter_sub_mp_sources,
634 dependencies: nnstreamer_filter_mediapipe_deps,
635 include_directories: mediapipe_incdir,
637 install_dir: filter_subplugin_install_dir
641 if snpe_support_is_available
642 filter_sub_snpe_sources = ['tensor_filter_snpe.cc']
643 nnstreamer_filter_snpe_deps = [glib_dep, nnstreamer_single_dep, snpe_support_deps, declare_dependency(compile_args: ['-Wno-deprecated-declarations'])]
645 shared_library('nnstreamer_filter_snpe',
646 filter_sub_snpe_sources,
647 dependencies: nnstreamer_filter_snpe_deps,
649 install_dir: filter_subplugin_install_dir
652 static_library('nnstreamer_filter_snpe',
653 filter_sub_snpe_sources,
654 dependencies: nnstreamer_filter_snpe_deps,
656 install_dir: nnstreamer_libdir
660 if tensorrt_support_is_available
661 filter_sub_tensorrt_sources = ['tensor_filter_tensorrt.cc']
663 nnstreamer_filter_tensorrt_deps = [glib_dep, nnstreamer_single_dep, tensorrt_support_deps]
665 shared_library('nnstreamer_filter_tensorrt',
666 filter_sub_tensorrt_sources,
667 dependencies: nnstreamer_filter_tensorrt_deps,
669 install_dir: filter_subplugin_install_dir
672 static_library('nnstreamer_filter_tensorrt',
673 filter_sub_tensorrt_sources,
674 dependencies: nnstreamer_filter_tensorrt_deps,
676 install_dir: nnstreamer_libdir
680 if lua_support_is_available
681 if lua_support_deps[0].version().version_compare('>=5.3')
682 message ('tensor-filter::lua does not support Lua >= 5.3, yet. Fix #3531 first.')
683 lua_support_is_available = disabler()
687 if lua_support_is_available
688 filter_sub_lua_sources = ['tensor_filter_lua.cc']
690 nnstreamer_filter_lua_deps = [glib_dep, nnstreamer_single_dep, lua_support_deps]
692 shared_library('nnstreamer_filter_lua',
693 filter_sub_lua_sources,
694 dependencies: nnstreamer_filter_lua_deps,
696 install_dir: filter_subplugin_install_dir
699 static_library('nnstreamer_filter_lua',
700 filter_sub_lua_sources,
701 dependencies: nnstreamer_filter_lua_deps,
703 install_dir: nnstreamer_libdir
707 if tvm_support_is_available
708 nnstreamer_filter_tvm_deps = [tvm_support_deps, glib_dep, nnstreamer_dep]
710 filter_sub_tvm_sources = ['tensor_filter_tvm.cc']
712 shared_library('nnstreamer_filter_tvm',
713 filter_sub_tvm_sources,
714 dependencies: nnstreamer_filter_tvm_deps,
716 install_dir: filter_subplugin_install_dir
719 static_library('nnstreamer_filter_tvm',
720 filter_sub_tvm_sources,
721 dependencies: nnstreamer_filter_tvm_deps,
723 install_dir: nnstreamer_libdir
727 if trix_engine_support_is_available
728 nnstreamer_filter_trix_engine_deps = [trix_engine_support_deps, glib_dep, nnstreamer_single_dep]
730 filter_sub_trix_engine_sources = ['tensor_filter_trix_engine.cc']
732 shared_library('nnstreamer_filter_trix-engine',
733 filter_sub_trix_engine_sources,
734 dependencies: nnstreamer_filter_trix_engine_deps,
736 install_dir: filter_subplugin_install_dir
739 static_library('nnstreamer_filter_trix-engine',
740 filter_sub_trix_engine_sources,
741 dependencies: nnstreamer_filter_trix_engine_deps,
743 install_dir: nnstreamer_libdir
747 if mxnet_support_is_available
748 if not get_option('enable-filter-cpp-class')
749 error ('enable-filter-cpp-class should be set as \'true\' to build the tensor filter for MXNet.')
752 filter_sub_mxnet_sources = [
753 'tensor_filter_mxnet.cc'
756 nnstreamer_filter_mxnet_deps = [mxnet_support_deps, glib_dep, nnstreamer_single_dep, libdl_dep]
758 nnstreamer_filter_mxnet_so_lib = shared_library('nnstreamer_filter_mxnet',
759 filter_sub_mxnet_sources,
760 dependencies: nnstreamer_filter_mxnet_deps,
762 install_dir: filter_subplugin_install_dir,
763 cpp_args: ['-Wno-non-virtual-dtor']
766 nnstreamer_filter_mxnet_dep = declare_dependency(
767 link_with: nnstreamer_filter_mxnet_so_lib,
768 include_directories: include_directories('.')
772 if ncnn_support_is_available
773 filter_sub_ncnn_sources = ['tensor_filter_ncnn.cc']
775 nnstreamer_filter_ncnn_deps = [ncnn_support_deps, glib_dep, nnstreamer_single_dep]
777 shared_library('nnstreamer_filter_ncnn',
778 filter_sub_ncnn_sources,
779 dependencies: nnstreamer_filter_ncnn_deps,
781 install_dir: filter_subplugin_install_dir
784 static_library('nnstreamer_filter_ncnn',
785 filter_sub_ncnn_sources,
786 dependencies: nnstreamer_filter_ncnn_deps,
788 install_dir: nnstreamer_libdir
792 if onnxruntime_support_is_available
793 filter_sub_onnxruntime_sources = ['tensor_filter_onnxruntime.cc']
795 nnstreamer_filter_onnxruntime_deps = [glib_dep, nnstreamer_single_dep, onnxruntime_support_deps]
797 shared_library('nnstreamer_filter_onnxruntime',
798 filter_sub_onnxruntime_sources,
799 dependencies: nnstreamer_filter_onnxruntime_deps,
801 install_dir: filter_subplugin_install_dir
804 static_library('nnstreamer_filter_onnxruntime',
805 filter_sub_onnxruntime_sources,
806 dependencies: nnstreamer_filter_onnxruntime_deps,
808 install_dir: nnstreamer_libdir