platform/upstream/nnstreamer.git
4 years ago[LF/AI] Remove Samsung Proprietary/Confidential notice
jijoong.moon [Mon, 23 Mar 2020 03:20:58 +0000 (12:20 +0900)]
[LF/AI] Remove Samsung Proprietary/Confidential notice

Remove Samsung Proprietary / Confidentail Notice in Document MD.

**Self evaluation:**
1. Build test:  [X]Passed [ ]Failed [ ]Skipped
2. Run test:  [X]Passed [ ]Failed [ ]Skipped

Signed-off-by: jijoong.moon <jijoong.moon@samsung.com>
4 years agoFix coding style
jijoong.moon [Mon, 23 Mar 2020 04:24:44 +0000 (13:24 +0900)]
Fix coding style

Fix coding style

**Self evaluation:**
1. Build test:  [X]Passed [ ]Failed [ ]Skipped
2. Run test:  [X]Passed [ ]Failed [ ]Skipped

Signed-off-by: jijoong.moon <jijoong.moon@samsung.com>
4 years ago[Filter] Frame work autodetection priority
gichan-jang [Tue, 10 Mar 2020 09:20:51 +0000 (18:20 +0900)]
[Filter] Frame work autodetection priority
Set default priority of framework for same file extension

Signed-off-by: gichan-jang <gichan2.jang@samsung.com>
4 years ago[Coverity/1123909] Fix ALLOC-FREE-MISMATCH
MyungJoo Ham [Fri, 20 Mar 2020 05:04:07 +0000 (14:04 +0900)]
[Coverity/1123909] Fix ALLOC-FREE-MISMATCH

Coverity complains about malloc-gfree pair. Then, pacify it by
using g_malloc-gfree pair.

Fixes: CID 1123909 (#1 of 1): Incorrect deallocator used (ALLOC_FREE_MISMATCH)
12. free: Calling g_free frees scan_el_data using g_free but it should have been freed using free.

Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
4 years ago[AHUB/523198] Fix null pointer dereferencing
MyungJoo Ham [Fri, 20 Mar 2020 04:41:53 +0000 (13:41 +0900)]
[AHUB/523198] Fix null pointer dereferencing

This fixes:
WID:16646516 After having been compared to NULL value at tensor_filter_common.c:773, pointer 'priv->fw' is dereferenced at tensor_filter_common.c:791.

Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
4 years ago[Android/Build] clean build script
Jaeyun [Thu, 12 Mar 2020 11:20:19 +0000 (20:20 +0900)]
[Android/Build] clean build script

1. add flag to disable tf-lite.
2. update build script for each build option.

Signed-off-by: Jaeyun <jy1210.jung@samsung.com>
4 years ago[Api/Single] add property key custom
Jaeyun [Wed, 11 Mar 2020 03:46:31 +0000 (12:46 +0900)]
[Api/Single] add property key custom

update function to set/get the custom property from filter.

Signed-off-by: Jaeyun <jy1210.jung@samsung.com>
4 years ago[Tests/Filter/Reload] Check existence of TFLite filters before start accepted/tizen/unified/20200320.074747 submit/tizen/20200319.093556
Wook Song [Tue, 17 Mar 2020 09:59:29 +0000 (18:59 +0900)]
[Tests/Filter/Reload] Check existence of TFLite filters before start

The test cases for reload models require the tensor filter extension for
Tensorflow Lite. As other test cases do, this patch adds a procedure
that checks existence of the tensorflow-lite filters before starting the
test.

Signed-off-by: Wook Song <wook16.song@samsung.com>
4 years ago[AHUB/430098] Fix typing errors
MyungJoo Ham [Thu, 19 Mar 2020 03:35:32 +0000 (12:35 +0900)]
[AHUB/430098] Fix typing errors

With LINE 1982, we had:
WID:16576305 An integer overflow may occur due to arithmetic operation (multiplication) between values '2' and '4294967295', where the first value comes from the expression 'i + 1' and the second value comes from the expression '-1'

Fix similar issues as well.

Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
4 years ago[AHUB/430155] Remove unreachable code
MyungJoo Ham [Thu, 19 Mar 2020 03:40:19 +0000 (12:40 +0900)]
[AHUB/430155] Remove unreachable code

Fix the AHUB issue:
WID:16576318 This statement in the source code might be unreachable during program execution.

Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
4 years agoNew Filter Subplugin Interface Draft: C++ support
MyungJoo Ham [Wed, 15 Jan 2020 06:51:39 +0000 (15:51 +0900)]
New Filter Subplugin Interface Draft: C++ support

With this, developers can write a C++ class to create
a tensor_filter subplugin without writing the duplicated
C codes.

Changes in V2:
- Redesigned the whole classes
- Applied the recent changes of #2072
Changes in V3:
- Re-redesigned the whole class.
- Build tested without subplugins
Changes in V4:
- Elaborated doxygen entries.
Changes in V5:
- Fixed comment typos
- Use references instead of pointers for parameters of C++ virtual functions.

Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
4 years ago[API/Single] Elaborate error logs of ml_single_invoke
Yongjoo Ahn [Mon, 9 Mar 2020 02:18:35 +0000 (11:18 +0900)]
[API/Single] Elaborate error logs of ml_single_invoke

Add error logs for input tensor size mismatching cases.

Signed-off-by: Yongjoo Ahn <yongjoo1.ahn@samsung.com>
4 years ago[TestCase] Count negative cases of SSAT results
MyungJoo Ham [Mon, 16 Mar 2020 10:41:32 +0000 (19:41 +0900)]
[TestCase] Count negative cases of SSAT results

Count negative cases of SSAT.
Print the sum of negative cases of Gtest and SSAT at the end.

This requires updates of SSAT (1.1.0)

Fixes #2150

Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
4 years ago[filter] Support get and set properties
Parichay Kapoor [Fri, 21 Feb 2020 08:59:31 +0000 (17:59 +0900)]
[filter] Support get and set properties

Support get and set properties for GstTensorFilterFramework V1.
Updated GstTensorFilterFramework to include number of accelerators supported along with its list.

V2:
Added updating the properties
Corrected string comparison
replaced : else -> else if (GST_TF_FW_V1)
Updating properties which required caps renegotiation have been delayed
Added support for updating custom properties in eventHandler

V3:
Replaced asserts with critical logs
Added more comments for eventHandler return values

Signed-off-by: Parichay Kapoor <pk.kapoor@samsung.com>
4 years ago[Src/IIO] property to set base dir
Jaeyun [Tue, 10 Mar 2020 09:01:37 +0000 (18:01 +0900)]
[Src/IIO] property to set base dir

Add properties to set base dir for IIO devices, and update testcases.

Signed-off-by: Jaeyun <jy1210.jung@samsung.com>
4 years ago[AHUB/434790] Fix dereferencing null pointer
MyungJoo Ham [Wed, 18 Mar 2020 10:11:43 +0000 (19:11 +0900)]
[AHUB/434790] Fix dereferencing null pointer

Even with GST_STR_NULL, if the dereferenced pointer is null,
we will be doing NULLPTR[0], which may incur segmentation faults.

Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
4 years ago[Filter/Conf] use gmodule to open so file
Jaeyun [Fri, 13 Mar 2020 11:52:04 +0000 (20:52 +0900)]
[Filter/Conf] use gmodule to open so file

use gmodule to open and load sub-plugins.

Signed-off-by: Jaeyun <jy1210.jung@samsung.com>
4 years agoStart development of 1.5.1 as 1.6.0-RC2 accepted/tizen/unified/20200318.130449 submit/tizen/20200318.051741
MyungJoo Ham [Wed, 18 Mar 2020 01:24:53 +0000 (10:24 +0900)]
Start development of 1.5.1 as 1.6.0-RC2

Changes during 1.5.0:

1.5.0 -> 1.5.1
        - Filter subplugin APIs updated. Both V0 (minor changes to the conventional) and V1 (refactored API set) are supported.
        - Fixed major issue: now, each instance of a filter subplugin may have different property values.
        - Tizen 6.0 API ACR preparations
        - Allow to build Single-API-only Android build for minimal ML-API usage.
        - Compatibility fix for GStreamer 1.16; Gst 1.16 has additional audit that blacklists behaviors of older NNStreamer.
        - Met Linux Foundation / AI requirements (policy files)
        - Compatibility fix for LLVM/Clang and macOS.

        - Verisilicon-Vivante: Vivante is supported with private proprietary plugin. There was a minor infratstructural updates to assist it. We will work on opening this code; we may need assistance from Verisilicon (they need to open source a few headers for general public to build Vivante-subplugin.)
        - TensorFlow-lite: recently added data types of Tensorflow-lite is supported.
        - OpenVINO/Caffe2/Tensorflow/NNFW/NCSDK2/ARMNN/Python: refactored hardware acceleration options.

        - Fixed issues found by static analyzers.
        - Added unit tests to widen coverages and to test exception cases.

Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
4 years ago[AHUB/430058] Fix unitialized local variable
MyungJoo Ham [Wed, 18 Mar 2020 04:18:36 +0000 (13:18 +0900)]
[AHUB/430058] Fix unitialized local variable

WID:16576294 Uninitialized data is read from local variable 'status' at tensor_filter_tensorflow_lite.cc:474.

Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
4 years ago[Filter/Sub] preserved name
Jaeyun [Mon, 16 Mar 2020 10:37:53 +0000 (19:37 +0900)]
[Filter/Sub] preserved name

do not allow 'auto' as subplugin name.

Signed-off-by: Jaeyun <jy1210.jung@samsung.com>
4 years agoRevert "[tflite] optimize invoke critical path"
Yongjoo Ahn [Tue, 17 Mar 2020 06:18:03 +0000 (15:18 +0900)]
Revert "[tflite] optimize invoke critical path"

This reverts commit 18770da6d35497d35d6cd39f11af6f2150fe8d7e.
The location of input/output buffers are not static when the tflite model has multi-tensor output.

Signed-off-by: Yongjoo Ahn <yongjoo1.ahn@samsung.com>
4 years ago[Test/tflite] Add ssat test for multi-tensor output tflite model
Yongjoo Ahn [Thu, 12 Mar 2020 10:29:54 +0000 (19:29 +0900)]
[Test/tflite] Add ssat test for multi-tensor output tflite model

Add a fail case and a simple run case for multi-tensor output tflite model.

Signed-off-by: Yongjoo Ahn <yongjoo1.ahn@samsung.com>
4 years ago[Android/Custom] possible mem leak
Jaeyun [Tue, 17 Mar 2020 08:28:05 +0000 (17:28 +0900)]
[Android/Custom] possible mem leak

release resources if failed to construct native handle.

Signed-off-by: Jaeyun <jy1210.jung@samsung.com>
4 years ago[Tests/Filter/TensorFlow] Use SO_EXT instead of hardcoded extension, .so
Wook Song [Tue, 17 Mar 2020 04:26:25 +0000 (13:26 +0900)]
[Tests/Filter/TensorFlow] Use SO_EXT instead of hardcoded extension, .so

This patch modifies the runTest script for TensorFlow sub-plugin tensor
filter to use SO_EXT (pre-defined in SSAT) instead of the hardcoded
extension, .so.

Signed-off-by: Wook Song <wook16.song@samsung.com>
4 years ago[Tests/Meson] Build tensor filter reload tests when tf-lite is enabled
Wook Song [Mon, 16 Mar 2020 02:23:31 +0000 (11:23 +0900)]
[Tests/Meson] Build tensor filter reload tests when tf-lite is enabled

The model reload test cases of tensor filter only works for the
tensorflow lite filter and its models. Therefore, this patch adds a
condition to check that the option for Tensorflow-Lite is enabled
before building those tests.

Signed-off-by: Wook Song <wook16.song@samsung.com>
4 years ago[TestCase] Count negative cases of gtest results
MyungJoo Ham [Mon, 16 Mar 2020 04:31:53 +0000 (13:31 +0900)]
[TestCase] Count negative cases of gtest results

Count negative test cases of gtest results.
SSAT negative test cases will be counted after SSAT updates.

Addresses #2150
Updates for SSAT will follow soon.

Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
4 years ago[Android] sync to cs-api update
Jaeyun [Wed, 11 Mar 2020 08:12:09 +0000 (17:12 +0900)]
[Android] sync to cs-api update

1. change method name to set/get the property
2. handle empty node name
3. define method to get model file in testcase

Signed-off-by: Jaeyun <jy1210.jung@samsung.com>
4 years ago[Tests] Fix build failures incurred by typo and sed on macOS
Wook Song [Sun, 15 Mar 2020 10:32:21 +0000 (19:32 +0900)]
[Tests] Fix build failures incurred by typo and sed on macOS

This patch fixes build failures when the 'enable-test' option is set
'true' on macOS. The following errors are fixed:
- Corrected typo (G_OPTION_FLAG_NONE -> G_OPTION_ARG_NONE)
- Fixed an error caused by the behaviour difference of 'sed' between Linux
  and macOS
- Eliminated a warning related to 'missing-braces' complained by clang++

Signed-off-by: Wook Song <wook16.song@samsung.com>
4 years ago[Filter/C++] Add workround for a warning related to format-nonliteral
Wook Song [Sat, 14 Mar 2020 07:16:57 +0000 (16:16 +0900)]
[Filter/C++] Add workround for a warning related to format-nonliteral

This patch adds a workround for the warning issued by clang when wrapping a function which takes format-literal-string arguments.

Signed-off-by: Wook Song <wook16.song@samsung.com>
4 years ago[Meson/Filter/TFLite] Use has_type to check types tflite supports
Wook Song [Fri, 13 Mar 2020 02:21:34 +0000 (11:21 +0900)]
[Meson/Filter/TFLite] Use has_type to check types tflite supports

Instead of checking which data types the installed TensorFlow Lite
supports via hardcoded version information, this patch uses has_type,
which is a function of the compiler object in meson, to check that.

Signed-off-by: Wook Song <wook16.song@samsung.com>
4 years ago[Meson/TFLite] Check version in ext/nns/filter/meson.build
Wook Song [Fri, 13 Mar 2020 02:02:44 +0000 (11:02 +0900)]
[Meson/TFLite] Check version in ext/nns/filter/meson.build

In order to improve readability, this patch moves the version checking
for tensorflow-lite in the meson build script in the source root
directory to the meson build script for the tensor filter extensions.

Signed-off-by: Wook Song <wook16.song@samsung.com>
4 years ago[Clang/Subplugin/Infra] Exclude features.h when building with clang
Wook Song [Thu, 12 Mar 2020 05:36:25 +0000 (14:36 +0900)]
[Clang/Subplugin/Infra] Exclude features.h when building with clang

The header file, features.h, does not exist in the libc of clang.
Therefore, features.h is excluded when building with clang to avoid a
compilation error reltate to this header file.

Signed-off-by: Wook Song <wook16.song@samsung.com>
4 years ago[Build] install headers in dev pkg
Jaeyun [Fri, 13 Mar 2020 04:44:53 +0000 (13:44 +0900)]
[Build] install headers in dev pkg

add missed headers to be installed in dev package.

Signed-off-by: Jaeyun <jy1210.jung@samsung.com>
4 years ago[Tizen] add a supporting element for tizen
HyoungJoo Ahn [Thu, 12 Mar 2020 05:46:43 +0000 (14:46 +0900)]
[Tizen] add a supporting element for tizen

adding an element: tizenwlsink

Signed-off-by: HyoungJoo Ahn <hello.ahn@samsung.com>
4 years ago[Common] define macro to print logs
Jaeyun [Thu, 12 Mar 2020 08:45:17 +0000 (17:45 +0900)]
[Common] define macro to print logs

Add internal header to define common log formats.

Signed-off-by: Jaeyun <jy1210.jung@samsung.com>
4 years ago[meson] Add dependency of gtest
Parichay Kapoor [Tue, 3 Mar 2020 07:13:13 +0000 (12:43 +0530)]
[meson] Add dependency of gtest

Some of the unittest depends on gtest
However their dependency is not checked leading to build failure with incorrect messages
Added dependency check of gtest before building those unittests

Signed-off-by: Parichay Kapoor <pk.kapoor@samsung.com>
4 years ago[Api] hw enum for sr-npu
Jaeyun [Mon, 9 Mar 2020 09:14:52 +0000 (18:14 +0900)]
[Api] hw enum for sr-npu

change enum val for npu-sr, and remove enum npu-srcn.

Signed-off-by: Jaeyun <jy1210.jung@samsung.com>
4 years ago[TFLite] add datatype according to the TFLite version
HyoungJoo Ahn [Mon, 24 Feb 2020 02:16:12 +0000 (11:16 +0900)]
[TFLite] add datatype according to the TFLite version

rather than setting option in person, we can parse tflite version after gettig dependency of tflite and add data types.

Signed-off-by: HyoungJoo Ahn <hello.ahn@samsung.com>
4 years agoTest/License: Add WordNet License File.
MyungJoo Ham [Mon, 9 Mar 2020 03:56:45 +0000 (12:56 +0900)]
Test/License: Add WordNet License File.

WordNet 3.0 requires to have License (WordNet 3.0) file
with the redistributed WordNet files.
The files in the same subdirectory are under the
WordNet 3.0 license.

However, note that we do not package and release binary
packages with the given files as they are test cases.

Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
4 years ago[Doc] invalid element name
Jaeyun [Tue, 10 Mar 2020 09:13:33 +0000 (18:13 +0900)]
[Doc] invalid element name

fix invalid element name in src-tizensensor source.

Signed-off-by: Jaeyun <jy1210.jung@samsung.com>
4 years ago[CAPI/Single] Do not compare unsigned integer with signed one
Wook Song [Mon, 9 Mar 2020 11:16:05 +0000 (20:16 +0900)]
[CAPI/Single] Do not compare unsigned integer with signed one

There are two for loops trying to compare the unsigned integer,
num_tensors, with a signed integet iterator in the single C-API
wrapper code. This patch fixes them.

Signed-off-by: Wook Song <wook16.song@samsung.com>
4 years ago[tflite] optimize invoke critical path
Parichay Kapoor [Sun, 1 Mar 2020 18:18:17 +0000 (23:48 +0530)]
[tflite] optimize invoke critical path

Move unnecessary computations out of the invoke critical path to maximize invoke performance

Signed-off-by: Parichay Kapoor <pk.kapoor@samsung.com>
4 years ago[Android] add filter-subplugin version
Jaeyun [Thu, 5 Mar 2020 05:51:35 +0000 (14:51 +0900)]
[Android] add filter-subplugin version

add version info to construct custom-filter in android.

Signed-off-by: Jaeyun <jy1210.jung@samsung.com>
4 years ago[Test] filesink buffer mode
Jaeyun [Fri, 6 Mar 2020 05:19:31 +0000 (14:19 +0900)]
[Test] filesink buffer mode

change buffer mode in filesink when writing a buffer with small size.

Signed-off-by: Jaeyun <jy1210.jung@samsung.com>
4 years ago[filter] Support probing for tensor filter subplugins version 1
Parichay Kapoor [Thu, 20 Feb 2020 03:33:37 +0000 (12:33 +0900)]
[filter] Support probing for tensor filter subplugins version 1

Support probing for tensor filter subplugins framework of version 1
Various ToDos' have been added which will be supported in upcoming PRs

Related Issue: #2116

Signed-off-by: Parichay Kapoor <pk.kapoor@samsung.com>
4 years ago[unittest/build] Fix location of unittests binaries
Parichay Kapoor [Tue, 18 Feb 2020 10:32:54 +0000 (19:32 +0900)]
[unittest/build] Fix location of unittests binaries

Many unittest binaries are built and located in build/tests
All these binaries located in build/tests (not in recursive folders) are
run all at once with nnstreamer.spec by running all the files in build/tests (line 388)

However, some of these binaries are not supposed to run directly (they requires extra params),
and are properly run and tested with their shell scripts run with ssat (repo and reload unittests)

This PR moves the repo and reload unittest generated binaries into appropriate subfolders
to avoid running these binaries directly and avoid unnecessary warnings

Signed-off-by: Parichay Kapoor <pk.kapoor@samsung.com>
4 years ago[armnn/hw] Added supported acclerators
Parichay Kapoor [Tue, 11 Feb 2020 10:24:21 +0000 (19:24 +0900)]
[armnn/hw] Added supported acclerators

Added supported accelerators for armnn and added corresponding unittests with single API
Tested set accelerators on device with caffe model on the device

Signed-off-by: Parichay Kapoor <pk.kapoor@samsung.com>
4 years ago[ncsdk2/hw] Added supported accelerators
Parichay Kapoor [Tue, 11 Feb 2020 10:22:55 +0000 (19:22 +0900)]
[ncsdk2/hw] Added supported accelerators

Added supported accelerators for ncsdk2 extension and corresponding unit-tests with single API

Signed-off-by: Parichay Kapoor <pk.kapoor@samsung.com>
4 years ago[nnfw/hw] Unit-test for nnfw accelerators
Parichay Kapoor [Tue, 11 Feb 2020 10:21:36 +0000 (19:21 +0900)]
[nnfw/hw] Unit-test for nnfw accelerators

Added unit-tests for nnfw supported accelerators with single API

Signed-off-by: Parichay Kapoor <pk.kapoor@samsung.com>
4 years ago[custom/hw] Added supported accelerators
Parichay Kapoor [Tue, 11 Feb 2020 10:19:04 +0000 (19:19 +0900)]
[custom/hw] Added supported accelerators

Added supported accelerators for custom filters and its unit-tests with single API

Signed-off-by: Parichay Kapoor <pk.kapoor@samsung.com>
4 years ago[tensorflow/hw] Added supported accelerators
Parichay Kapoor [Tue, 11 Feb 2020 10:16:58 +0000 (19:16 +0900)]
[tensorflow/hw] Added supported accelerators

Added supported list of hardwares for tensorflow's tensor filter's extension
Added corresponding unit-tests using single API

Signed-off-by: Parichay Kapoor <pk.kapoor@samsung.com>
4 years ago[python/hw] Added supported accelerators
Parichay Kapoor [Tue, 11 Feb 2020 10:15:02 +0000 (19:15 +0900)]
[python/hw] Added supported accelerators

Added list of supported backend accelerators for python extension of tensor filter

Signed-off-by: Parichay Kapoor <pk.kapoor@samsung.com>
4 years ago[caffe2/hw] Added backend accelerator for caffe2
Parichay Kapoor [Tue, 11 Feb 2020 10:14:13 +0000 (19:14 +0900)]
[caffe2/hw] Added backend accelerator for caffe2

Added list of supported accelerators as backend for caffe2

Signed-off-by: Parichay Kapoor <pk.kapoor@samsung.com>
4 years ago[openvino/hw] Update openvino supported HW
Parichay Kapoor [Tue, 11 Feb 2020 10:10:54 +0000 (19:10 +0900)]
[openvino/hw] Update openvino supported HW

Updated the list of HWs supported with openvino
Providing "true:npu" should also work along with "true:npu.movidius"
Providing specific movidius accelerator works
However, just providing a generic npu should also default to movidius

Signed-off-by: Parichay Kapoor <pk.kapoor@samsung.com>
4 years ago[Test] Add tensordec-image-segment ssat test
Yongjoo Ahn [Wed, 26 Feb 2020 05:35:50 +0000 (14:35 +0900)]
[Test] Add tensordec-image-segment ssat test

Add a fail case and a simple-run case. And simple golden compare test
with videotestsrc

Signed-off-by: Yongjoo Ahn <yongjoo1.ahn@samsung.com>
4 years ago[Coverity] fix coverity issue
Jaeyun [Mon, 2 Mar 2020 04:43:25 +0000 (13:43 +0900)]
[Coverity] fix coverity issue

1. init null before getting the file contents.
2. fix mem leak

Signed-off-by: Jaeyun <jy1210.jung@samsung.com>
4 years ago[Android] prepare single-only build
Jaeyun [Wed, 12 Feb 2020 11:20:18 +0000 (20:20 +0900)]
[Android] prepare single-only build

With the request to build single-shot only library, add definition and  update build script.

Signed-off-by: Jaeyun <jy1210.jung@samsung.com>
4 years ago[TFLite] check supporting datatype
HyoungJoo Ahn [Tue, 25 Feb 2020 02:18:00 +0000 (11:18 +0900)]
[TFLite] check supporting datatype

check supporting datatypes with meson_option and return the valid datatype

Signed-off-by: HyoungJoo Ahn <hello.ahn@samsung.com>
4 years agoHotfix: prepare GStreamer 1.16 accepted/tizen/unified/20200228.123757 accepted/tizen/unified/20200304.124034 submit/tizen/20200221.064623 submit/tizen/20200224.070348 submit/tizen/20200302.032418
MyungJoo Ham [Mon, 24 Feb 2020 06:33:24 +0000 (15:33 +0900)]
Hotfix: prepare GStreamer 1.16

From GStreamer 1.16, package name and plugin name should be
matched; otherwise, gstreamer will blacklist the plugin.

This fixes blacklisting issue with GStreamer 1.16 and
Tizen-sensor-framework plugin.

Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
4 years ago[Api/Single] change return value
Jaeyun Jung [Sat, 22 Feb 2020 07:57:12 +0000 (16:57 +0900)]
[Api/Single] change return value

Return not-supported if the property is not available.

Signed-off-by: Jaeyun Jung <jy1210.jung@samsung.com>
4 years agoSupport models with signed 8-bit integer I/O
Aaron J Arthurs [Mon, 17 Feb 2020 16:18:38 +0000 (10:18 -0600)]
Support models with signed 8-bit integer I/O

TensorFlow Lite models whose I/O is of type `kTfLiteInt8` are rejected,
requiring an I/O wrapper (`Quantize` operators). As signed 8-bit
integers are preferred in TensorFlow's quantization specifications [1],
this patch alleviates the need for an I/O wrapper to run strictly
`kTfLiteInt8`-type models.

[1] https://www.tensorflow.org/lite/performance/quantization_spec

Signed-off-by: Aaron J Arthurs <aajarthurs@gmail.com>
4 years ago[TFLite] add the datatype according to meson option
HyoungJoo Ahn [Fri, 21 Feb 2020 08:28:21 +0000 (17:28 +0900)]
[TFLite] add the datatype according to meson option

with the new version of TFLite, the new data types have been added. Since it's not supported and we cannot check the version of tensorflow at the build time, we have to set the datatype before building this package. I'd like to suggest adding a field at meson_option and allow user to set it.

Signed-off-by: HyoungJoo Ahn <hello.ahn@samsung.com>
4 years agoTizen/CAPI: Workaround to support VIVANTE submit/tizen/20200220.043100
MyungJoo Ham [Wed, 19 Feb 2020 06:55:11 +0000 (15:55 +0900)]
Tizen/CAPI: Workaround to support VIVANTE

We need to rewrite this change to make it more general.

This fixes:
1. if there are multiple files for a model, we need to check the
whole list at once, not indivisually.
2. add VIVANTE detection and verification methods.

Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
4 years ago[subplugin/ext] Added unittest for remaining framework functions
Parichay Kapoor [Tue, 18 Feb 2020 07:28:00 +0000 (16:28 +0900)]
[subplugin/ext] Added unittest for remaining framework functions

Added support for basic unittests of destroyNotify, checkAvailability and allocateInInvoke

Signed-off-by: Parichay Kapoor <pk.kapoor@samsung.com>
4 years ago[subplugin/ext] Added support for setInputDim and reloadModel in unittests
Parichay Kapoor [Tue, 24 Dec 2019 08:31:26 +0000 (17:31 +0900)]
[subplugin/ext] Added support for setInputDim and reloadModel in unittests

Added check for setInputDim and reloadModel in unittests
Correspondingly two sets of unittests are now generated using getDim or setDim (when possible)
Error values for tflite and python subplugin are updated
Added more error checks

Signed-off-by: Parichay Kapoor <pk.kapoor@samsung.com>
4 years ago[Coverity] Fix unitialized pointer field CID: 1123873
Yongjoo Ahn [Tue, 18 Feb 2020 07:38:49 +0000 (16:38 +0900)]
[Coverity] Fix unitialized pointer field CID: 1123873

Fix Coverity issues caused by unitialized pointer field in tensor_filter_cpp.cc

Signed-off-by: Yongjoo Ahn <yongjoo1.ahn@samsung.com>
4 years ago[Coverity] Fix uncaught exceptions CID: 1123680, 1123739
Yongjoo Ahn [Tue, 18 Feb 2020 01:28:07 +0000 (10:28 +0900)]
[Coverity] Fix uncaught exceptions CID: 1123680, 1123739

Fix coverity issues caused by uncaught exceptions

Signed-off-by: Yongjoo Ahn <yongjoo1.ahn@samsung.com>
4 years ago[Transform] Submit initial draft of README
Wook Song [Tue, 18 Feb 2020 07:25:48 +0000 (16:25 +0900)]
[Transform] Submit initial draft of README

This patch fills the README.md file for tensor_transform.

Signed-off-by: Wook Song <wook16.song@samsung.com>
4 years ago[Transform] Fix a typo in description of the 'arithmetic' mode
Wook Song [Tue, 18 Feb 2020 06:15:39 +0000 (15:15 +0900)]
[Transform] Fix a typo in description of the 'arithmetic' mode

This is a trivial fix, which corrects a typo in description of the
'arithmetic' mode.

Signed-off-by: Wook Song <wook16.song@samsung.com>
4 years ago[Coverity] Fix resource leak CID : 1123780, 1123859..
gichan-jang [Fri, 14 Feb 2020 11:29:45 +0000 (20:29 +0900)]
[Coverity] Fix resource leak CID : 1123780, 1123859..
Fix coverity issues caused by resource leak

Signed-off-by: gichan-jang <gichan2.jang@samsung.com>
4 years agoAggregator/Doc: add dis-aggregator notes.
MyungJoo Ham [Fri, 14 Feb 2020 05:24:20 +0000 (14:24 +0900)]
Aggregator/Doc: add dis-aggregator notes.

Per the request on the usage of "dis-aggregator",
leave a note that it is already supported by aggregator.

Fixes #2101

Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
4 years ago[ext] Remove class static variables without locking
Parichay Kapoor [Thu, 16 Jan 2020 06:00:45 +0000 (15:00 +0900)]
[ext] Remove class static variables without locking

As extensions are supposed to be thread-safe, using class static variables without locks is not stable.
Move class static variables to class private local object variables for python, tensorflow and caffe2.
Also update corresponding usages.

Signed-off-by: Parichay Kapoor <pk.kapoor@samsung.com>
4 years ago[python/ext] Do not update python framework functions
Parichay Kapoor [Thu, 16 Jan 2020 05:55:00 +0000 (14:55 +0900)]
[python/ext] Do not update python framework functions

Python updates in extensions framework functions
This results in non-thread-safe behavior
This PR modifies the corresponding implementation

Signed-off-by: Parichay Kapoor <pk.kapoor@samsung.com>
4 years ago[subplugin/ext] Extensions not update their functions
Parichay Kapoor [Tue, 24 Dec 2019 08:31:26 +0000 (17:31 +0900)]
[subplugin/ext] Extensions not update their functions

NNStreamer extensions for tensor filter update their functions based on the model file
However, this behavior is not thread-safe.
Updated for extensions to not update their functions for allocate_in_invoke

For allocate_in_invoke, tensor_filter needs to know based on the model if the allocate_in_invoke is supported or not
So added another interface in GstTensorFilterFramework - allocateInInvoke

V2:
Added allocate_in_invoke to be set properly in single API implementation of tensor_filter
Also added some minor updates in comment
Added minor bugfix in python extension

Related Issue: #2034

Signed-off-by: Parichay Kapoor <pk.kapoor@samsung.com>
4 years ago[Api] prepare release process
Jaeyun [Mon, 10 Feb 2020 08:19:44 +0000 (17:19 +0900)]
[Api] prepare release process

Update API description and prepare release process.

Signed-off-by: Jaeyun <jy1210.jung@samsung.com>
4 years agoLF/AI: Add required documents
MyungJoo Ham [Wed, 12 Feb 2020 09:38:11 +0000 (18:38 +0900)]
LF/AI: Add required documents

LF/AI requires to add MAINTAINERS.md and RELESES.md
This is to comply with the propsal of
https://github.com/lfai/proposing-projects/pull/9

Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
4 years agoStart development of 1.5.0 as 1.6.0-RC1
MyungJoo Ham [Tue, 11 Feb 2020 10:34:35 +0000 (19:34 +0900)]
Start development of 1.5.0 as 1.6.0-RC1

1.4.0 -> 1.5.0
        - 1.5.0 is a devel version for 1.6.0 release. (RC1)

Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
4 years agoRelease of 1.4.0 accepted/tizen/unified/20200214.120116 submit/tizen/20200213.040101 v1.4.0
MyungJoo Ham [Tue, 11 Feb 2020 10:33:05 +0000 (19:33 +0900)]
Release of 1.4.0

Major changes since 1.2.0 release:

1.3.1 -> 1.4.0
        - Stable release with API changes
        - *Tensor-filter subplugin API has been updated.*
        - Stability fixes & added unit test cases
        - C-API updates

1.3.0 -> 1.3.1
        - 1.3.1 is a devel version for 1.4.0 release.
        - Support C++ class custom filters. (C++ class as a NN model)
        - A tensor-filter instance may have multiple model files easily.
        - Updated env-var handling logic for non-Tizen devices.
        - Unit test: higher visibility & behavior correctness fixes.
        - Auto-generated test cases for tensor-filter sub-plugins (extensions).
        - Android/Java support with more convinient methods.
        - Support gcc9
        - Support openVino as a tensor-filter, allowing to accelerate with Intel NCS/Myriad.
        - Support NCSDK as a tensor-filter.
        - Support ARMNN as a tensor-filter. (support TF-Lite and Caffe models)
        - Reduce asserts and add error handling routines.
        - Support Androdi/SNAP as a tensor-filter.
        - Support hardware accelerators & 8-bit quantization for NNFW-Runtime & stabilize NNFW-Runtime support with test cases.
        - Support Edge-TPU and its runtime as a tensor-filter.
        - Filter subplugins refactored to have a single source file (.cc)
        - Support model reload
        - A lot of fixes for bugs found by Coverity, SVACE, and other static analysis tools

1.2.0 -> 1.3.0:
        - 1.3.0 is a devel version for 1.4.0 release.
        - From 1.2.0, 1.even.x is a release and 1.odd.x is a devel version.
        - When 1.3.x is "done", it will release 1.4.0 and move on to 1.5.0

Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
4 years ago[subplugin] Refactor subplugin interface
Parichay Kapoor [Mon, 3 Feb 2020 10:18:26 +0000 (19:18 +0900)]
[subplugin] Refactor subplugin interface

Refactor subplugin interface
Add new interface for the subplugins along with the old interface
Added version number to check if old subplugin interface is used or new one

Both the interfaces are added as a union,
This will allow for staggered changes rather a big change to be made at once

V2:
- Merged operation GET_INPUT_INFO and GET_OUTPUT_INFO into 1. Now atleast one of
SET_INPUT_INFO and GET_INOUT_INFO must be supported.
- Added framework versioning helper macros
- Older framework is now version 0 and newer one is version 1
- Renamed sendEvent to eventHandler
- private_data is a double pointer only in open/close in v1
- Invoke in v1 compared to invoke_NN in v0 where private_data is not a double pointer
- Moved init and fini functions in tensor_filter_cpp for readability

V3:
Update GstTensorFilterFramework function pointers set for all filters to pass all build

V4:
Added to description - eventHandler argument `void *data` is allowed to be NULL

V5:
Added tensor filter API versions for external subplugins to verify compatibility at compile time
Renamed GET_INOUT_INFO to GET_IN_OUT_INFO for readability

V6:
Added more operations to be supported with eventHandler which allow updating the properties
Added GstTensorFilterFrameworkEventData which allows arguments to be passed dependent on the event
GstTensorFilterProperties is passed to all the callbacks

V7:
Updated destroyNotify to take private_data as an input for V0, and corresponding changes in tensor_filter and subplugins
Added allocateInInvoke for V0

Signed-off-by: Parichay Kapoor <pk.kapoor@samsung.com>
4 years ago[Conf/CodeClean] remove duplicated code
Jaeyun [Wed, 15 Jan 2020 04:58:59 +0000 (13:58 +0900)]
[Conf/CodeClean] remove duplicated code

add internal function for sub-plugin scan.

Signed-off-by: Jaeyun Jung <jy1210.jung@samsung.com>
4 years ago[Coverity] Fix resource leak submit/tizen/20200212.101153
gichan-jang [Wed, 12 Feb 2020 02:03:06 +0000 (11:03 +0900)]
[Coverity] Fix resource leak
Fix coverity issues caused by resource leak.
CID: 1123663, 1123830, 1123853, 1123860

Signed-off-by: gichan-jang <gichan2.jang@samsung.com>
4 years agofix coverity CID: 1123841, 1123966
Yongjoo Ahn [Tue, 11 Feb 2020 06:39:32 +0000 (15:39 +0900)]
fix coverity CID: 1123841, 1123966
1123841 - check the return value of sensor_listener_start
1123966 - g_free the newly allocated memory

Signed-off-by: Yongjoo Ahn <yongjoo1.ahn@samsung.com>
4 years ago[Doc] Fix broken links for SSAT in documentation.
Dongju Chae [Tue, 11 Feb 2020 10:55:00 +0000 (19:55 +0900)]
[Doc] Fix broken links for SSAT in documentation.

This commit fixes broken links for SSAT in documentation.
nnsuite/ssat is no longer available.

Signed-off-by: Dongju Chae <dongju.chae@samsung.com>
4 years agoFilter/C++: Fix potential memory leak.
MyungJoo Ham [Mon, 20 Jan 2020 10:06:42 +0000 (19:06 +0900)]
Filter/C++: Fix potential memory leak.

dlclose() should not be called if the target-library's contents may
be refered later.

dlclose() should be called at the exit of a pipeline to avoid
memory leaks of user applications.

Thus, we need to call dlclose for all handles at the ensured exit
point.

They are named with underbar (_) because register is a keyword.

Changes in v2:
- Added lock for handles
- Don't call dlclose at exit context if it's GLIBC 2.23

Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
4 years ago[Android] add method about property
Jaeyun [Fri, 7 Feb 2020 11:09:03 +0000 (20:09 +0900)]
[Android] add method about property

1. add new method to set/get the property in single-shot.
2. add/modify testcases for snap and property value.

Signed-off-by: Jaeyun <jy1210.jung@samsung.com>
4 years ago[Test] add new tc for single-shot property
Jaeyun [Fri, 7 Feb 2020 09:15:58 +0000 (18:15 +0900)]
[Test] add new tc for single-shot property

add testcases to validate set/get property in single-shot api.

Signed-off-by: Jaeyun <jy1210.jung@samsung.com>
4 years ago[Api/Single] add new function about property
Jaeyun [Thu, 6 Feb 2020 04:57:58 +0000 (13:57 +0900)]
[Api/Single] add new function about property

ACR required.
Add new function to set/get the property of tensor-filter in single-shot.

With this function, we can support the tensor layout in single-shot instance.

Signed-off-by: Jaeyun <jy1210.jung@samsung.com>
4 years ago[Api] code clean
Jaeyun [Fri, 7 Feb 2020 09:10:11 +0000 (18:10 +0900)]
[Api] code clean

1. add internal functions for complexity.
2. return proper error code in single-shot function.

Signed-off-by: Jaeyun <jy1210.jung@samsung.com>
4 years agoFix/Coverity/1123913,1123863 : Handle thrown exception
gichan-jang [Tue, 11 Feb 2020 04:21:59 +0000 (13:21 +0900)]
Fix/Coverity/1123913,1123863 : Handle thrown exception
Fix to catch exception from GTest
Coverity CID : 1123913, 1123863 and potential error code

Signed-off-by: gichan-jang <gichan2.jang@samsung.com>
4 years agoFix/Coverity/1123652/1123668 : Handle thrown exception
gichan-jang [Tue, 11 Feb 2020 02:31:27 +0000 (11:31 +0900)]
Fix/Coverity/1123652/1123668 : Handle thrown exception
Fix to catch exception from GTest
Coverity CID : 1123652, 1123668

Signed-off-by: gichan-jang <gichan2.jang@samsung.com>
4 years ago[C-Api] add function to get subplugin name accepted/tizen/unified/20200211.132112 submit/tizen/20200211.034316
Jaeyun [Mon, 10 Feb 2020 07:37:38 +0000 (16:37 +0900)]
[C-Api] add function to get subplugin name

Add new function to get sub-plugin name and conditions to validate the nnfw is available.

TODO : add condition to check the nnfw availability.

Signed-off-by: Jaeyun <jy1210.jung@samsung.com>
4 years ago[single/coverity] Coverity fix
Parichay Kapoor [Mon, 10 Feb 2020 08:10:48 +0000 (17:10 +0900)]
[single/coverity] Coverity fix

Added coverity fix of checking return value
In ml_single_set_info_in_handle: Value returned from a function is not checked for errors before being used (CWE-252)

Signed-off-by: Parichay Kapoor <pk.kapoor@samsung.com>
4 years ago[single/coverity] Fix coverity issue
Parichay Kapoor [Mon, 10 Feb 2020 06:01:32 +0000 (15:01 +0900)]
[single/coverity] Fix coverity issue

Fix coverity issue CWE-416
Issue: In ml_single_set_info_in_handle: A pointer to freed memory is dereferenced, used as a function argument, or otherwise used

Signed-off-by: Parichay Kapoor <pk.kapoor@samsung.com>
4 years agoSubplugin infra: dlclose & free handles at exit
MyungJoo Ham [Tue, 21 Jan 2020 01:17:58 +0000 (10:17 +0900)]
Subplugin infra: dlclose & free handles at exit

We need to hold ALL handles if the pipeline is not closed.
However, after the pipeline is closed, all the handles must be
dlclosed; otherwise, the application may hold unnecessary
resources during the execution.

Changes in v2:
- Use g_ptr_array instead of garray.
Changes in v3:
- Added workaround for dlclose-racing bug of GLIBC 2.23 (Ubuntu 16.04)

Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
4 years agoCoverity/1123747/1123767/1123869: Stack Size Limit
MyungJoo Ham [Mon, 10 Feb 2020 08:00:36 +0000 (17:00 +0900)]
Coverity/1123747/1123767/1123869: Stack Size Limit

Coverity says not to use stack variable larger than 10kB.
Move verify_data data to global so that it does not
consume the stack.

Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
4 years ago[build/tizen] Identify build failure correctly
Parichay Kapoor [Fri, 7 Feb 2020 09:03:29 +0000 (18:03 +0900)]
[build/tizen] Identify build failure correctly

Identify the build failures correctly
Also disable the problematic unit-test of nnfw
This resolves #2081

Signed-off-by: Parichay Kapoor <pk.kapoor@samsung.com>
4 years ago[spec] spec file cleanup
Parichay Kapoor [Fri, 7 Feb 2020 09:06:24 +0000 (18:06 +0900)]
[spec] spec file cleanup

Avoid running tests multiple times
More cleanup also added

Signed-off-by: Parichay Kapoor <pk.kapoor@samsung.com>
4 years ago[tests] Clean up files after tests
Parichay Kapoor [Thu, 6 Feb 2020 04:50:41 +0000 (13:50 +0900)]
[tests] Clean up files after tests

Clean up files created during tests with ssat

Signed-off-by: Parichay Kapoor <pk.kapoor@samsung.com>
4 years ago[Tests/Filter/MvNCSDK2] Add failure test cases
Wook Song [Wed, 29 Jan 2020 05:54:34 +0000 (14:54 +0900)]
[Tests/Filter/MvNCSDK2] Add failure test cases

This patch adds failure test cases, which are based on the normal
pipeline launch test case.

Signed-off-by: Wook Song <wook16.song@samsung.com>
4 years ago[Tests/Filter/MvNCSDK2] Update the helper class to test failure cases
Wook Song [Wed, 29 Jan 2020 05:38:42 +0000 (14:38 +0900)]
[Tests/Filter/MvNCSDK2] Update the helper class to test failure cases

This patch updates the helper class so that testing failure cases are
supported.

Signed-off-by: Wook Song <wook16.song@samsung.com>