-
if have_tensorflow
- tensor_filter_tfcore_lib_shared = shared_library('nnstreamer_filter_tensorflow',
- [
- 'tensor_filter_tensorflow_core.cc',
- 'tensor_filter_tensorflow.c'
- ],
+ nnstreamer_filter_tf_sources = [
+ 'tensor_filter_tensorflow.c',
+ 'tensor_filter_tensorflow_core.cc'
+ ]
+
+ nnstreamer_filter_tf_deps = [tf_dep, protobuf_dep, glib_dep, gst_dep, nnstreamer_dep]
+
+ shared_library('nnstreamer_filter_tensorflow',
+ nnstreamer_filter_tf_sources,
cpp_args: ['-Wno-sign-compare'],
- dependencies: [tf_dep, protobuf_dep, nnstreamer_dep],
- include_directories: nnstreamer_inc,
+ dependencies: nnstreamer_filter_tf_deps,
install: true,
- install_dir: join_paths(subplugin_install_prefix, 'filters')
+ install_dir: filter_subplugin_install_dir
)
- tensor_filter_tfcore_lib_static = static_library('nnstreamer_filter_tensorflow',
- [
- 'tensor_filter_tensorflow_core.cc',
- 'tensor_filter_tensorflow.c'
- ],
+ static_library('nnstreamer_filter_tensorflow',
+ nnstreamer_filter_tf_sources,
cpp_args: ['-Wno-sign-compare'],
- dependencies: [tf_dep, protobuf_dep, nnstreamer_dep],
- include_directories: nnstreamer_inc,
+ dependencies: nnstreamer_filter_tf_deps,
install: true,
install_dir: nnstreamer_libdir
)
endif
if have_tensorflow_lite
- tensor_filter_tflitecore_lib_shared = shared_library('nnstreamer_filter_tensorflow-lite',
- [
- 'tensor_filter_tensorflow_lite_core.cc',
- 'tensor_filter_tensorflow_lite.c'
- ],
+ nnstreamer_filter_tflite_sources = [
+ 'tensor_filter_tensorflow_lite.c',
+ 'tensor_filter_tensorflow_lite_core.cc'
+ ]
+
+ nnstreamer_filter_tflite_deps = [tflite_dep, thread_dep, libdl_dep, glib_dep, gst_dep, nnstreamer_dep]
+
+ shared_library('nnstreamer_filter_tensorflow-lite',
+ nnstreamer_filter_tflite_sources,
cpp_args: ['-Wno-sign-compare'],
- dependencies: [tflite_dep, nnstreamer_dep],
- include_directories: nnstreamer_inc,
+ dependencies: nnstreamer_filter_tflite_deps,
install: true,
- install_dir: join_paths(subplugin_install_prefix, 'filters')
+ install_dir: filter_subplugin_install_dir
)
- tensor_filter_tflitecore_lib_static = static_library('nnstreamer_filter_tensorflow-lite',
- [
- 'tensor_filter_tensorflow_lite_core.cc',
- 'tensor_filter_tensorflow_lite.c'
- ],
+ static_library('nnstreamer_filter_tensorflow-lite',
+ nnstreamer_filter_tflite_sources,
cpp_args: ['-Wno-sign-compare'],
- dependencies: [tflite_dep, nnstreamer_dep],
- include_directories: nnstreamer_inc,
+ dependencies: nnstreamer_filter_tflite_deps,
install: true,
install_dir: nnstreamer_libdir
)
tf_data *tf;
tf = *private_data;
g_assert (*private_data);
- int ret = tf_core_getInputDim (tf->tf_private_data, info);
- return ret;
+ return tf_core_getInputDim (tf->tf_private_data, info);
}
/**
tf_data *tf;
tf = *private_data;
g_assert (*private_data);
- int ret = tf_core_getOutputDim (tf->tf_private_data, info);
- return ret;
+ return tf_core_getOutputDim (tf->tf_private_data, info);
}
/**
* @bug No known bugs.
*/
+#include <nnstreamer_plugin_api.h>
#include "tensor_filter_tensorflow_core.h"
/**
{
model_path = _model_path;
- memset (&inputTensorMeta, 0, sizeof (GstTensorsInfo));
- memset (&outputTensorMeta, 0, sizeof (GstTensorsInfo));
+ gst_tensors_info_init (&inputTensorMeta);
+ gst_tensors_info_init (&outputTensorMeta);
for (int i = 0; i < NNS_TENSOR_SIZE_LIMIT; ++i) {
inputTensorRank[i] = 0;
*
* @bug No known bugs.
*/
-#ifndef TENSOR_FILTER_TENSORFLOW_H
-#define TENSOR_FILTER_TENSORFLOW_H
+#ifndef TENSOR_FILTER_TENSORFLOW_CORE_H
+#define TENSOR_FILTER_TENSORFLOW_CORE_H
#include <tensor_typedef.h>
}
#endif
-#endif
+#endif /* TENSOR_FILTER_TENSORFLOW_CORE_H */
tflite_data *tf;
tf = *private_data;
g_assert (*private_data);
- int ret = tflite_core_getInputDim (tf->tflite_private_data, info);
- return ret;
+ return tflite_core_getInputDim (tf->tflite_private_data, info);
}
/**
tflite_data *tf;
tf = *private_data;
g_assert (*private_data);
- int ret = tflite_core_getOutputDim (tf->tflite_private_data, info);
- return ret;
+ return tflite_core_getOutputDim (tf->tflite_private_data, info);
}
GstTensorFilterFramework NNS_support_tensorflow_lite = {
#include <unistd.h>
#include <algorithm>
+#include <nnstreamer_plugin_api.h>
#include "tensor_filter_tensorflow_lite_core.h"
/**
{
model_path = _model_path;
- memset (&inputTensorMeta, 0, sizeof (GstTensorsInfo));
- memset (&outputTensorMeta, 0, sizeof (GstTensorsInfo));
+ gst_tensors_info_init (&inputTensorMeta);
+ gst_tensors_info_init (&outputTensorMeta);
}
/**
*
* @bug No known bugs.
*/
-#ifndef TENSOR_FILTER_TENSORFLOW_LITE_H
-#define TENSOR_FILTER_TENSORFLOW_LITE_H
+#ifndef TENSOR_FILTER_TENSORFLOW_LITE_CORE_H
+#define TENSOR_FILTER_TENSORFLOW_LITE_CORE_H
+
+#include <tensor_typedef.h>
#ifdef __cplusplus
#include <iostream>
#include <tensorflow/contrib/lite/string_util.h>
#include <tensorflow/contrib/lite/kernels/register.h>
-#include <tensor_typedef.h>
-
/**
* @brief ring cache structure
*/
}
#endif
-#endif
+#endif /* TENSOR_FILTER_TENSORFLOW_LITE_CORE_H */
nnstreamer_base_deps += [orc_dep]
endif
-# For extra dependencies (subplugins, filters)
-# Remove this after ext subplugins migration
-nnstreamer_extra_deps = []
-
# Internal dependencies
nnstreamer_internal_deps = []
'nnstreamer.c',
'nnstreamer_conf.c',
'nnstreamer_subplugin.c',
+ 'nnstreamer_plugin_api.c',
'tensor_common.c',
'tensor_repo.c'
]
nnstreamer_sources += join_paths(meson.current_source_dir(), s)
endforeach
-# Add nnstreamer API plugin sources
-nnst_plugin_api_sources = [
- 'nnstreamer_plugin_api.c'
-]
-
-foreach s : nnst_plugin_api_sources
- nnstreamer_sources += join_paths(meson.current_source_dir(), s)
-endforeach
-
# Common headers to be installed
nnst_common_headers = [
'tensor_typedef.h',
# Build libraries ("both_libraries" are supported from 0.46.)
nnstreamer_shared = shared_library('nnstreamer',
nnstreamer_sources,
- dependencies: [nnstreamer_base_deps, nnstreamer_extra_deps],
+ dependencies: nnstreamer_base_deps,
include_directories: nnstreamer_inc,
install: true,
install_dir: plugins_install_dir
nnstreamer_static = static_library('nnstreamer',
nnstreamer_sources,
- dependencies: [nnstreamer_base_deps, nnstreamer_extra_deps],
+ dependencies: nnstreamer_base_deps,
include_directories: nnstreamer_inc,
install: true,
install_dir: nnstreamer_libdir
g_free_const (filter->prop.fwname); \
filter->prop.fwname = NULL; \
filter->fw = NULL; \
+ filter->privateData = NULL; \
} \
} while (0)
/**
- * GStreamer Tensor_Filter, Tensorflow-Lite Module
+ * GStreamer Tensor_Filter Module
* Copyright (C) 2018 MyungJoo Ham <myungjoo.ham@samsung.com>
*
* This library is free software; you can redistribute it and/or
*/
struct _internal_data
{
- GstTensorFilter *parent;
-
void *handle;
NNStreamer_custom_class *methods;
ptr = g_new0 (internal_data, 1); /* Fill Zero! */
*private_data = ptr;
- ptr->parent = GstTensorFilter_of_privateData (private_data);
/* Load .so if this is the first time for this instance. */
ptr->handle = dlopen (prop->model_file, RTLD_NOW);
int retval = custom_loadlib (prop, private_data);
internal_data *ptr;
- /* Actually, tensor_filter must have called getInput/OotputDim first. */
+ /* Actually, tensor_filter must have called getInput/OutputDim first. */
g_assert (retval == 1);
g_assert (*private_data);
ptr = *private_data;
* @brief Tensor_Filter Subplugin definition
*
* Common callback parameters:
- * filter Filter properties. Read Only
- * private_data Subplugin's private data. Set this (*private_data = XXX) if you want to change filter->private_data
+ * prop Filter properties. Read Only.
+ * private_data Subplugin's private data. Set this (*private_data = XXX) if you want to change filter->private_data.
*/
typedef struct _GstTensorFilterFramework
{
int (*setInputDimension) (const GstTensorFilterProperties * prop,
void **private_data, const GstTensorsInfo * in_info,
GstTensorsInfo * out_info);
- /**< Optional. Set Null if not supported. Tensor_filter::main will
+ /**< Optional. Set Null if not supported. Tensor_Filter::main will
* configure input dimension from pad-cap in run-time for the sub-plugin.
* Then, the sub-plugin is required to return corresponding output dimension
* If this is NULL, both getInput/OutputDimension must be non-NULL.
nnstreamer_includedir = join_paths(nnstreamer_prefix, get_option('includedir'))
nnstreamer_inidir = get_option('sysconfdir')
-libs_install_dir = nnstreamer_libdir
+# nnstreamer plugins path
plugins_install_dir = join_paths(nnstreamer_libdir, 'gstreamer-' + gst_api_verision)
-subplugins_install_dir = nnstreamer_libdir
-examples_install_dir = nnstreamer_bindir
# nnstreamer sub-plugins path
subplugin_install_prefix = join_paths(nnstreamer_prefix, 'lib', 'nnstreamer')
+filter_subplugin_install_dir = join_paths(subplugin_install_prefix, 'filters')
+decoder_subplugin_install_dir = join_paths(subplugin_install_prefix, 'decoders')
customfilter_install_dir = join_paths(subplugin_install_prefix, 'customfilters')
nnstreamer_conf.set('PREFIX', nnstreamer_prefix)
nnstreamer_conf.set('EXEC_PREFIX', nnstreamer_bindir)
-nnstreamer_conf.set('LIB_INSTALL_DIR', libs_install_dir)
+nnstreamer_conf.set('LIB_INSTALL_DIR', nnstreamer_libdir)
nnstreamer_conf.set('GST_INSTALL_DIR', plugins_install_dir)
nnstreamer_conf.set('INCLUDE_INSTALL_DIR', nnstreamer_includedir)
nnstreamer_conf.set('SUBPLUGIN_INSTALL_PREFIX', subplugin_install_prefix)
# Install .pc
configure_file(input: 'nnstreamer.pc.in', output: 'nnstreamer.pc',
install: true,
- install_dir: join_paths(libs_install_dir, 'pkgconfig'),
+ install_dir: join_paths(nnstreamer_libdir, 'pkgconfig'),
configuration: nnstreamer_conf
)
mkdir -p build
%ifarch x86_64 aarch64
- meson --buildtype=plain --werror --prefix=%{_prefix} --sysconfdir=%{_sysconfdir} --libdir=%{_libdir} --bindir=%{nnstexampledir} --includedir=%{_includedir} -Dinstall-example=true build
+enable_tf=true
%else
- meson --buildtype=plain --werror --prefix=%{_prefix} --sysconfdir=%{_sysconfdir} --libdir=%{_libdir} --bindir=%{nnstexampledir} --includedir=%{_includedir} -Dinstall-example=true -Denable-tensorflow=false build
+enable_tf=false
%endif
+meson --buildtype=plain --werror --prefix=%{_prefix} --sysconfdir=%{_sysconfdir} --libdir=%{_libdir} --bindir=%{nnstexampledir} --includedir=%{_includedir} -Dinstall-example=true -Denable-tensorflow=${enable_tf} build
+
ninja -C build %{?_smp_mflags}
%if 0%{?unit_test}