platform/upstream/nnstreamer.git
2 years ago[Conf] subplugin path from extra conf
Jaeyun [Tue, 17 May 2022 09:30:01 +0000 (18:30 +0900)]
[Conf] subplugin path from extra conf

Add subplugin path loaded from extra config file.

Signed-off-by: Jaeyun <jy1210.jung@samsung.com>
2 years ago[Python] path to python helper lib
Jaeyun [Tue, 17 May 2022 05:17:25 +0000 (14:17 +0900)]
[Python] path to python helper lib

Change install path for python-helper library.
This is to fix library link error.

Signed-off-by: Jaeyun <jy1210.jung@samsung.com>
2 years ago[TEST] Add assertion test.
gichan [Fri, 13 May 2022 06:17:32 +0000 (15:17 +0900)]
[TEST] Add assertion test.

Instead of unwinding the macro, add assertion.

Signed-off-by: gichan <gichan2.jang@samsung.com>
2 years ago[TEST] Unwinding macro to avoid no assertion test.
gichan [Fri, 13 May 2022 03:15:44 +0000 (12:15 +0900)]
[TEST] Unwinding macro to avoid no assertion test.

Some code quality analyer check no assertion test.
testTesnrSparse_utilConvert has assert test, the analyer cannnot check
macro.
So, to avoid the false-positive case, unwinding macro.

Signed-off-by: gichan <gichan2.jang@samsung.com>
2 years ago[Test] Add palm detection decoder test
Sangjung Woo [Thu, 12 May 2022 01:39:40 +0000 (10:39 +0900)]
[Test] Add palm detection decoder test

This patch newly adds the palm detection decoder test script.

Signed-off-by: Sangjung Woo <sangjung.woo@samsung.com>
2 years ago[Decoder/BoundingBox] Add binary test data of palm detection
Sangjung Woo [Wed, 11 May 2022 14:36:45 +0000 (23:36 +0900)]
[Decoder/BoundingBox] Add binary test data of palm detection

This patch adds the binary test data for palm detection.

Signed-off-by: Sangjung Woo <sangjung.woo@samsung.com>
2 years ago[filter/snpe] Add custom option "MaxResizableDim"
Yongjoo Ahn [Thu, 28 Apr 2022 04:44:17 +0000 (13:44 +0900)]
[filter/snpe] Add custom option "MaxResizableDim"

- Some snpe models have "0" dim to represent resizable dim.
- Add a custom option to deal with this case.

Signed-off-by: Yongjoo Ahn <yongjoo1.ahn@samsung.com>
2 years ago[filter/snpe] Make the order of output tensors be consistent with the user given...
Yongjoo Ahn [Tue, 19 Apr 2022 09:22:30 +0000 (18:22 +0900)]
[filter/snpe] Make the order of output tensors be consistent with the user given option

- For multiple output models, let user set output tensors instead of
  output layers
- And make the order of input / output tensors be consistent.

Signed-off-by: Yongjoo Ahn <yongjoo1.ahn@samsung.com>
2 years ago[meson] Remove unnecessary dependency
gichan [Mon, 9 May 2022 05:31:46 +0000 (14:31 +0900)]
[meson] Remove unnecessary dependency

Remove unnecessary dependency from single-shot package.

Signed-off-by: gichan <gichan2.jang@samsung.com>
2 years ago[Svace] check null ptr
Jaeyun [Fri, 6 May 2022 07:24:00 +0000 (16:24 +0900)]
[Svace] check null ptr

Fix svace issue, check null ptr - allocation failure case in log util.

Signed-off-by: Jaeyun <jy1210.jung@samsung.com>
2 years ago[Edge] header for nns-edge
Jaeyun [Fri, 1 Apr 2022 11:14:53 +0000 (20:14 +0900)]
[Edge] header for nns-edge

initial commit to implement internal library for nnstreamer edge based on glib.

Signed-off-by: Jaeyun <jy1210.jung@samsung.com>
2 years agotest: disable converter test if python is not available.
MyungJoo Ham [Wed, 4 May 2022 03:20:04 +0000 (12:20 +0900)]
test: disable converter test if python is not available.

converter test uses python scripts.
disable converter test if python is not available.

Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
2 years ago[TEST/ntp] Add ntp unittest using GMock.
gichan [Tue, 19 Apr 2022 10:24:08 +0000 (19:24 +0900)]
[TEST/ntp] Add ntp unittest using GMock.

Add ntp uniitest using GMock.

Signed-off-by: gichan <gichan2.jang@samsung.com>
2 years agoStart Development of NNStreamer 2.1.1 (2.2 RC2)
MyungJoo Ham [Wed, 13 Apr 2022 08:41:43 +0000 (17:41 +0900)]
Start Development of NNStreamer 2.1.1 (2.2 RC2)

This is the version marking for 2.1.1 development start.
As 2.1.0 is started on Sep 28 2021, the change is huge.

2.1.0 -> 2.1.1
- Tizen 7.0 M1 RCx preparation and NNStreamer Mini Summit 2022-04 release.

- NNStreamer-Edge refactoring (module for Among-Device AI (a.k.a. Edge-AI))
        - Ongoing effort of nnstreamer-edge separation from nnstreamer.
        - In the future, nnstreamer-edge will provide among-device AI functions and nnstreamer will provide gstreamer plugins for such functions. Non-gstreamer systems may connect to nnstreamer-edge based pipelines without gstreamer as clients.
        - NNStreamer-Edge will be using AITT as its default backend, leaving protocol issues to AITT.
        - In the future, nnstreamer-edge will be compatible with non-Linux ultra-lightweight systems (e.g., Tizen-RT)

- ML-Service API preparation is going on at api.git.

- Major features
        - MQTT timestaamping w/ NTP. (later will be migrated to nnstreamer-edge & aitt)
        - Query (later will be migrated to nnstreamer-edge & aitt): robustness support, mqtt-hybrid protocol, performance fixes for multi-clients.
        - More coverage for SNPE support: quantized model support, SNPE dimension bug workaround, fixes from/for production team.
        - Flexible tensor support w/ decoder, converter, flatbuffer.

- Minor features
        - MQTT unittest basis, generic stream support, android support, timeout handling, ... (and many!)
        - Utility functions exported for plugin writers.
        - Tensorflow-lite delegation refactored for generality: may use XNNPACK more easily.
        - Tensorflow-lite multi-lib support.
        - PyTorch: support complex output tensor formats.
        - NNStreamer multi-lib support.
        - Decoder: boundingbox-yolov5
        - Filter: TRIx-Engine support. (NPUs of Samsung 2022 TV)
        - Docker support refactored and cleaned up.

- Fixes
        - ARMNN build errors.
        - Android errors
        - Build errors with recent compiler updates. (gcc 11)
        - Fixes upstreamed from productions
        - Errors w/ library updates: Lua >= 5.3, GLib >= 2.68
        - Regression fixes: openvino, edgetpu, tensorrt
        - Memory leaks in C++ subplugin infra.

- Known issues: PPA/Launchpad build broken!

Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
2 years agoclang workaround of vsnprintf
MyungJoo Ham [Wed, 13 Apr 2022 09:52:54 +0000 (18:52 +0900)]
clang workaround of vsnprintf

With clang in macos:

/Users/runner/work/nnstreamer/nnstreamer/gst/nnstreamer/nnstreamer_log.c:97:48: error: format string is not a string literal [-Werror,-Wformat-nonliteral]
  vsnprintf (errmsg, _NNSTREAMER_ERROR_LENGTH, fmt, arg_ptr);
                                               ^~~
/Applications/Xcode_13.2.1.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/secure/_stdio.h:75:63: note: expanded from macro 'vsnprintf'
  __builtin___vsnprintf_chk (str, len, 0, __darwin_obsz(str), format, ap)
                                                              ^~~~~~
1 error generated.

Add a workaround from
https://stackoverflow.com/questions/20167124/vsprintf-and-vsnprintf-wformat-nonliteral-warning-on-clang-5-0

Note: gst-indent is applying indentation very strangely with __attribute__

Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
2 years agocommon/api_util_impl: use internal error infra.
MyungJoo Ham [Wed, 13 Apr 2022 07:40:33 +0000 (16:40 +0900)]
common/api_util_impl: use internal error infra.

Save the internal error/info/warning message so that
caller may use the info for actual error message.

Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
2 years agofilter/core: elaborate error messages.
MyungJoo Ham [Wed, 30 Mar 2022 10:12:59 +0000 (19:12 +0900)]
filter/core: elaborate error messages.

Elaborate error and warning messages so that users and developers
can easily point out and fix issues.

Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
2 years agocommon/log: backtrace, internal err log
MyungJoo Ham [Wed, 30 Mar 2022 10:12:08 +0000 (19:12 +0900)]
common/log: backtrace, internal err log

For debugging messages, add a backtrace function and internal err logging.

Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
2 years ago[TEST] Skip query test temporarily
yelini-jeong [Mon, 25 Apr 2022 07:03:04 +0000 (16:03 +0900)]
[TEST] Skip query test temporarily

This patch skips query test temporarily because of ppa build failure.

Signed-off-by: yelini-jeong <yelini.jeong@samsung.com>
2 years ago[Decoder] integ division accepted/tizen/unified/20220426.132012 submit/tizen/20220425.043951 submit/tizen/20220426.050006
Jaeyun [Fri, 22 Apr 2022 09:29:40 +0000 (18:29 +0900)]
[Decoder] integ division

Convert float value to get the object.

Signed-off-by: Jaeyun <jy1210.jung@samsung.com>
2 years ago[TEST/mqtt] Run get/set property test w/o mqtt broker submit/tizen/20220422.081403
gichan [Tue, 19 Apr 2022 07:09:51 +0000 (16:09 +0900)]
[TEST/mqtt] Run get/set property test w/o mqtt broker

 - Run get/set property test without mqtt broker.
 - Add ntp prop set/get test.

Signed-off-by: gichan <gichan2.jang@samsung.com>
2 years ago[decoder/bounding_box] Support decoder for mediapipe palm detection
Jiho Chu [Fri, 8 Apr 2022 06:40:46 +0000 (15:40 +0900)]
[decoder/bounding_box] Support decoder for mediapipe palm detection

MP_PALM_DETECTION decoder for bounding box mode is presented. The model and
algorithm is based on mediapipe palm detection model and its
implementation.

Signed-off-by: Jiho Chu <jiho.chu@samsung.com>
2 years ago[Filter] unnecessary initialization
Jaeyun [Tue, 12 Apr 2022 06:43:17 +0000 (15:43 +0900)]
[Filter] unnecessary initialization

Remove unnecessary init while parsing accel string.
- fetch fw info to parse accel for the case if nn framework is not opened.
- check fw info if open() callback of nn framework is not written.

Signed-off-by: Jaeyun <jy1210.jung@samsung.com>
2 years ago[CodeClean] fix svace issue
Jaeyun [Wed, 20 Apr 2022 06:01:38 +0000 (15:01 +0900)]
[CodeClean] fix svace issue

Fix svace issue - uninitialized variable.

Signed-off-by: Jaeyun <jy1210.jung@samsung.com>
2 years ago[Doc] Change CI server domain name
gichan [Wed, 20 Apr 2022 01:43:12 +0000 (10:43 +0900)]
[Doc] Change CI server domain name

Change CI server domain name from nnstreamer.mooo.com to ci.nnstreamer.ai

Signed-off-by: gichan <gichan2.jang@samsung.com>
2 years ago[test/transform] Add tests for per-channel
Yongjoo Ahn [Thu, 14 Apr 2022 09:19:14 +0000 (18:19 +0900)]
[test/transform] Add tests for per-channel

- Add simple unittests for per-channel operation
- Add a SSAT testcase making red RGB image with per-channel operation

Signed-off-by: Yongjoo Ahn <yongjoo1.ahn@samsung.com>
2 years ago[transform] Add per-channel feature for arithmetic op
Yongjoo Ahn [Tue, 12 Apr 2022 02:14:07 +0000 (11:14 +0900)]
[transform] Add per-channel feature for arithmetic op

- Add "per-channel" arithmetic op (see #3711 for details)
- The syntax:
```
tensor_transform mode=arithmetic
option=typecast:float32,per-channel:true@DIM,add:A1@CH,div:D1@CH
```
- DIM means the dimension which is viewed as channel
ex) For 3:4:4:1 incomming tensor, per-channel:true@0 means 0-th DIM
(value is 3) is the channel
- CH means the idx of channel that given operation is applied. If @CH is
  missing, the operation is applied to all channels.
ex) add:255@0 means add 255 to the 0-th channel (which is R among the
RGB)

- Usage example:
```
$ gst-launch-1.0 videotestsrc pattern=2 num-buffers=1 ! videoscale !
videoconvert ! video/x-raw,format=RGB,width=2,height=2 !
tensor_converter ! tensor_transform mode=arithmetic
option=typecast:float32,per-channel:true@0,add:1.5@0,add:2.5@1,mul:2 ! filesink
location=out.log

$ od -f out.log
0000000               3               5               0               3
0000020               5               0               3               5
0000040               0               3               5               0
0000060
```

Signed-off-by: Yongjoo Ahn <yongjoo1.ahn@samsung.com>
2 years ago[Tests/Rate] Apply test fixture to remove duplicate code
Sangjung Woo [Wed, 6 Apr 2022 12:14:39 +0000 (21:14 +0900)]
[Tests/Rate] Apply test fixture to remove duplicate code

To remove duplicate code in each test case, this patch applies
the test fixture framework of Google Test. It increases
maintainability and modifiability.

Signed-off-by: Sangjung Woo <sangjung.woo@samsung.com>
2 years ago[Test/Single] Apply test fixture to remove duplicate code
Sangjung Woo [Wed, 6 Apr 2022 01:59:46 +0000 (10:59 +0900)]
[Test/Single] Apply test fixture to remove duplicate code

To remove duplicate code in each test case, this patch applies the test
fixture framework. Moreover, g_autofree macro is used for allocated
space to be freed automatically no matter test case is passed or not.

Signed-off-by: Sangjung Woo <sangjung.woo@samsung.com>
2 years ago[subplugin] g_module_open with LOCAL flag (instead of GLOBAL)
Yongjoo Ahn [Mon, 18 Apr 2022 07:11:27 +0000 (16:11 +0900)]
[subplugin] g_module_open with LOCAL flag (instead of GLOBAL)

- When tf1-lite and tf2-lite both are present, the later called
  subplugin is not initalized. It's because the constructor functions
  are same as "init_filter_tflite".
  e.g.) `g_module_open (...tf1lite.so, 0)` will call "init_filter_tflite" of
  tf2lite.so.
- This resolves #3709

Signed-off-by: Yongjoo Ahn <yongjoo1.ahn@samsung.com>
2 years ago[README] Fix daily build log link accepted/tizen/unified/20220419.142310 submit/tizen/20220418.053521
gichan [Thu, 14 Apr 2022 05:39:38 +0000 (14:39 +0900)]
[README] Fix daily build log link

 - Fix invalid log link of the ubuntu daily build.
 - Change link of the badges to daily log path.

Signed-off-by: gichan <gichan2.jang@samsung.com>
2 years ago[CodeClean] fix svace issue
Jaeyun [Fri, 8 Apr 2022 02:52:19 +0000 (11:52 +0900)]
[CodeClean] fix svace issue

1. Set interpreter lock while replacing interpreter in tf-lite sub-plugin.
2. Remove unreached code in converter.
3. Clearly check file ext (bmp) in test util.

Signed-off-by: Jaeyun <jy1210.jung@samsung.com>
2 years ago[CodeClean] fix svace issue
Jaeyun [Thu, 7 Apr 2022 09:18:03 +0000 (18:18 +0900)]
[CodeClean] fix svace issue

Code clean, fix svace issue in testcase.
- count failure while loading data from file.

Signed-off-by: Jaeyun <jy1210.jung@samsung.com>
2 years ago[Filter] svace issue
Jaeyun [Thu, 7 Apr 2022 11:54:01 +0000 (20:54 +0900)]
[Filter] svace issue

Fix svace issue - dereference after null check.

Signed-off-by: Jaeyun <jy1210.jung@samsung.com>
2 years agoFix ubuntu meson build github action
MyungJoo Ham [Tue, 5 Apr 2022 01:31:33 +0000 (10:31 +0900)]
Fix ubuntu meson build github action

Fixed syntax error.
Run test action.

todo: register unit tests properly for meson test.
Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
2 years ago[Filter] Reload shared model
Junhwan Kim [Wed, 18 Aug 2021 07:32:06 +0000 (16:32 +0900)]
[Filter] Reload shared model

Support model reload for shared model
- Update common method to replace interpreter for instances sharing the key

Signed-off-by: Junhwan Kim <jejudo.kim@samsung.com>
2 years agogithub-action: Ubuntu clean meson build test
MyungJoo Ham [Wed, 30 Mar 2022 02:17:07 +0000 (11:17 +0900)]
github-action: Ubuntu clean meson build test

Test build & TC in a latest Ubuntu system with meson/ninja clean build.

Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
2 years agogithub-action: macos build
MyungJoo Ham [Wed, 30 Mar 2022 03:29:57 +0000 (12:29 +0900)]
github-action: macos build

Add macos build github action with brew

Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
2 years agotest: ppa/armhf timeout
MyungJoo Ham [Wed, 30 Mar 2022 10:24:32 +0000 (19:24 +0900)]
test: ppa/armhf timeout

We have the following error at PPA for armhf build:
```
../tests/nnstreamer_converter/unittest_converter.cc:409: Failure
Value of: wait_pipeline_process_buffers (data_received, 1, TEST_TIMEOUT_MS)
  Actual: false
Expected: true
../tests/nnstreamer_converter/unittest_converter.cc:414: Failure
Expected: (caps) != (nullptr), actual: NULL vs 4-byte object <00-00 00-00>

(unittest_converter:16055): GStreamer-CRITICAL **: 06:06:01.349: gst_caps_get_structure: assertion 'GST_IS_CAPS (caps)' failed
../tests/nnstreamer_converter/unittest_converter.cc:416: Failure
Expected: (structure) != (nullptr), actual: NULL vs 4-byte object <00-00 00-00>

** (unittest_converter:16055): CRITICAL **: 06:06:01.351: gst_tensors_config_from_structure: assertion 'structure != NULL' failed
../tests/nnstreamer_converter/unittest_converter.cc:418: Failure
      Expected: 1U
      Which is: 1
To be equal to: config.info.num_tensors
      Which is: 0
```

Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
2 years agoconverter: elaborate error messages
MyungJoo Ham [Tue, 8 Mar 2022 09:40:12 +0000 (18:40 +0900)]
converter: elaborate error messages

When there is a pipeline error, especially at the construct phase,
users need elaborated error messages that provide useful infomation
to correct pipeline descriptions.

Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
2 years agocommon: to_string() for tensors_config & tensors_info
MyungJoo Ham [Tue, 22 Mar 2022 08:53:26 +0000 (17:53 +0900)]
common: to_string() for tensors_config & tensors_info

For debugging and logging purposes,
add to_string() functions for tensors-config and tensors-info
structures.

Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
2 years agoDoc: data-types update with 2.0
MyungJoo Ham [Mon, 28 Feb 2022 07:56:14 +0000 (16:56 +0900)]
Doc: data-types update with 2.0

NNStreamer 2.0 has updated data types significantly.
Update the documents accordingly.

Fixes #3661

Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
2 years agofilter:pytorch: use %G_GSIZE_FORMAT for printing gsize
MyungJoo Ham [Tue, 29 Mar 2022 07:25:42 +0000 (16:25 +0900)]
filter:pytorch: use %G_GSIZE_FORMAT for printing gsize

There are different definitions for gsize.
Use %G_GSIZE_FORMAT for the portability
Note that #3699 was not portable enough.

Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
2 years agoCODEOWNERS: update reviewer list
MyungJoo Ham [Tue, 29 Mar 2022 03:27:30 +0000 (12:27 +0900)]
CODEOWNERS: update reviewer list

We have new members and members quiting.

Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
2 years agofilter:pytorch: armhf error in PPA (print format)
MyungJoo Ham [Mon, 28 Mar 2022 02:30:56 +0000 (11:30 +0900)]
filter:pytorch: armhf error in PPA (print format)

Fix the print format string error:
```
In file included from /usr/include/glib-2.0/glib.h:62:0,
                 from ../gst/nnstreamer/nnstreamer_log.h:75,
                 from /<<PKGBUILDDIR>>/ext/nnstreamer/tensor_filter/tensor_filter_pytorch.cc:29:
/<<PKGBUILDDIR>>/ext/nnstreamer/tensor_filter/tensor_filter_pytorch.cc: In member function â€˜int TorchCore::validateOutputTensor(at::Tensor, unsigned int)’:
/usr/include/glib-2.0/glib/gmessages.h:336:43: error: format â€˜%ld’ expects argument of type â€˜long int’, but argument 5 has type â€˜gsize {aka unsigned int}’ [-Werror=format=]
                                __VA_ARGS__)
                                           ^
../gst/nnstreamer/nnstreamer_log.h:79:17: note: in expansion of macro â€˜g_critical’
 #define ml_loge g_critical
                 ^~~~~~~~~~
/<<PKGBUILDDIR>>/ext/nnstreamer/tensor_filter/tensor_filter_pytorch.cc:348:5: note: in expansion of macro â€˜ml_loge’
     ml_loge ("Invalid output meta: different element size at index %d. Found size %ld while expecting size %ld. Update the tensor shape/size to resolve the error.",
     ^~~~~~~
/usr/include/glib-2.0/glib/gmessages.h:336:43: error: format â€˜%ld’ expects argument of type â€˜long int’, but argument 6 has type â€˜gsize {aka unsigned int}’ [-Werror=format=]
                                __VA_ARGS__)
                                           ^
../gst/nnstreamer/nnstreamer_log.h:79:17: note: in expansion of macro â€˜g_critical’
 #define ml_loge g_critical
                 ^~~~~~~~~~
/<<PKGBUILDDIR>>/ext/nnstreamer/tensor_filter/tensor_filter_pytorch.cc:348:5: note: in expansion of macro â€˜ml_loge’
     ml_loge ("Invalid output meta: different element size at index %d. Found size %ld while expecting size %ld. Update the tensor shape/size to resolve the error.",
     ^~~~~~~
```

Related with #3698

Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
2 years ago[test/snpe] Add unittest for snpe filter's user buffer mode
Yongjoo Ahn [Thu, 17 Mar 2022 11:25:06 +0000 (20:25 +0900)]
[test/snpe] Add unittest for snpe filter's user buffer mode

- Add two simple cases to test user buffer execution

Signed-off-by: Yongjoo Ahn <yongjoo1.ahn@samsung.com>
2 years ago[filter/snpe] Support "user supplied buffer" for snpe
Yongjoo Ahn [Tue, 15 Mar 2022 07:44:30 +0000 (16:44 +0900)]
[filter/snpe] Support "user supplied buffer" for snpe

- Support "userbuffer" for snpe filter
- With this mode, the memcpy from/into model's input/output does not occur
- Note that it only supports float type

Signed-off-by: Yongjoo Ahn <yongjoo1.ahn@samsung.com>
2 years ago[converter/python3] Temporarily remove Py_Finalize
gichan [Fri, 18 Mar 2022 09:34:28 +0000 (18:34 +0900)]
[converter/python3] Temporarily remove Py_Finalize

Tizen issues: After python version has been upgraded from 3.9.1 to 3.9.10, python converter is stopped at Py_Finalize.
Since Py_Initialize is not called twice from this object, Py_Finalize is temporarily removed.

Signed-off-by: gichan <gichan2.jang@samsung.com>
2 years agoRevert "[TEST] Disable python converter tests."
gichan [Fri, 18 Mar 2022 06:38:33 +0000 (15:38 +0900)]
Revert "[TEST] Disable python converter tests."

This reverts commit 96142d9582507784fc11bb115bc117f34eed625b.

Signed-off-by: gichan <gichan2.jang@samsung.com>
2 years agofilter/pytorch,caffe2: they have redundant decls.
MyungJoo Ham [Thu, 17 Mar 2022 03:26:12 +0000 (12:26 +0900)]
filter/pytorch,caffe2: they have redundant decls.

Add -Wredundant-decl only when !(pytorch or caffe2), not !(pytorch and caffe2).
Even when only one of the two are included, they have redundant decl warnings.
It appears that we haven't tested cases where only one of pytorch and caffe2 is
enabled.

Fixes #3693

Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
2 years agodoc: update README and products
MyungJoo Ham [Mon, 7 Mar 2022 09:27:41 +0000 (18:27 +0900)]
doc: update README and products

- Update paper link
- Update support hardware
- Update product lists

Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
2 years ago[Build/PyUtil] dependency to py-util
Jaeyun [Tue, 8 Mar 2022 11:37:14 +0000 (20:37 +0900)]
[Build/PyUtil] dependency to py-util

Add link to python util library in meson.

Signed-off-by: Jaeyun <jy1210.jung@samsung.com>
2 years ago[CodeClean/Python] possible leak in python subbplugin
Jaeyun [Mon, 7 Mar 2022 09:37:13 +0000 (18:37 +0900)]
[CodeClean/Python] possible leak in python subbplugin

Code clean,
1. possible leak and exception to load python module.
2. remove unnecessary macro.

Signed-off-by: Jaeyun <jy1210.jung@samsung.com>
2 years ago[TEST/cpp] Wait until pipeline save the files
gichan [Thu, 3 Mar 2022 01:47:41 +0000 (10:47 +0900)]
[TEST/cpp] Wait until pipeline save the files

Wait until pipeline save the files.

Signed-off-by: gichan <gichan2.jang@samsung.com>
2 years ago[build/tflite] Check each delegate symbol in build time
Yongjoo Ahn [Fri, 4 Mar 2022 09:02:20 +0000 (18:02 +0900)]
[build/tflite] Check each delegate symbol in build time

- Check each tflite delegate symbol by linking with tflite dep in build time

Signed-off-by: Yongjoo Ahn <yongjoo1.ahn@samsung.com>
2 years ago[Log] exporting logger
Jaeyun [Thu, 3 Mar 2022 08:25:56 +0000 (17:25 +0900)]
[Log] exporting logger

Log util is available only in nnstreamer repo.
Remove exporting the header for logging.

Signed-off-by: Jaeyun <jy1210.jung@samsung.com>
2 years ago[SSAT] Enable filter_python3 test to run on target
Aymen Sghaier [Tue, 1 Mar 2022 14:12:37 +0000 (15:12 +0100)]
[SSAT] Enable filter_python3 test to run on target

 - remove exit if build folder not exists
 - bypass pushd failure if build folder not exists

Signed-off-by: Aymen Sghaier <aymen.sghaier@nxp.com>
2 years ago[Pkg] add filter-single header
Jaeyun [Fri, 4 Mar 2022 02:50:19 +0000 (11:50 +0900)]
[Pkg] add filter-single header

dev-internal pkg should include filter-single header for single-shot API.

Signed-off-by: Jaeyun <jy1210.jung@samsung.com>
2 years ago[TEST] Disable python converter tests.
gichan [Mon, 7 Mar 2022 03:35:38 +0000 (12:35 +0900)]
[TEST] Disable python converter tests.

TEMPORAL SOLUTIONS: PLEASE REVERT THIS COMMIT AFTER FIXING THE ISSUE.

When the Python tensor converter test is completed, a deadlock occurs.

Signed-off-by: gichan <gichan2.jang@samsung.com>
2 years ago[Util] fix typo and license
Jaeyun [Wed, 2 Mar 2022 09:02:39 +0000 (18:02 +0900)]
[Util] fix typo and license

Fix typo and license in util functions and header.
Update internal function description and remove unnecessary param.

Signed-off-by: Jaeyun <jy1210.jung@samsung.com>
2 years ago[tensor_filter] Modify the order of caps_intersect_full
Yongjoo Ahn [Thu, 24 Feb 2022 06:53:50 +0000 (15:53 +0900)]
[tensor_filter] Modify the order of caps_intersect_full

- The pipeline reported in #3636 has nego fail issue because the caps is
   fixated with flexible right after tensor_filter.
- To resolve this, change the order of `gst_caps_intersect_full` in transform_caps.
   This makes static format to be chosen.
- This resolves #3636

Signed-off-by: Yongjoo Ahn <yongjoo1.ahn@samsung.com>
2 years ago[tests] Add a ssat testcase to check proper negotiation
Yongjoo Ahn [Thu, 24 Feb 2022 06:41:51 +0000 (15:41 +0900)]
[tests] Add a ssat testcase to check proper negotiation

- Test whether tensor_filter - tensor_transform pipeline can be
  negotiated with static format, not flexible format.

Signed-off-by: Yongjoo Ahn <yongjoo1.ahn@samsung.com>
2 years ago[transform] Fix transform_caps in direction GST_PAD_SRC
Yongjoo Ahn [Tue, 22 Feb 2022 09:33:13 +0000 (18:33 +0900)]
[transform] Fix transform_caps in direction GST_PAD_SRC

- Since tensor_transform cannot specify the sinkpad's type caps in some modes,
  let the `transform_caps` remove the field in that case

Signed-off-by: Yongjoo Ahn <yongjoo1.ahn@samsung.com>
2 years ago[fix/common] Fix calling g_string_append with null
Yongjoo Ahn [Tue, 22 Feb 2022 09:20:02 +0000 (18:20 +0900)]
[fix/common] Fix calling g_string_append with null

- Check null before call g_string_append
- This removes the logs `g_string_insert_len: assertion 'len == 0 || val != NULL' failed`

REF: #3666
Signed-off-by: Yongjoo Ahn <yongjoo1.ahn@samsung.com>
2 years ago[Util] util function to compare tensor-config
Jaeyun [Wed, 2 Mar 2022 06:09:15 +0000 (15:09 +0900)]
[Util] util function to compare tensor-config

remove gst-dependency to compare tensor config.
add return val of invalid condition.

Signed-off-by: Jaeyun <jy1210.jung@samsung.com>
2 years ago[fix/tests] Fix mem-leak issues in some unittests
Yongjoo Ahn [Fri, 18 Feb 2022 03:19:16 +0000 (12:19 +0900)]
[fix/tests] Fix mem-leak issues in some unittests

- Fix minor mem-leak in lua, snpe, tvm unittests

Signed-off-by: Yongjoo Ahn <yongjoo1.ahn@samsung.com>
2 years ago[fix/lua] Fix mem-leak of lua filter
Yongjoo Ahn [Fri, 18 Feb 2022 03:17:40 +0000 (12:17 +0900)]
[fix/lua] Fix mem-leak of lua filter

- Use smart pointer for lua script
- Fix minor typo

Signed-off-by: Yongjoo Ahn <yongjoo1.ahn@samsung.com>
2 years ago[fix/filter] Add check for model file in some filters
Yongjoo Ahn [Fri, 18 Feb 2022 03:14:55 +0000 (12:14 +0900)]
[fix/filter] Add check for model file in some filters

- Add check for `G_FILE_TEST_IS_REGULAR` in some cpp class based filters

Signed-off-by: Yongjoo Ahn <yongjoo1.ahn@samsung.com>
2 years ago[Single] Rename single-shot files
Gichan Jang [Mon, 7 Feb 2022 06:55:58 +0000 (15:55 +0900)]
[Single] Rename single-shot files

 - Rename the files related to tensor common functions.
   renamed:    gst/nnstreamer/include/nnstreamer_plugin_api_single.h -> gst/nnstreamer/include/nnstreamer_plugin_api_util.h
   renamed:    gst/nnstreamer/tensor_common.c -> gst/nnstreamer/nnstreamer_plugin_api_impl.c
   renamed:    gst/nnstreamer/tensor_common_single.c -> gst/nnstreamer/nnstreamer_plugin_api_util_impl.c
 - Remove unnecessary pipeline utils from nnstreamer-internal header.

Signed-off-by: gichan <gichan2.jang@samsung.com>
2 years ago[TEST] Remove gst dep from singleshot test
gichan [Fri, 28 Jan 2022 11:26:52 +0000 (20:26 +0900)]
[TEST] Remove gst dep from singleshot test

Remove gst dependency from singleshot test

Signed-off-by: gichan <gichan2.jang@samsung.com>
2 years ago[Filter] Remove gst dependency from filter subplugins.
gichan [Fri, 28 Jan 2022 10:44:14 +0000 (19:44 +0900)]
[Filter] Remove gst dependency from filter subplugins.

Remove gst dependency from tensor filter subplugins.
 - tensorflow, tensorflow-lite, pytorch, nnfw,caffe2

TODO: Other subplugins later.

Signed-off-by: gichan <gichan2.jang@samsung.com>
2 years ago[Filter] Remove gst dep from single-shot
Gichan Jang [Wed, 26 Jan 2022 01:54:09 +0000 (10:54 +0900)]
[Filter] Remove gst dep from single-shot

 - Remove gst dependency from single-shot.
 - Separate single-shot package from nnstreamer(pipeline)
 - nnstreamer depends nnstreaner-single package.

Signed-off-by: gichan <gichan2.jang@samsung.com>
2 years ago[tests/tflite] Add tests for tflite2
Yongjoo Ahn [Tue, 9 Nov 2021 05:57:56 +0000 (14:57 +0900)]
[tests/tflite] Add tests for tflite2

- Set tensor_filter_ext_enabled when tflite2_support is available
- Add a gtest based test to examine the XNNPACK delegate

Signed-off-by: Yongjoo Ahn <yongjoo1.ahn@samsung.com>
2 years ago[tflite] Support tflite v2.7.0 for tizen and deian
Yongjoo Ahn [Tue, 9 Nov 2021 05:50:03 +0000 (14:50 +0900)]
[tflite] Support tflite v2.7.0 for tizen and deian

- Remove unnecessary gles dependency
- Support newly introduced xnnpack delegate
- Remove unnecessary build options

Signed-off-by: Yongjoo Ahn <yongjoo1.ahn@samsung.com>
2 years ago[Filter/trix-engine] Fix svace issue
gichan [Thu, 24 Feb 2022 03:39:15 +0000 (12:39 +0900)]
[Filter/trix-engine] Fix svace issue

 - Initialize class member.
 - Fix bad copy and paste

Signed-off-by: gichan <gichan2.jang@samsung.com>
2 years ago[TEST] Increase sleep time of the query test
gichan [Wed, 16 Feb 2022 02:06:28 +0000 (11:06 +0900)]
[TEST] Increase sleep time of the query test

1 second sleep time is not enough to operate query server.
see: https://github.com/nnstreamer/nnstreamer/issues/3657#issuecomment-1038708557

Signed-off-by: gichan <gichan2.jang@samsung.com>
2 years ago[filter] Support complex output types for pytorch
Parichay Kapoor [Thu, 3 Feb 2022 03:12:24 +0000 (12:12 +0900)]
[filter] Support complex output types for pytorch

This patch adds support for complex output types for pytorch, where the
complex output is serialized before being passed out to the gstreamer
based element - tensorfilter.

V2:
- Added more comprehensive error messages
- Added indentation fix

Signed-off-by: Parichay Kapoor <pk.kapoor@samsung.com>
2 years ago[Build] Disable trix engine support for TV releases accepted/tizen/unified/20220223.132517 submit/tizen/20220222.112350
yelini-jeong [Tue, 22 Feb 2022 04:42:50 +0000 (13:42 +0900)]
[Build] Disable trix engine support for TV releases

This patch disables trix_engine_support for TV releases.

Signed-off-by: yelini-jeong <yelini.jeong@samsung.com>
2 years agoFix build error - unused param, sign comapre accepted/tizen/unified/20220221.080248 submit/tizen/20220221.055747
gichan [Mon, 21 Feb 2022 02:21:15 +0000 (11:21 +0900)]
Fix build error - unused param, sign comapre

 Fix build error caused by unused param.
  - Ignore auto generated files (flatbuf, protobuf)
 Fix different sign compare

Signed-off-by: gichan <gichan2.jang@samsung.com>
2 years ago[MqttSrc/Sink] release mqtt handle
Jaeyun [Tue, 15 Feb 2022 02:33:26 +0000 (11:33 +0900)]
[MqttSrc/Sink] release mqtt handle

Destroy mqtt-async handle when the element instance is finalized.

Signed-off-by: Jaeyun <jy1210.jung@samsung.com>
2 years ago[Svace] fix svace issues
Jaeyun [Fri, 11 Feb 2022 04:56:42 +0000 (13:56 +0900)]
[Svace] fix svace issues

Fix svace issues
- init local variable
- check allocation failure case

Signed-off-by: Jaeyun <jy1210.jung@samsung.com>
2 years ago[trivial/doc] Update android guide: gstreamer v1.16.2 -> v1.20.0
Yongjoo Ahn [Fri, 11 Feb 2022 07:30:34 +0000 (16:30 +0900)]
[trivial/doc] Update android guide: gstreamer v1.16.2 -> v1.20.0

- Update android guide: gstreamer version v1.16.2 -> v1.20.0

Signed-off-by: Yongjoo Ahn <yongjoo1.ahn@samsung.com>
2 years ago[test/ssat] Disable proto flat flex buf SSAT tests when there are no supports
Yongjoo Ahn [Fri, 4 Feb 2022 04:51:57 +0000 (13:51 +0900)]
[test/ssat] Disable proto flat flex buf SSAT tests when there are no supports

- Disable protobuf, flatbuf, flexbuf SSAT tests when related libs did  not built

Signed-off-by: Yongjoo Ahn <yongjoo1.ahn@samsung.com>
2 years ago[Docker] Remove the existing Dockerfiles for Ubuntu 16.04 and 18.04
Wook Song [Sat, 29 Jan 2022 02:08:13 +0000 (11:08 +0900)]
[Docker] Remove the existing Dockerfiles for Ubuntu 16.04 and 18.04

This patch replaces the existing Dockerfiles corresponding to Ubuntu
16.04 and 18.04 each with the one Dockerfile that has adopted
multi-stage build and build-args concepts.

Signed-off-by: Wook Song <wook16.song@samsung.com>
2 years ago[Docker/README] Add brief instructions on Docker support
Wook Song [Sat, 29 Jan 2022 03:53:36 +0000 (12:53 +0900)]
[Docker/README] Add brief instructions on Docker support

This patch adds a README.md file to give brief instructions on getting
started NNStreamer with Docker.

Signed-off-by: Wook Song <wook16.song@samsung.com>
2 years ago[Docker] Containerize the minimal running environment
Wook Song [Fri, 31 Dec 2021 10:49:31 +0000 (19:49 +0900)]
[Docker] Containerize the minimal running environment

This patch modifies the unified Dockerfile to containerize the minimal
running environment of NNStreamer. By using the build argument,
MIN_RUN_ENV, it is possible to build the image installed nnstreamer,
nnstreamer-core, and nnstreamer-configuration packages only.

Signed-off-by: Wook Song <wook16.song@samsung.com>
2 years ago[Docker] Add another stage containing the runtime environment
Wook Song [Fri, 29 Oct 2021 08:25:26 +0000 (17:25 +0900)]
[Docker] Add another stage containing the runtime environment

This patch adds another stage to provide the runtime environment of
NNStreamer using the *.deb files created from the previous build stage.

Signed-off-by: Wook Song <wook16.song@samsung.com>
2 years ago[Docker] Add an intermediate stage that runs debuild
Wook Song [Fri, 29 Oct 2021 08:09:14 +0000 (17:09 +0900)]
[Docker] Add an intermediate stage that runs debuild

This patch adds an intermediate stage which runs debuild to create
debian packages from the nnstreamer source code at the first development
environment stage. Note that a workaround has been applied in order to
temporarily avoid the unittest_mqtt failure issue.

Signed-off-by: Wook Song <wook16.song@samsung.com>
2 years ago[Docker] Integrate the multiple dockerfiles into one
Wook Song [Thu, 30 Sep 2021 12:40:37 +0000 (21:40 +0900)]
[Docker] Integrate the multiple dockerfiles into one

To integrate the multiple dockerfiles into universal one, this patch
introduces the concept of a build-time variable, ARG, and multi-stage
builds in the Dockerfile.

Signed-off-by: Wook Song <wook16.song@samsung.com>
2 years ago[Meson/TRIx] target dependency for trix engine
Jaeyun [Fri, 21 Jan 2022 07:48:11 +0000 (16:48 +0900)]
[Meson/TRIx] target dependency for trix engine

Define target library to build filter-subplugin for trix-engine.

Signed-off-by: Jaeyun <jy1210.jung@samsung.com>
2 years ago[MQTTSrc] default options before initializaion
Jaeyun [Thu, 3 Feb 2022 11:33:44 +0000 (20:33 +0900)]
[MQTTSrc] default options before initializaion

Bug fix, set default value after initializing connection option.

Signed-off-by: Jaeyun <jy1210.jung@samsung.com>
2 years ago[filter] Bug fix for pytorch filter with gpu
Parichay Kapoor [Thu, 27 Jan 2022 08:44:04 +0000 (17:44 +0900)]
[filter] Bug fix for pytorch filter with gpu

ptyorch filter when working with gpu backend had bug when converting
between the devices. The tensors returned by the conversion were not
catched. This patch provides the corresponding fix.

Signed-off-by: Parichay Kapoor <pk.kapoor@samsung.com>
2 years ago[test/pytorch] Add ssat test for multiple input/output tensor model
Yongjoo Ahn [Mon, 27 Dec 2021 13:31:16 +0000 (22:31 +0900)]
[test/pytorch] Add ssat test for multiple input/output tensor model

- Add a simple test for pytorch model whose input and output are multiple tensors

Signed-off-by: Yongjoo Ahn <yongjoo1.ahn@samsung.com>
2 years ago[filter/pytorch] Add support for tuple type output
Yongjoo Ahn [Tue, 21 Dec 2021 05:18:54 +0000 (14:18 +0900)]
[filter/pytorch] Add support for tuple type output

- Support torch script model whose output value is `Tuple`

Signed-off-by: Yongjoo Ahn <yongjoo1.ahn@samsung.com>
2 years ago[Query] Fix invalid return value
Gichan Jang [Thu, 13 Jan 2022 02:37:51 +0000 (11:37 +0900)]
[Query] Fix invalid return value

Fix invalid return value when caps is same.

Signed-off-by: Gichan Jang <gichan2.jang@samsung.com>
2 years ago[Doc] Fix and add new feature of the query.
Gichan Jang [Thu, 13 Jan 2022 00:46:39 +0000 (09:46 +0900)]
[Doc] Fix and add new feature of the query.

 - Fix capability of the query server and client.
 - Add about mqtt-hybrid

Signed-off-by: Gichan Jang <gichan2.jang@samsung.com>
Signed-off-by: gichan <gichan2.jang@samsung.com>
2 years ago[Test] Add test cases for extra configuration
Sangjung Woo [Fri, 14 Jan 2022 10:41:02 +0000 (19:41 +0900)]
[Test] Add test cases for extra configuration

This patch newly adds the test cases for extra configuration.

Signed-off-by: Sangjung Woo <sangjung.woo@samsung.com>
2 years ago[INI] Add extra configuration for product support
Sangjung Woo [Tue, 14 Dec 2021 03:20:34 +0000 (12:20 +0900)]
[INI] Add extra configuration for product support

The product team wants to update the nnstreamer configuration (i.e.
/etc/nnstreamer.ini). However, the partition is Read-Only so it is not
updatable. Because of this reason, they want another nnstreamer
configuration file to meet their request such as product-specific
allowed elements. This patch newly adds the nnstreamer extra
configuration file for product support.

Signed-off-by: Sangjung Woo <sangjung.woo@samsung.com>
2 years ago[TRIx-Engine] Add TRIx-Engine plugin
Dongju Chae [Wed, 12 Jan 2022 06:33:14 +0000 (15:33 +0900)]
[TRIx-Engine] Add TRIx-Engine plugin

This patch adds TRIx-Engine tensor filter subplugin implementation.
It requires TRIV2 NPU HW and devel packages from the upstream tizen repo.

Signed-off-by: Dongju Chae <dongju.chae@samsung.com>
2 years ago[Build] unnecessary build dependency accepted/tizen/unified/20220124.125235 submit/tizen/20220121.055425
Jaeyun [Fri, 14 Jan 2022 11:03:36 +0000 (20:03 +0900)]
[Build] unnecessary build dependency

Update unnecessary dependency of filter sub-plugins.

Signed-off-by: Jaeyun <jy1210.jung@samsung.com>