platform/upstream/nnstreamer.git
3 years ago[Tensor Transform] Fix unsupported orc type cast
gichan-jang [Tue, 20 Oct 2020 09:30:52 +0000 (18:30 +0900)]
[Tensor Transform] Fix unsupported orc type cast

Orc does not support 64bit integer typecast.
A problem occurs when the pipeline is launched with orc option,
  and then the option is changed using set_property to convert type int64 or uint64.
So disables the orc if the int64 or uint64 typecast is required.

Signed-off-by: gichan-jang <gichan2.jang@samsung.com>
3 years ago[ONE/Android] prepare ONE-1.10.0 release
Jaeyun [Mon, 19 Oct 2020 08:27:05 +0000 (17:27 +0900)]
[ONE/Android] prepare ONE-1.10.0 release

prepare next ONE release (ver 1.10.0)
- change pkg name (nnfw -> onert)
- add new testcase to check dynamic dimension

Signed-off-by: Jaeyun <jy1210.jung@samsung.com>
4 years ago[TensorRate/Test] Add simple testcases for tensor_rate (not QoS events)
Dongju Chae [Mon, 19 Oct 2020 01:51:06 +0000 (10:51 +0900)]
[TensorRate/Test] Add simple testcases for tensor_rate (not QoS events)

This patch adds simple testcases for tensor_rate element, just adjusting
downstream framerate without sending QoS events to upstream elements.

Signed-off-by: Dongju Chae <dongju.chae@samsung.com>
4 years ago[Filter/NNFW] dummy invoke after set-info called
Jaeyun [Tue, 6 Oct 2020 11:09:32 +0000 (20:09 +0900)]
[Filter/NNFW] dummy invoke after set-info called

When called set-info function, NNFW updates output shape after the invoke is done.
Add dummy invoke function and call it after input shape is changed.

Signed-off-by: Jaeyun <jy1210.jung@samsung.com>
4 years ago[TensorRate] Implement the prototype codes for tensor_rate element
Dongju Chae [Thu, 24 Sep 2020 08:26:12 +0000 (17:26 +0900)]
[TensorRate] Implement the prototype codes for tensor_rate element

This patch implements the prototype codes for 'tensor_rate' element.

'tensor_rate' will include two methods to adjust a frame rate.
1) Either drop or duplicate frames similar to 'videorate' plugin
2) Propagate a specified frame-rate to upstream elements.

As a prototype, most of codes are reused from 'videorate' sources codes,
and still many things should be revised according to the tensor concept.

But, at least, its functionality was checked if we run this pipeline.

gst-launch-1.0 videotestsrc
   ! video/x-raw,width=640,height=480,framerate=15/1
   ! tensor_converter
   ! tensor_rate framerate=10/1
   ! tensor_decoder mode=direct_video
   ! videoconvert
   ! autovideosink

Signed-off-by: Dongju Chae <dongju.chae@samsung.com>
4 years ago[TensorIF] Add basic action option
gichan-jang [Tue, 13 Oct 2020 10:06:27 +0000 (19:06 +0900)]
[TensorIF] Add basic action option

Add basic action option: PASSTHROUGH, SKIP, TENSORPICK

 Supported operator: All
 Suppoted data type: All
 Supported action: passthrough, skip, tensorpick. (Others will be added)

Signed-off-by: gichan-jang <gichan2.jang@samsung.com>
4 years agoDocker: move location, shorten build script.
MyungJoo Ham [Tue, 13 Oct 2020 02:04:36 +0000 (11:04 +0900)]
Docker: move location, shorten build script.

1. Move dockerfile location (/docker/... --> /tools/docker)
2. Run ninja once and do install and build.

Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
4 years ago[docker] Add ubuntu16.04/18.04 devel Dockerfile
JeonChangMin [Thu, 10 Sep 2020 17:54:54 +0000 (02:54 +0900)]
[docker] Add ubuntu16.04/18.04 devel Dockerfile
Add Dockerfile for ubuntu16.04/18.04 nnstreamer build using meson/ninja

Signed-off-by: JeonChangMin <imsameperson@gmail.com>
4 years ago[docker] Add ubuntu16.04/18.04 runtime Dockerfile
JeonChangMin [Thu, 10 Sep 2020 17:54:10 +0000 (02:54 +0900)]
[docker] Add ubuntu16.04/18.04 runtime Dockerfile
Add Dockerfile for ubuntu16.04/18.04 nnstreamer runtime using ppa

Signed-off-by: JeonChangMin <imsameperson@gmail.com>
4 years ago[Log/TF-lite] print average invoke time
Jaeyun [Wed, 14 Oct 2020 07:50:02 +0000 (16:50 +0900)]
[Log/TF-lite] print average invoke time

add debug log in invoke function to print average time.

Signed-off-by: Jaeyun <jy1210.jung@samsung.com>
4 years agoTest/Fix golden data.
MyungJoo Ham [Tue, 13 Oct 2020 01:36:41 +0000 (10:36 +0900)]
Test/Fix golden data.

The golden data itself had bugs :(

Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
4 years agoDecoder/BoundingBox: fix resolution decoding
MyungJoo Ham [Wed, 7 Oct 2020 13:11:02 +0000 (22:11 +0900)]
Decoder/BoundingBox: fix resolution decoding

draw() assumes that the "results" have coordinates based on
input resolutions, not output resolutions

Fixes #2781

Reported-by: @giladnahor
Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
4 years ago[Example/Meson] Fix the buildbreak of custom_example_tensorrt example
Sangjung Woo [Wed, 14 Oct 2020 07:18:49 +0000 (16:18 +0900)]
[Example/Meson] Fix the buildbreak of custom_example_tensorrt example

Because of the wrong file path in meson script, below error occurs when
running 'meson build' command. This patch fixes that bug.

* Error message: nnstreamer_example/meson.build:98:2: ERROR: File
  nnstreamer_customfilter_example_tensorrt_reshape.cc does not exist.

Signed-off-by: Sangjung Woo <sangjung.woo@samsung.com>
4 years ago[TensorIF] Support generic type
gichan-jang [Wed, 23 Sep 2020 10:14:08 +0000 (19:14 +0900)]
[TensorIF] Support generic type

Support generic type for compared value and supplied value

float typed is supported for supplied value.
  - e.g., supplied-value=2.23e+1,2.0E+2

Supported operator: All
Suppoted data type: All
Supported action: Not given. Just operate as passthrough(TRUE) and skip(FALSE)

Signed-off-by: gichan-jang <gichan2.jang@samsung.com>
4 years ago[Example] Place build intermediates of custom filters on the same directory
Wook Song [Mon, 5 Oct 2020 10:30:46 +0000 (19:30 +0900)]
[Example] Place build intermediates of custom filters on the same directory

As the custom filters are installed into the same directory, this
patch places the build intermediates of custom filters, which are used
in the test cases at the build-time, on the same directory to reduce
unnecessary complexity in the test cases.

Signed-off-by: Wook Song <wook16.song@samsung.com>
4 years ago[Example] Relocate custom filters for unittest_sink to nnstreamer_example
Wook Song [Tue, 6 Oct 2020 04:55:53 +0000 (13:55 +0900)]
[Example] Relocate custom filters for unittest_sink to nnstreamer_example

In order to simplify the path of custom filters used in the test cases,
this patch relocates the custom filters, nncustom_drop_buffer and
nncustom_framecounter, for unittest_sink to the nnstreamer_example
directory.

Signed-off-by: Wook Song <wook16.song@samsung.com>
4 years ago[TensorIF] Implement basic operation with uint8 type
gichan-jang [Wed, 23 Sep 2020 10:14:08 +0000 (19:14 +0900)]
[TensorIF] Implement basic operation with uint8 type

Supported operation: All
Suppoted data type: uint8 (need to make it as generic type)
Supported action: Not given. Just operate as passthrough(TRUE) and skip(FALSE)

Signed-off-by: gichan-jang <gichan2.jang@samsung.com>
4 years ago[TensorIF] Change to support single sinkpads and multi srcpads
gichan-jang [Tue, 22 Sep 2020 08:23:15 +0000 (17:23 +0900)]
[TensorIF] Change to support single sinkpads and multi srcpads

GstBaseTransform changed to GstElement to support multi srcpads.

Signed-off-by: gichan-jang <gichan2.jang@samsung.com>
4 years ago[Android/SNAP] subplugin for SNAP
Jaeyun [Mon, 12 Oct 2020 07:31:06 +0000 (16:31 +0900)]
[Android/SNAP] subplugin for SNAP

Upload sub-plugin for SNAP.
To build Android library with SNAP, developer should download Samsung Neural SDK and set the path to SNAP SDK interface.

Tested on S20+ (QC)

Signed-off-by: Jaeyun <jy1210.jung@samsung.com>
4 years ago[Doc] update description
Jaeyun [Mon, 12 Oct 2020 04:50:33 +0000 (13:50 +0900)]
[Doc] update description

add function description about fetching version info in plugin-api header.

Signed-off-by: Jaeyun <jy1210.jung@samsung.com>
4 years ago[Android/makefile] Add NNS_API_FLAGS to nnfw and snpe sub-plugins
Yongjoo Ahn [Thu, 8 Oct 2020 06:35:42 +0000 (15:35 +0900)]
[Android/makefile] Add NNS_API_FLAGS to nnfw and snpe sub-plugins

- Add NNS_API_FLAGS to compile flags for nnfw and snpe sub-plugins

Signed-off-by: Yongjoo Ahn <yongjoo1.ahn@samsung.com>
4 years ago[Android/tflite] Let NDK know TFLITE_VERSION
Yongjoo Ahn [Thu, 8 Oct 2020 06:32:56 +0000 (15:32 +0900)]
[Android/tflite] Let NDK know TFLITE_VERSION

- After support for tf2-lite, TFLITE_VERSION is required. Let NDK know it
- For Android, the name of subplugin should be always "tensorflow-lite"  not "tensorflow2-lite"

Signed-off-by: Yongjoo Ahn <yongjoo1.ahn@samsung.com>
4 years ago[Tests] Eliminate hard-coded build root from source code
Wook Song [Tue, 29 Sep 2020 08:20:30 +0000 (17:20 +0900)]
[Tests] Eliminate hard-coded build root from source code

This patch eliminates hard-coded build root from source code. Instead of
the hard-coded 'build', this patch introduces an environment variable,
NNSTREAMER_BUILD_ROOT_PATH, which is provided by the meson build script.
According to this change, packaging scripts are also updated.

Signed-off-by: Wook Song <wook16.song@samsung.com>
4 years ago[Tests/TizenCAPI] trivial: Fix Doxygen tag should begin with /**
Wook Song [Tue, 29 Sep 2020 12:28:57 +0000 (21:28 +0900)]
[Tests/TizenCAPI] trivial: Fix Doxygen tag should begin with /**

This patch fixes the Doxygen-tag-check failure, which is 'Doxygen or
multi line comments should begin with /**', in the Tizen C-API test
case.

Signed-off-by: Wook Song <wook16.song@samsung.com>
4 years ago[Filter/TF-lite] nnapi option
Jaeyun [Fri, 25 Sep 2020 10:46:08 +0000 (19:46 +0900)]
[Filter/TF-lite] nnapi option

Add option structure to open tf-lite model, set NNAPI false as default value.

Using NNAPI in tf-lite may make lower performance and unexpected result for some model.
Let the developer select NNAPI option when constructing the pipeline.

Signed-off-by: Jaeyun <jy1210.jung@samsung.com>
4 years ago[Fix/Filter] Use g_value_take_string in get_property
Dongju Chae [Wed, 7 Oct 2020 03:22:03 +0000 (12:22 +0900)]
[Fix/Filter] Use g_value_take_string in get_property

This patch uses g_value_take_string, instead of g_value_set_string,
in get_property impl, to avoid redundant invoking g_free.

Signed-off-by: Dongju Chae <dongju.chae@samsung.com>
4 years ago[TensorIF] Add README.md for tensor_if element
gichan-jang [Wed, 16 Sep 2020 11:06:11 +0000 (20:06 +0900)]
[TensorIF] Add README.md for tensor_if element

Describe for tensor_if definition, its properties and usuage cases.

Signed-off-by: gichan-jang <gichan2.jang@samsung.com>
4 years ago[test/SSAT] Fix minor SSAT test issues
Yongjoo Ahn [Tue, 6 Oct 2020 06:49:54 +0000 (15:49 +0900)]
[test/SSAT] Fix minor SSAT test issues

- Add an escape character in runTest.sh
- Open binary file with 'rb' mode, not 'r'

Signed-off-by: Yongjoo Ahn <yongjoo1.ahn@samsung.com>
4 years ago[Ext/Filter/Python] Set verify_model_path as TRUE
Wook Song [Tue, 29 Sep 2020 14:40:47 +0000 (23:40 +0900)]
[Ext/Filter/Python] Set verify_model_path as TRUE

This patch sets verify_model_path as TRUE to delegate the verification
of the given model files (i.e., .py scripts) to the NNS common
framework.

Signed-off-by: Wook Song <wook16.song@samsung.com>
4 years ago[Ext/Filter/PyTorch] Set verify_model_path as TRUE
Wook Song [Tue, 29 Sep 2020 14:39:40 +0000 (23:39 +0900)]
[Ext/Filter/PyTorch] Set verify_model_path as TRUE

This patch sets verify_model_path as TRUE to delegate the given model
files' verification to the NNS common framework and removes the
verification code from the PyTorch tensor_filter subplugin.

Signed-off-by: Wook Song <wook16.song@samsung.com>
4 years ago[Ext/Filter/TF] Set verify_model_path as TRUE
Wook Song [Tue, 29 Sep 2020 14:29:22 +0000 (23:29 +0900)]
[Ext/Filter/TF] Set verify_model_path as TRUE

This patch sets verify_model_path as TRUE to delegate the given model
files' verification to the NNS common framework and removes the
verification code from the TensorFlow tensor_filter subplugin.

Signed-off-by: Wook Song <wook16.song@samsung.com>
4 years ago[Custom/TensorRT] Implement example custom filter for TensorRT
Dongju Chae [Thu, 24 Sep 2020 01:26:28 +0000 (10:26 +0900)]
[Custom/TensorRT] Implement example custom filter for TensorRT

This patch implements example custom filter for TensorRT, which
reshapes tensor dimensions.

Reference sample:
https://github.com/NVIDIA/TensorRT/tree/master/samples/opensource/sampleDynamicReshape

Tested environment
- Desktop PC: Ubuntu 16.04, CUDA 11.0, TensorRT 7.1.3
- Jetson Nano: Ubuntu 18.04, CUDA 10.0, TensorRT 6.0.1 (i.e., Jetpack 4.3 installed)

Signed-off-by: Dongju Chae <dongju.chae@samsung.com>
4 years ago[Build/TF-Lite] Check tf-lite version and don't use contrib path
Dongju Chae [Mon, 5 Oct 2020 09:13:18 +0000 (18:13 +0900)]
[Build/TF-Lite] Check tf-lite version and don't use contrib path

This patch adds tf-lite version checking and makes it remove
'contrib' include path in tflite subplugin.

Signed-off-by: Dongju Chae <dongju.chae@samsung.com>
4 years ago[Ext/Filter/Meson] Do not build tflite-extension without flatbuffers-dev
Wook Song [Thu, 24 Sep 2020 07:44:46 +0000 (16:44 +0900)]
[Ext/Filter/Meson] Do not build tflite-extension without flatbuffers-dev

This patch blocks the building of the TensorFlow-Lite subplugin without
resolving the dependency on libflatbuffers-dev.

Signed-off-by: Wook Song <wook16.song@samsung.com>
4 years ago[Meson] Merge install-example into install-test
Wook Song [Wed, 23 Sep 2020 07:35:42 +0000 (16:35 +0900)]
[Meson] Merge install-example into install-test

Since there are test cases that require custom-filters, the
install-example option should be set to true as well as the
install-test option to make the installed test cases fully work. To
avoid such tangled dependencies between these meson options, this patch
merges install-example into install-test.

Signed-off-by: Wook Song <wook16.song@samsung.com>
4 years ago[docs] Update getting-started with minimal requirement
Parichay Kapoor [Sat, 26 Sep 2020 04:10:26 +0000 (13:10 +0900)]
[docs] Update getting-started with minimal requirement

Update getting-started.md for ubuntu to include minimal requirement
required to build nnstreamer with default configuration

V2:
Added ninja-build as dependency as nnstreamer ppa meson does not
list it as a dependency

Signed-off-by: Parichay Kapoor <pk.kapoor@samsung.com>
4 years ago[Meson] change license arg
Jaeyun [Thu, 24 Sep 2020 03:16:57 +0000 (12:16 +0900)]
[Meson] change license arg

change license arg in meson script (LGPL > LGPL-2.1)

Signed-off-by: Jaeyun <jy1210.jung@samsung.com>
4 years ago[tensor_filter] [patch 4/4] Remove double underscore of a macro
Bumsik Kim [Mon, 21 Sep 2020 14:19:43 +0000 (07:19 -0700)]
[tensor_filter] [patch 4/4] Remove double underscore of a macro

s/__NO_ANONYMOUS_NESTED_STRUCT/NO_ANONYMOUS_NESTED_STRUCT/g.

By the C99 standard, all identifiers with leading underscores are
reserved, and more importantly, are for use in file scope. Though this
rule are often not observed, its macro name (no anonymous nested struct)
may give an impression that it is a special GCC feature-related macros.

Signed-off-by: Bumsik Kim <k.bumsik@gmail.com>
4 years ago[ext/tensor_filter] [patch 3/4] Initialize stats variables at compile-time
Bumsik Kim [Mon, 21 Sep 2020 14:04:43 +0000 (07:04 -0700)]
[ext/tensor_filter] [patch 3/4] Initialize stats variables at compile-time

This initializes stats imformation in the same manner in the previous
commits in the patch.

Signed-off-by: Bumsik Kim <k.bumsik@gmail.com>
4 years ago[ext/tensor_filter] [patch 2/4] Set unimplemented API fields
Bumsik Kim [Mon, 21 Sep 2020 13:57:36 +0000 (06:57 -0700)]
[ext/tensor_filter] [patch 2/4] Set unimplemented API fields

This resolves build errors of the previous commit.
This commit also let contributors to spot uminplemented parts
of the subplugins.

Signed-off-by: Bumsik Kim <k.bumsik@gmail.com>
4 years ago[ext/tensor_filter] [patch 1/4] Initialize driver struct at compile-time
Bumsik Kim [Mon, 21 Sep 2020 13:12:59 +0000 (06:12 -0700)]
[ext/tensor_filter] [patch 1/4] Initialize driver struct at compile-time

Initialize driver structs at compile-time by using designated
initializer.

This approach also improves readability and makes it easier to kepp
track of unimplemented APIs by partially forced to set fields manually
since g++ does not implement out-of-order (including skipped) designator.

Note that this commit fails to build, which shows the later point
mentioned. This is fixed in the later commit in this patch.

Signed-off-by: Bumsik Kim <k.bumsik@gmail.com>
4 years ago[SPEC] Add libcapi-nnstreamer.so.0 symlink as workaround
Sangjung Woo [Fri, 18 Sep 2020 03:25:20 +0000 (12:25 +0900)]
[SPEC] Add libcapi-nnstreamer.so.0 symlink as workaround

This patch temporarily adds the 'libcapi-nnstreamer.so.0' symlink to
support the backward compatibility of the .Net APIs. It will be removed
when fixing TizenFX and Tizen rootstrap.

Signed-off-by: Sangjung Woo <sangjung.woo@samsung.com>
4 years ago[API/Tizen] Add verson number to libcapi-nnstreamer.so
Sangjung Woo [Fri, 18 Sep 2020 02:02:33 +0000 (11:02 +0900)]
[API/Tizen] Add verson number to libcapi-nnstreamer.so

This patch adds the verson number to libcapi-nnstreamer.so and fixes the
packaging issue as follows:

$ rpm -qlp capi-nnstreamer-1.5.3-0.x86_64.rpm
/usr/lib64/libcapi-nnstreamer.so.1
/usr/lib64/libcapi-nnstreamer.so.1.5.3
/usr/share/licenses/capi-nnstreamer
/usr/share/licenses/capi-nnstreamer/LICENSE

$ rpm -qlp capi-nnstreamer-devel-1.5.3-0.x86_64.rpm
/usr/include/nnstreamer/nnstreamer-single.h
/usr/include/nnstreamer/nnstreamer.h
/usr/lib64/libcapi-nnstreamer.so
/usr/lib64/pkgconfig/capi-nnstreamer.pc

Signed-off-by: Sangjung Woo <sangjung.woo@samsung.com>
4 years ago[TF2/Filter] Added a framework to support TF2-Lite (2.3.0)
Geunsik Lim [Fri, 28 Aug 2020 04:45:29 +0000 (13:45 +0900)]
[TF2/Filter] Added a framework to support TF2-Lite (2.3.0)

This commit is to support Tensorflow Lite 2.3.0 (TF2-Lite) additionally,
so that we support Tensorflow 2.x based network models (e.g., ASR) in
the Tizen 6.X platform.

**Changelog**

  * Version 3:
    * Removed unnecessary tflite_nnapi delegation (@jaeyun-jung)

  * Version 2:
    * Added a debian packaging for TF-2.3.0 in tensorflow2 (review.tizen.org)
      * https://review.tizen.org/gerrit/#/c/243189/ (Reviewed, Merged)
      * https://launchpad.net/~nnstreamer/+archive/ubuntu/ppa-build-test (Published)
  * Added unit-test with ssat

  * Version 1:
    * Added tflite2_support feature for meson build procedure
    * Added TF2-Lite statements in the .spec file for Tizen
    * Generate two libraries with "-DTFLITE_VERSION" flag from
      the tensor_filter_tensorflow_lite.cc file
    * Added nnstreamer-tensorflow2-lite package

Signed-off-by: Geunsik Lim <geunsik.lim@samsung.com>
4 years ago[Build/TensorRT] Add TensorRT dependency
Dongju Chae [Tue, 15 Sep 2020 07:29:02 +0000 (16:29 +0900)]
[Build/TensorRT] Add TensorRT dependency

This patch adds TensorRT dependency.

Signed-off-by: Dongju Chae <dongju.chae@samsung.com>
4 years ago[Filter/Python] Do PyType_Ready prior to PyModule_Create
Wook Song [Mon, 7 Sep 2020 08:46:58 +0000 (17:46 +0900)]
[Filter/Python] Do PyType_Ready prior to PyModule_Create

In some cases, PyType_Ready after PyModule_Create fails with returning
-1. As the official tutorial [1, 2] guided, this patch moves
PyType_Ready to the location before PyModule_Create.

[1] https://docs.python.org/3/extending/newtypes_tutorial.html
[2] https://docs.python.org/2/extending/newtypes.html

Signed-off-by: Wook Song <wook16.song@samsung.com>
4 years ago[Filter/Python] Make nnstreamer-python work with python 3.8 on macOS
Wook Song [Mon, 7 Sep 2020 08:35:24 +0000 (17:35 +0900)]
[Filter/Python] Make nnstreamer-python work with python 3.8 on macOS

In order to nnstreamer-python3 work with python 3.8 on macOS, this patch
revises the libpython name and the hard-coded file extensions of shared
libraries to fit macOS.

Signed-off-by: Wook Song <wook16.song@samsung.com>
4 years ago[Meson] Add a variable indicating the shared library's file extension
Wook Song [Mon, 7 Sep 2020 08:13:30 +0000 (17:13 +0900)]
[Meson] Add a variable indicating the shared library's file extension

To handle the variation in the file extension of a shared library
according to the platform, this patch adds a variable to indicate it.

Signed-off-by: Wook Song <wook16.song@samsung.com>
4 years ago[Filter/NNFW] enable set-dim function
Jaeyun [Wed, 16 Sep 2020 08:17:48 +0000 (17:17 +0900)]
[Filter/NNFW] enable set-dim function

ONE supports API to set input info, remove unnecessary feature about changing input shape.

TODO:
1. We should wait next ONE release - maybe ONE 1.10 on next month.
2. After the next ONE release, consider to publish nnstreamer 1.6.x release.

Signed-off-by: Jaeyun <jy1210.jung@samsung.com>
4 years ago[Android/Test] test for dynamic dim
Jaeyun [Wed, 16 Sep 2020 09:05:35 +0000 (18:05 +0900)]
[Android/Test] test for dynamic dim

Update testcase about dynamic invoke, change dimension to 1 ~ 4.

Signed-off-by: Jaeyun <jy1210.jung@samsung.com>
4 years ago[Android] add dec-util for each decoder subplugins
Jaeyun [Wed, 16 Sep 2020 07:35:33 +0000 (16:35 +0900)]
[Android] add dec-util for each decoder subplugins

Recently common dec-util function is added, update Android mk to build each decoder sub-plugins.

Signed-off-by: Jaeyun <jy1210.jung@samsung.com>
4 years ago[tools/debugging] Add how to trace a specific NNStreamer element
Bumsik Kim [Thu, 10 Sep 2020 12:50:27 +0000 (05:50 -0700)]
[tools/debugging] Add how to trace a specific NNStreamer element

This patch adds a description on how to trace individual element

using silent property.

I personally found it useful while working on PR #2714.

Signed-off-by: Bumsik Kim <k.bumsik@gmail.com>
4 years ago[ext/tensor_decoder] Configure framerate caps for all tensor_decoders
Bumsik Kim [Thu, 10 Sep 2020 08:07:41 +0000 (01:07 -0700)]
[ext/tensor_decoder] Configure framerate caps for all tensor_decoders

This patch add framerate caps for in all tensor_decoder modes.

While I was testing the gst-launch examples, I noticed that framerate
caps are dropped by tensor_decoder elements.

There are two problems I can think of:

1. What is the right framerate policies for tensor_decoder? (1)
2. Framerate policies are inconsistent across the tensor_decoder modes.
Some passthrough framerate caps (e.g. tensordec-directvideo.c)
but the others drop framerate caps.

This patch tries to solve at least question 2 by letting them passthrough. I keep @todo tags
regarding question 1 (1) because I do not know how to verify if this policy is correct, though
I think this would be enough.

I made a function in tensordecutil.c to share the same code.

(1): https://github.com/nnstreamer/nnstreamer/blob/a1c9b45d1ac1f3a7b830df2fa17b962d88a128cf/ext/nnstreamer/tensor_decoder/tensordec-imagesegment.c#L303

Signed-off-by: Bumsik Kim <k.bumsik@gmail.com>
4 years ago[TF-lite] Check flatbuffer dependency when tf-lite is enabled.
Sangjung Woo [Thu, 10 Sep 2020 07:09:12 +0000 (00:09 -0700)]
[TF-lite] Check flatbuffer dependency when tf-lite is enabled.

This patch adds the dependency check of flatbuffer when tf-lite filter
is enabled. It shows developers more detailed information instead of a
simple build break log.

Signed-off-by: Sangjung Woo <sangjung.woo@samsung.com>
4 years ago[Filter/Python] Apply the change since v3.8 in the PyCore library name
Wook Song [Mon, 7 Sep 2020 06:27:37 +0000 (15:27 +0900)]
[Filter/Python] Apply the change since v3.8 in the PyCore library name

This patch applies the change since v3.8 in the PyCore library name
from libpythonX.Xm.so.1.0 to libpythonX.X.so.1.0.

Signed-off-by: Wook Song <wook16.song@samsung.com>
4 years ago[Meson] Use python3-embed when the version of given python3 is 3.8
Wook Song [Mon, 7 Sep 2020 05:45:18 +0000 (14:45 +0900)]
[Meson] Use python3-embed when the version of given python3 is 3.8

python3.pc no longer provides the Libs section required to use Python
C-API since v3.8. To resolve it, this patch modifies the meson build
script to change a dependency declaration on python3 to python3-embed
when the version of a given python is upper than v3.8.

Signed-off-by: Wook Song <wook16.song@samsung.com>
4 years ago[hw/accl] Move hardware dependent code out of tensor_filter
Parichay Kapoor [Tue, 8 Sep 2020 10:36:20 +0000 (19:36 +0900)]
[hw/accl] Move hardware dependent code out of tensor_filter

As per the comments received in #2651, this patch moves the hardware
dependent code out of the tensor filter.

V2:
Also updated bugfix for linux (non android, non tizen) arm build
for proper header inclusion.

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

Signed-off-by: Parichay Kapoor <pk.kapoor@samsung.com>
4 years ago[TF-lite] remove nnfw-delegate feature
Jaeyun [Wed, 9 Sep 2020 08:32:36 +0000 (17:32 +0900)]
[TF-lite] remove nnfw-delegate feature

NNFW delegate feature is unnecessary.
NNFW supports method to set backend and no more need to set NNFW-delegation in tf-lite plugin.

Signed-off-by: Jaeyun <jy1210.jung@samsung.com>
4 years agoStart of NNStreamear 1.7.0 development.
MyungJoo Ham [Wed, 9 Sep 2020 11:41:52 +0000 (20:41 +0900)]
Start of NNStreamear 1.7.0 development.

1.7.0 is 1.8.0-RC1.

x.ODD.y is developmental version.

Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
4 years agoRelease of NNStreamer 1.6.0 LTS accepted/tizen_6.0_unified_hotfix tizen_6.0_hotfix accepted/tizen/6.0/unified/20201030.112221 accepted/tizen/6.0/unified/hotfix/20201102.231751 accepted/tizen/unified/20200924.000956 submit/tizen/20200923.151633 submit/tizen_6.0/20201029.205503 submit/tizen_6.0_hotfix/20201102.192903 submit/tizen_6.0_hotfix/20201103.115103 tizen_6.0.m2_release v1.6.0
MyungJoo Ham [Fri, 14 Aug 2020 10:09:56 +0000 (19:09 +0900)]
Release of NNStreamer 1.6.0 LTS

This is NNStreamer 1.6.0 release along with
- Tizen 6.0 M2 release
- Android/Phone product release

We will release 1.6.0 after all the internal testing/verification
is completed.
Hotfixes after this may create NNStreamaer 1.6.y.

If new features are being merged after 1.6.0, we will
branch out 1.6.y branch and start 1.7.x development from
the main branch.

Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
4 years ago[Android] remove memcpy while converting java object
Jaeyun [Tue, 22 Sep 2020 08:48:43 +0000 (17:48 +0900)]
[Android] remove memcpy while converting java object

With no-alloc invoke function, creates java object for output tensors and set direct buffer address.

Signed-off-by: Jaeyun <jy1210.jung@samsung.com>
4 years ago[C-Api/Single] invoke no-alloc function
Jaeyun [Tue, 22 Sep 2020 07:29:40 +0000 (16:29 +0900)]
[C-Api/Single] invoke no-alloc function

Add new function to invoke the model with pre-allocated output data handle.

Signed-off-by: Jaeyun <jy1210.jung@samsung.com>
4 years ago[C-Api/Single] prepare no-alloc invoke
Jaeyun [Thu, 17 Sep 2020 10:46:55 +0000 (19:46 +0900)]
[C-Api/Single] prepare no-alloc invoke

Code clean, prepare new API to invoke the model with allocated output data handle.

Signed-off-by: Jaeyun <jy1210.jung@samsung.com>
4 years ago[Android] new function to create data object
Jaeyun [Thu, 17 Sep 2020 08:37:18 +0000 (17:37 +0900)]
[Android] new function to create data object

Prepare next version to reduce latency while converting the tensors.
Add new native function to create data object.

After implementing new single-shot API (no data alloc in invoke API), I will update Java invoke method to remove memcpy.

Signed-off-by: Jaeyun <jy1210.jung@samsung.com>
4 years ago[Meson] Enable fbs-support only if versions of flatc and libs are matched
Wook Song [Fri, 18 Sep 2020 05:42:38 +0000 (14:42 +0900)]
[Meson] Enable fbs-support only if versions of flatc and libs are matched

This patch revises meson.build to enable the flatbuf-support only if the
versions of flatc and libflatbuffers are matched.

Signed-off-by: Wook Song <wook16.song@samsung.com>
4 years ago[Meson] Add missing dependency in flatbuffer-support declaration
Wook Song [Tue, 15 Sep 2020 08:28:44 +0000 (17:28 +0900)]
[Meson] Add missing dependency in flatbuffer-support declaration

This patch adds the missing dependency in the flatbuffer-support feature
declaration.

Signed-off-by: Wook Song <wook16.song@samsung.com>
4 years ago[Tests/Meson] bugfix: Fix meson failure because of no dependency on GTEST
Wook Song [Mon, 14 Sep 2020 02:44:04 +0000 (11:44 +0900)]
[Tests/Meson] bugfix: Fix meson failure because of no dependency on GTEST

This patch fixes issue-2722, which is meson failure in some test cases
when there is no dependency on GTEST.

Signed-off-by: Wook Song <wook16.song@samsung.com>
4 years ago[Coverity] Fix unreachable codes
Dongju Chae [Thu, 10 Sep 2020 02:26:34 +0000 (11:26 +0900)]
[Coverity] Fix unreachable codes

This patch fixes unreachable codes reported by coverity.

Signed-off-by: Dongju Chae <dongju.chae@samsung.com>
4 years ago[Coverity] Fix CWE-466 (Lock) in tizensensor_get_property
Yongjoo Ahn [Thu, 10 Sep 2020 03:11:18 +0000 (12:11 +0900)]
[Coverity] Fix CWE-466 (Lock) in tizensensor_get_property

The conditions in `if` statements is guaranteed in the get_property function, so remove this part

Signed-off-by: Yongjoo Ahn <yongjoo1.ahn@samsung.com>
4 years ago[Coverity/Repo] Fix CWE-366 in tensor_repo
Wook Song [Thu, 10 Sep 2020 02:52:08 +0000 (11:52 +0900)]
[Coverity/Repo] Fix CWE-366 in tensor_repo

This patch fixes CWE-366 (Race Condition within a Thread) in
gst_tensor_repo_add_repodata () of tensor_repo.c.

Signed-off-by: Wook Song <wook16.song@samsung.com>
4 years ago[Coverity/Common] Fix CWE-476 in tensor_common
Wook Song [Thu, 10 Sep 2020 02:35:32 +0000 (11:35 +0900)]
[Coverity/Common] Fix CWE-476 in tensor_common

This patch fixes CWE-476 (NULL Pointer Dereference) in
gst_tensors_info_parse_names_string () of tensor_common.c.

Signed-off-by: Wook Song <wook16.song@samsung.com>
4 years ago[single/test] Add unittest for allocate_in_invoke free with single API submit/tizen/20200909.120309
Parichay Kapoor [Tue, 8 Sep 2020 07:51:48 +0000 (16:51 +0900)]
[single/test] Add unittest for allocate_in_invoke free with single API

This patch adds unittest for single API using tensor filters custom framework
which support allocate_in_invoke
Further, adds negative and positive unittests verifying that the output
memory can be allocated by the user or when the single API handle is closed

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

Signed-off-by: Parichay Kapoor <pk.kapoor@samsung.com>
4 years ago[single] Resolve tensor filter memory leak
Parichay Kapoor [Wed, 2 Sep 2020 14:17:04 +0000 (23:17 +0900)]
[single] Resolve tensor filter memory leak

When tensor filter with allocate in invoke allocate the memory,
its memory should be destroyed with the filters destroy notify
However, this was ignored till now for single API (#2593)

This patch fixes this
Single handle now creates a list of each such data buffer
as well as the single handle is stored in the data buffer.
If data buffer is deallocated, then destroyNotify is called from the
single handle stored in it.
However, if single handle is closed before data buffer is freed,
then all the memory is freed from the list of the data buffers
stored in the single handle.

Resolves #2593

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

Signed-off-by: Parichay Kapoor <pk.kapoor@samsung.com>
4 years ago[Android] reduce method call
Jaeyun [Wed, 9 Sep 2020 03:55:13 +0000 (12:55 +0900)]
[Android] reduce method call

While converting tensor data, reduce method call to set each tensor.

Signed-off-by: Jaeyun <jy1210.jung@samsung.com>
4 years ago[Dist/debian] Fix nnstreamer install files
gichan-jang [Tue, 8 Sep 2020 09:33:57 +0000 (18:33 +0900)]
[Dist/debian] Fix nnstreamer install files

Since nnstreamer-protobuf package seperated from nnstreamer package, fix SO list of nnstreamer.

Signed-off-by: gichan-jang <gichan2.jang@samsung.com>
4 years ago[Android/NNFW] parse option
Jaeyun [Thu, 3 Sep 2020 11:59:55 +0000 (20:59 +0900)]
[Android/NNFW] parse option

add new constructor and parse option string in NNFW sub-plugin.

Signed-off-by: Jaeyun <jy1210.jung@samsung.com>
4 years ago[Filter/NNFW] call close when failed to open model
Jaeyun [Fri, 4 Sep 2020 03:10:30 +0000 (12:10 +0900)]
[Filter/NNFW] call close when failed to open model

Code clean, call _close() function when failed to open the model file.

Signed-off-by: Jaeyun <jy1210.jung@samsung.com>
4 years ago[Android/Build] remove unnecessary file
Jaeyun [Tue, 8 Sep 2020 02:24:22 +0000 (11:24 +0900)]
[Android/Build] remove unnecessary file

android template (proguard rule) is unnecessary, remove this file.

Signed-off-by: Jaeyun <jy1210.jung@samsung.com>
4 years ago[SVACE] fix svace issue
Jaeyun [Tue, 8 Sep 2020 05:05:36 +0000 (14:05 +0900)]
[SVACE] fix svace issue

reset private data after deallocation.

Signed-off-by: Jaeyun <jy1210.jung@samsung.com>
4 years agoonert(nnfw) uses 'cpu;bcq' as default backend
Chunseok Lee [Thu, 3 Sep 2020 07:30:36 +0000 (16:30 +0900)]
onert(nnfw) uses 'cpu;bcq' as default backend

For now, there is no api to use bcq backend from android java
application. Thus, as a workaround, set 'cpu;bcq' as a deafult backend.

Signed-off-by: Chunseok Lee <chunseok.lee@samsung.com>
4 years ago[Android/NNFW] update version
Jaeyun [Tue, 8 Sep 2020 02:41:42 +0000 (11:41 +0900)]
[Android/NNFW] update version

Change NNFW version to 1.9.0.

Signed-off-by: Jaeyun <jy1210.jung@samsung.com>
4 years ago[Android/NNFW/Build] nnfw headers accepted/tizen/unified/20200908.060825 submit/tizen/20200908.012805
Jaeyun [Mon, 7 Sep 2020 04:39:02 +0000 (13:39 +0900)]
[Android/NNFW/Build] nnfw headers

download and extract nnfw headers from devel pkg.

Signed-off-by: Jaeyun <jy1210.jung@samsung.com>
4 years ago[Android/NNFW] nnfw prebuilt libs
Jaeyun [Fri, 4 Sep 2020 05:15:58 +0000 (14:15 +0900)]
[Android/NNFW] nnfw prebuilt libs

It is unnecessary to link all nnfw prebuilt libs. Only nnfw-dev requires to build aar.
This may fix unexpected error in nnfw runtime env.

Signed-off-by: Jaeyun <jy1210.jung@samsung.com>
4 years ago[Android/SNPE] Modify SNPE prebuilt libs
Yongjoo Ahn [Fri, 4 Sep 2020 08:55:03 +0000 (17:55 +0900)]
[Android/SNPE] Modify SNPE prebuilt libs

- We do not need to link all snpe prebuilt libs: only libSNPE requires to build aar
- Move excluded libs to jniLibs

Signed-off-by: Yongjoo Ahn <yongjoo1.ahn@samsung.com>
4 years ago[Filter/NNFW] directory as model parameter
Jaeyun [Thu, 3 Sep 2020 07:41:10 +0000 (16:41 +0900)]
[Filter/NNFW] directory as model parameter

Support model path as model property for NNFW.

NNFW requires model path to open model.
Current tensor-filter and API does not allow directory string.
Check the model property and if it is directory, set framework to NNFW.

Signed-off-by: Jaeyun <jy1210.jung@samsung.com>
4 years ago[NNFW] remove json-glib dependency
Jaeyun [Tue, 1 Sep 2020 05:44:26 +0000 (14:44 +0900)]
[NNFW] remove json-glib dependency

json-glib dependency is unnecessary when removing metadata validation in NNFW sub-plugin.

Signed-off-by: Jaeyun <jy1210.jung@samsung.com>
4 years ago[Filter/NNFW] remove metadata validation
Jaeyun [Tue, 1 Sep 2020 05:36:11 +0000 (14:36 +0900)]
[Filter/NNFW] remove metadata validation

ONE team requests to remove metadata validation.
Remove metadata validation in NNFW sub-plugin.

Signed-off-by: Jaeyun <jy1210.jung@samsung.com>
4 years ago[Clamp/UnitTest] Add testcases for transform clamp mode
Dongju Chae [Wed, 2 Sep 2020 04:22:03 +0000 (13:22 +0900)]
[Clamp/UnitTest] Add testcases for transform clamp mode

This patch adds ssat testcases for trasnfrom clamp mode.

Signed-off-by: Dongju Chae <dongju.chae@samsung.com>
4 years ago[Clamp] Support 'clamp' as tensor_transform's option
Dongju Chae [Fri, 28 Aug 2020 08:00:37 +0000 (17:00 +0900)]
[Clamp] Support 'clamp' as tensor_transform's option

This patch supports 'clamp' as tensor_transform's option.
It requires min/max values to apply clamp for input tensor data.

The usage is like below:
... ! tensor_transform mode=clamp option=-123.902313:150.837601 ! ...

Signed-off-by: Dongju Chae <dongju.chae@samsung.com>
4 years ago[filter] Independency on order of the properties
Parichay Kapoor [Fri, 14 Aug 2020 12:51:01 +0000 (21:51 +0900)]
[filter] Independency on order of the properties

This patch adds independence on the order of setting the properties
Properties of tensor filter which depends on the framework can now be set before setting the framework as well
When setting the framework, these properties are set again from the cache

Resolves #2650

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

Signed-off-by: Parichay Kapoor <pk.kapoor@samsung.com>
4 years ago[ext/nnfw] Check availability of neon at runtime
Parichay Kapoor [Tue, 18 Aug 2020 02:27:56 +0000 (11:27 +0900)]
[ext/nnfw] Check availability of neon at runtime

This patch adds checking the availability of NEON SIMD instructions on the machine
at runtime. If the NEON is not found, the auto accelerator of NEON backend is switched
to basic CPU. However, the NEON is still in the supported list of backends, and this
does not limit user from setting the backend of NEON even though its not available.

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

Signed-off-by: Parichay Kapoor <pk.kapoor@samsung.com>
4 years ago[tf_support] Change assert to throw/try/catch
Parichay Kapoor [Tue, 18 Aug 2020 07:25:13 +0000 (16:25 +0900)]
[tf_support] Change assert to throw/try/catch

Update assert to throw and catch them later before returning to the C-API.
This is required while setting the cached properties.

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

Signed-off-by: Parichay Kapoor <pk.kapoor@samsung.com>
4 years ago[Bug/TensorSplit] Fix the offset calculation bug
Dongju Chae [Wed, 2 Sep 2020 07:50:31 +0000 (16:50 +0900)]
[Bug/TensorSplit] Fix the offset calculation bug

This patch fixes the offset calculation bug in tensor split

Signed-off-by: Dongju Chae <dongju.chae@samsung.com>
4 years ago[Android] deallocate direct buffer
Jaeyun [Tue, 1 Sep 2020 11:51:30 +0000 (20:51 +0900)]
[Android] deallocate direct buffer

Direct buffer allocated from native will not release the buffer.
Create instance in java and set byte array, then call method to add tensor data.

Signed-off-by: Jaeyun <jy1210.jung@samsung.com>
4 years ago[Filter/TF] fix deallocator ptr
Jaeyun [Tue, 1 Sep 2020 06:46:09 +0000 (15:46 +0900)]
[Filter/TF] fix deallocator ptr

fix function ptr when creating new tensor struct in tf sub-plugin.

Signed-off-by: Jaeyun <jy1210.jung@samsung.com>
4 years ago[CodeClean] fix coverity issue
Jaeyun [Tue, 1 Sep 2020 09:00:49 +0000 (18:00 +0900)]
[CodeClean] fix coverity issue

check return value when setting conf path after test is done.

Signed-off-by: Jaeyun <jy1210.jung@samsung.com>
4 years ago[Docs] Add a '%' before http
Sangjung Woo [Thu, 27 Aug 2020 07:32:55 +0000 (16:32 +0900)]
[Docs] Add a '%' before http

This patch adds a '%' before http to avoid html link. It is related to
Tizen public header issue.

Signed-off-by: Sangjung Woo <sangjung.woo@samsung.com>
4 years ago[Stand/Typo] Fix a minor typo in 'stand' transform desc
Dongju Chae [Fri, 28 Aug 2020 08:07:11 +0000 (17:07 +0900)]
[Stand/Typo] Fix a minor typo in 'stand' transform desc

This patch fixes a minor typo in 'stand' transform desc.

Signed-off-by: Dongju Chae <dongju.chae@samsung.com>
4 years ago[android/test] Remove recently added testcases
Yongjoo Ahn [Tue, 25 Aug 2020 12:08:37 +0000 (21:08 +0900)]
[android/test] Remove recently added testcases

- Currently, the exception from tensor_filter is not handled properly in naive api
- It causes test failure in specific build setting, so remove it

Signed-off-by: Yongjoo Ahn <yongjoo1.ahn@samsung.com>
4 years ago[android/build] Remove unnecessary build flag
Yongjoo Ahn [Tue, 25 Aug 2020 12:02:16 +0000 (21:02 +0900)]
[android/build] Remove unnecessary build flag

- Remove `-Wno-exceptions` flag from Android-snpe.mk

Signed-off-by: Yongjoo Ahn <yongjoo1.ahn@samsung.com>