platform/upstream/nnstreamer.git
9 months ago[decoder] Add log option for bounding_box decoder
Yongjoo Ahn [Thu, 14 Sep 2023 06:25:52 +0000 (15:25 +0900)]
[decoder] Add log option for bounding_box decoder

- Add an option to decide whether to log (print) result boxes.

Signed-off-by: Yongjoo Ahn <yongjoo1.ahn@samsung.com>
10 months agoFilter/MLAgent: Initial draft for ml-agent support in TensorFilter
Wook Song [Tue, 27 Jun 2023 08:56:41 +0000 (17:56 +0900)]
Filter/MLAgent: Initial draft for ml-agent support in TensorFilter

This patch is an initial draft to bring the ML Agent features into NNS.

Signed-off-by: Wook Song <wook16.song@samsung.com>
10 months ago[Doc] edit documentation files related with tensor info
Yelin Jeong [Thu, 21 Sep 2023 03:09:34 +0000 (12:09 +0900)]
[Doc] edit documentation files related with tensor info

This patch edits docs and comments related with tensor info.

Signed-off-by: Yelin Jeong <yelini.jeong@samsung.com>
10 months ago[Filter/Decoder] function to get property
Jaeyun Jung [Fri, 22 Sep 2023 05:37:59 +0000 (14:37 +0900)]
[Filter/Decoder] function to get property

Fix warning on gst-inspect cmd,
1. add config-path to read plugin properties.
2. update invalid description.

Signed-off-by: Jaeyun Jung <jy1210.jung@samsung.com>
10 months agoDataRepo/Src: Apply g_autoptr for local variables
Wook Song [Mon, 25 Sep 2023 09:00:07 +0000 (18:00 +0900)]
DataRepo/Src: Apply g_autoptr for local variables

This patch applies g_auto and g_autofree for local gchar * and gchar **
variables to improve readability.

Signed-off-by: Wook Song <wook16.song@samsung.com>
10 months agoDataRepo/Src: Add missing null check to the finalize function
Wook Song [Mon, 25 Sep 2023 02:14:21 +0000 (11:14 +0900)]
DataRepo/Src: Add missing null check to the finalize function

Since a null check is omitted in the finalize function, g_object_unref
complains about it in some cases as follows:

(unittest_datareposrc:19927): GLib-GObject-CRITICAL **: 10:46:26.793: g_object_unref: assertion 'G_IS_OBJECT (object)' failed

This patch fixes it.

Signed-off-by: Wook Song <wook16.song@samsung.com>
10 months agoDataRepo/Src: Correct typos
Wook Song [Mon, 25 Sep 2023 08:32:33 +0000 (17:32 +0900)]
DataRepo/Src: Correct typos

This is a trivial patch that corrects typos. It would be better to
revise the texts in the file later.

Signed-off-by: Wook Song <wook16.song@samsung.com>
10 months agoDataRepo/Src: Get the framerate only if the data have it
Wook Song [Mon, 25 Sep 2023 07:27:17 +0000 (16:27 +0900)]
DataRepo/Src: Get the framerate only if the data have it

This patch fixes the bug that tries to get the 'framerate' value from
the caps of any data source. Note that there is no 'framerate' field in
GstAudioInfo.

Signed-off-by: Wook Song <wook16.song@samsung.com>
10 months ago[Edge] Fix memory leak when finalize edge-src/sink
linuxias [Sun, 24 Sep 2023 13:46:52 +0000 (22:46 +0900)]
[Edge] Fix memory leak when finalize edge-src/sink

 Free edge-src and sink variable memory when call
 finalize method to clear GstEdgeSink and Source memory

Signed-off-by: linuxias <linuxias@gmail.com>
10 months ago[Edge] Change type casting to GST macro
seungha son [Mon, 25 Sep 2023 09:55:58 +0000 (18:55 +0900)]
[Edge] Change type casting to GST macro

 - An explicit type casting technique is used to
   safely and clearly convert the type using a GST macro.

Signed-off-by: seungha son <linuxias@gmail.com>
10 months ago[doc] fix broken link in github.io
Yelin Jeong [Fri, 22 Sep 2023 05:54:19 +0000 (14:54 +0900)]
[doc] fix broken link in github.io

This patch fixes broken link in github.io.
github.com uses .md file and github.io uses .html file for link.
So conversion is required.

Signed-off-by: Yelin Jeong <yelini.jeong@samsung.com>
10 months ago[Release] start impl for next release
Jaeyun Jung [Fri, 15 Sep 2023 09:30:49 +0000 (18:30 +0900)]
[Release] start impl for next release

Update version, start implementation for next release.

Signed-off-by: Jaeyun Jung <jy1210.jung@samsung.com>
10 months agotest: tensor_filter/tflite2 correct postfix
MyungJoo Ham [Thu, 21 Sep 2023 08:24:02 +0000 (17:24 +0900)]
test: tensor_filter/tflite2 correct postfix

Negative test cases require _n postfix for the test infrastucture
to recognize them. The new test cases with property config forgot
to add such postfix properly.

This fixes test case infra regression with #4262

Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
10 months ago[tensor_filter] Add tensor filter config property
linuxias [Tue, 12 Sep 2023 15:26:33 +0000 (00:26 +0900)]
[tensor_filter] Add tensor filter config property

 tensor filter configuration is very complex, so when you set filter,
 property settings become longer and more complicated, making it
 difficult to find them at once even if human errors occur.

 If config is used, readability can be increased and human errors
 can be reduced due to organized properties.

Signed-off-by: linuxias <linuxias@gmail.com>
10 months agoMeson: Append force option to 'ln' creating python sub-plugin
Wook Song [Mon, 18 Sep 2023 04:30:55 +0000 (13:30 +0900)]
Meson: Append force option to 'ln' creating python sub-plugin

Since the ln command returns an error when the target already exists,
'meson build --reconfigure' fails as follows:

meson.build:746:4: ERROR: Command "/usr/bin/ln -s nnstreamer/build/ext/nnstreamer/extra/nnstreamer_python3.so
    nnstreamer/build/ext/nnstreamer/extra/nnstreamer_python.so" failed with status 1.

To fix it, this patch appends the -f, (--force) option to the ln command
that creates a soft link file for the python3 sub-plugin.

Signed-off-by: Wook Song <wook16.song@samsung.com>
10 months ago[datarepo] fix a bug that datarepo could not be used in Tizen App after reinstalling rpm
hyunil park [Tue, 19 Sep 2023 03:14:15 +0000 (12:14 +0900)]
[datarepo] fix a bug that datarepo could not be used in Tizen App after reinstalling rpm

The datarepo installed on the platform image can be used in the app,
but if we reinstall the datarepo rpm after pushing by sdb, it cannot be used in the app.

-Add %license, %manifest, and %defattr(-,root,root,-) to spec

Signed-off-by: hyunil park <hyunil46.park@samsung.com>
10 months ago[Edge] Fix memory leak
linuxias [Wed, 20 Sep 2023 16:30:54 +0000 (01:30 +0900)]
[Edge] Fix memory leak

 Free host, topic variable memory in GstEdgeSrc
 when call finalize to clear GstEdgeSrc memory

Signed-off-by: linuxias <linuxias@gmail.com>
10 months ago[CodeClean] util function to get stream-id accepted/tizen/8.0/unified/20231005.095247 accepted/tizen/unified/20230915.160551 tizen_8.0_m2_release
Jaeyun Jung [Fri, 15 Sep 2023 05:50:28 +0000 (14:50 +0900)]
[CodeClean] util function to get stream-id

Remove random number, use util function to get new stream-id.

Signed-off-by: Jaeyun Jung <jy1210.jung@samsung.com>
10 months agotizen: enable/disable nnstreamer-edge explicitly.
MyungJoo Ham [Thu, 14 Sep 2023 11:17:22 +0000 (20:17 +0900)]
tizen: enable/disable nnstreamer-edge explicitly.

For Tizen distro, do not let "auto" determine essential features.
This will prevent regression that implicitly disabling nnstreamer-edge.

Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
10 months ago[build] Let meson test work with python3 support
Yongjoo Ahn [Tue, 12 Sep 2023 10:32:17 +0000 (19:32 +0900)]
[build] Let meson test work with python3 support

- Set proper symbolic link and PYTHONPATH env variable to testenv
  to make `meson test` works with python module tests.

Signed-off-by: Yongjoo Ahn <yongjoo1.ahn@samsung.com>
10 months ago[Release] update version accepted/tizen/unified/20230912.171642
Jaeyun Jung [Tue, 12 Sep 2023 03:53:22 +0000 (12:53 +0900)]
[Release] update version

Update version to 2.4.0, Tizen 8.0 M2 release.

Signed-off-by: Jaeyun Jung <jy1210.jung@samsung.com>
10 months ago[build] Fix `find_library` usage finding SNPE dep
Yongjoo Ahn [Mon, 11 Sep 2023 07:01:57 +0000 (16:01 +0900)]
[build] Fix `find_library` usage finding SNPE dep

- meson complains as `starting in "lib" only works by accident and is not portable`
- Change `libSNPE` to `SNPE`.

Signed-off-by: Yongjoo Ahn <yongjoo1.ahn@samsung.com>
10 months ago[build] Fix meson use of `run_command`
Yongjoo Ahn [Mon, 11 Sep 2023 06:57:58 +0000 (15:57 +0900)]
[build] Fix meson use of `run_command`

- meson may change the default value of `run_command`'s `check` arg
  (false -> true).
- Set `check : false` in omitted lines.

Signed-off-by: Yongjoo Ahn <yongjoo1.ahn@samsung.com>
10 months ago[test] Fix the rank compare test of SNPE filter
Yongjoo Ahn [Mon, 11 Sep 2023 08:02:48 +0000 (17:02 +0900)]
[test] Fix the rank compare test of SNPE filter

- Deal with the recent rank update in nnstreamer.

Signed-off-by: Yongjoo Ahn <yongjoo1.ahn@samsung.com>
10 months ago[filter] Remove assert and throw exception
Yongjoo Ahn [Mon, 11 Sep 2023 08:01:41 +0000 (17:01 +0900)]
[filter] Remove assert and throw exception

- Remove excessive asserts.
- Throw exception when input or output buffer is NULL in invoke method

Signed-off-by: Yongjoo Ahn <yongjoo1.ahn@samsung.com>
10 months ago[test] Let snpe test exit generously
Yongjoo Ahn [Mon, 11 Sep 2023 07:46:03 +0000 (16:46 +0900)]
[test] Let snpe test exit generously

- Sleep a while when the negative pipeline test exits.

Signed-off-by: Yongjoo Ahn <yongjoo1.ahn@samsung.com>
10 months ago[pytorch] Fix load model with use_gpu option
Yongjoo Ahn [Thu, 7 Sep 2023 08:58:40 +0000 (17:58 +0900)]
[pytorch] Fix load model with use_gpu option

- In the recent pytorch, `model->to (device)` does not work properly.
- Use `torch::jit::load (model, torch::Device)` instead.

Signed-off-by: Yongjoo Ahn <yongjoo1.ahn@samsung.com>
10 months ago[pytorch] Drop pytorch support for version less than 1.2.0
Yongjoo Ahn [Thu, 7 Sep 2023 08:57:20 +0000 (17:57 +0900)]
[pytorch] Drop pytorch support for version less than 1.2.0

- Drop the support for the old pytorchs.

Signed-off-by: Yongjoo Ahn <yongjoo1.ahn@samsung.com>
10 months ago[Subplugin/Flatbuf] util to get nth info
Jaeyun Jung [Tue, 5 Sep 2023 04:40:13 +0000 (13:40 +0900)]
[Subplugin/Flatbuf] util to get nth info

Code clean, remove unnecessary copy of tensors-info and use util to get nth info.

Signed-off-by: Jaeyun Jung <jy1210.jung@samsung.com>
10 months ago[Common] dimension in tensor-meta
Jaeyun Jung [Thu, 7 Sep 2023 08:45:24 +0000 (17:45 +0900)]
[Common] dimension in tensor-meta

Set max length of tensor dimension in tensor-meta, same with tensor rank limit.

Signed-off-by: Jaeyun Jung <jy1210.jung@samsung.com>
10 months ago[test] Fix pytorch ssat model file
Yongjoo Ahn [Mon, 11 Sep 2023 09:36:20 +0000 (18:36 +0900)]
[test] Fix pytorch ssat model file

- Recent pytorch cannot read the `pytorch_lenet5.pt`.
- Replace the file with newer version of pytorch.

Signed-off-by: Yongjoo Ahn <yongjoo1.ahn@samsung.com>
10 months ago[CodeClean] test and comments
Yelin Jeong [Fri, 8 Sep 2023 07:13:40 +0000 (16:13 +0900)]
[CodeClean] test and comments

Fix test and comments.
- Remove useless initialization
- Change comment and docs

Signed-off-by: Yelin Jeong <yelini.jeong@samsung.com>
10 months ago[Tizen] allow multifilesrc/sink accepted/tizen/unified/20230907.175333
Jaeyun Jung [Thu, 7 Sep 2023 06:23:13 +0000 (15:23 +0900)]
[Tizen] allow multifilesrc/sink

Update the list of allowed elements - multifilesrc/sink.

Signed-off-by: Jaeyun Jung <jy1210.jung@samsung.com>
10 months ago[Filter/Sub] fill 0 dim at nth info
Jaeyun Jung [Tue, 5 Sep 2023 04:40:49 +0000 (13:40 +0900)]
[Filter/Sub] fill 0 dim at nth info

Util function to get nth gst-info and fill remained dim as 0.

TODO:
I did not build and test all subplugins, need to check all subplugins later.

Signed-off-by: Jaeyun Jung <jy1210.jung@samsung.com>
10 months ago[python] change dims default value from 1 to 0
Yelin Jeong [Thu, 7 Sep 2023 04:40:29 +0000 (13:40 +0900)]
[python] change dims default value from 1 to 0

This patch changes dims default value from 1 to 0 in python helper.

Signed-off-by: Yelin Jeong <yelini.jeong@samsung.com>
10 months ago[Converter] incoming data format
Jaeyun Jung [Tue, 29 Aug 2023 06:52:02 +0000 (15:52 +0900)]
[Converter] incoming data format

Update tensor dimension of incoming data, 0-init.
 - video : [ch][w][h][frames]
 - audio : [ch][samples]
 - text : [size][samples]
 - octet/tensor : [size]

Signed-off-by: Jaeyun Jung <jy1210.jung@samsung.com>
10 months ago[tensor] Increase NNS_TENSOR_RANK_LIMIT to 16
Yelin Jeong [Fri, 1 Sep 2023 05:07:38 +0000 (14:07 +0900)]
[tensor] Increase NNS_TENSOR_RANK_LIMIT to 16

This patch Increase NNS_TENSOR_RANK_LIMIT
- Increase NNS_TENSOR_RANK_LIMIT to 16 from 8
- Delete convertMetaInvalidParam03_n, since NNS_TENSOR_RANK_LIMIT and NNS_TENSOR_META_RANK_LIMIT are now same.
- Fix some values in tests.

Signed-off-by: Yelin Jeong <yelini.jeong@samsung.com>
10 months ago[CodeClean] indent and code style
Jaeyun Jung [Thu, 7 Sep 2023 03:46:20 +0000 (12:46 +0900)]
[CodeClean] indent and code style

Code clean, fix indent and code style.

Signed-off-by: Jaeyun Jung <jy1210.jung@samsung.com>
10 months ago[TensorIF] Fix the wrong index in log format
seungha.son [Wed, 6 Sep 2023 09:32:24 +0000 (18:32 +0900)]
[TensorIF] Fix the wrong index in log format

 - Wrong array index occur unwanted behavior and problem.

Signed-off-by: seungha.son <linuxias@gmail.com>
10 months ago[python] init dimension as 0
Yelin Jeong [Fri, 1 Sep 2023 07:38:08 +0000 (16:38 +0900)]
[python] init dimension as 0

This patch removes filling the dimension value with 1.
Tensor dimension initial value is 0.

Signed-off-by: Yelin Jeong <yelini.jeong@samsung.com>
10 months agomemleak fix: converter test leak fix
MyungJoo Ham [Wed, 30 Aug 2023 08:29:59 +0000 (17:29 +0900)]
memleak fix: converter test leak fix

converter gtest code mem leak by not calling gst_object_unref

Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
10 months ago[Test/decoder] Add test cases for direct video decoer
gichan2-jang [Mon, 4 Sep 2023 09:07:38 +0000 (18:07 +0900)]
[Test/decoder] Add test cases for direct video decoer

 - Add test case of all supported video format of direct video decoder.
 - Apply default video foramt when video format is not given.

Signed-off-by: gichan2-jang <gichan2.jang@samsung.com>
11 months ago[Test] length of dims
Jaeyun Jung [Fri, 1 Sep 2023 01:49:17 +0000 (10:49 +0900)]
[Test] length of dims

1. Get the length of dimension, not constant.
2. Init dim as 0 in some testcase.

Signed-off-by: Jaeyun Jung <jy1210.jung@samsung.com>
11 months ago[ssat] Execute runTest.sh properly
Yongjoo Ahn [Fri, 1 Sep 2023 07:07:50 +0000 (16:07 +0900)]
[ssat] Execute runTest.sh properly

- Those runTest.sh are not executed regardless of the ret value of the python script. Fix It.

Signed-off-by: Yongjoo Ahn <yongjoo1.ahn@samsung.com>
11 months ago[test] Replace tensorflow1-lite with tensorflow2-lite in SSAT tests
Yongjoo Ahn [Fri, 1 Sep 2023 06:41:43 +0000 (15:41 +0900)]
[test] Replace tensorflow1-lite with tensorflow2-lite in SSAT tests

- Let's use tensorflow2-lite rather than deprecated tf1-lite.

Signed-off-by: Yongjoo Ahn <yongjoo1.ahn@samsung.com>
11 months ago[Src/IIO] dimension in tensorsrc-iio
Jaeyun Jung [Fri, 1 Sep 2023 03:40:56 +0000 (12:40 +0900)]
[Src/IIO] dimension in tensorsrc-iio

0-init dims, data in src-iio has format of [ch-number][capacity].

Signed-off-by: Jaeyun Jung <jy1210.jung@samsung.com>
11 months ago[Split] init dim as 0
Jaeyun Jung [Fri, 1 Sep 2023 04:42:28 +0000 (13:42 +0900)]
[Split] init dim as 0

The initial value of tensor dimension is 0. Do not fill remained dims as 1.

Signed-off-by: Jaeyun Jung <jy1210.jung@samsung.com>
11 months ago[test] Use EPIPE if ESTRPIPE is not defined like macos
Yongjoo Ahn [Tue, 29 Aug 2023 09:13:19 +0000 (18:13 +0900)]
[test] Use EPIPE if ESTRPIPE is not defined like macos

- Use EPIPE instead of ESTRPIPE where it is not defined.

Signed-off-by: Yongjoo Ahn <yongjoo1.ahn@samsung.com>
11 months ago[test] Fix filter_reload_test
Yongjoo Ahn [Tue, 29 Aug 2023 08:47:48 +0000 (17:47 +0900)]
[test] Fix filter_reload_test

- The mutex used in the filter is effected by invoke and reload both.
- Set GST_STATE_PAUSED before reloading models, to guarantee that mutex
  is unlocked

Signed-off-by: Yongjoo Ahn <yongjoo1.ahn@samsung.com>
11 months ago[Ubuntu/1804] Check pytorch version
gichan2-jang [Wed, 30 Aug 2023 10:26:34 +0000 (19:26 +0900)]
[Ubuntu/1804] Check pytorch version

Check pytorch version to fix ubuntu 18.04 build failure
 - Fix incompatibility of protobuf and caffe2 of ubuntu 18.04.
 - Don't install not available package.

Signed-off-by: gichan2-jang <gichan2.jang@samsung.com>
11 months ago[WIP] DataRepo Memory Leak Fix
MyungJoo Ham [Mon, 28 Aug 2023 10:03:05 +0000 (19:03 +0900)]
[WIP] DataRepo Memory Leak Fix

There are a few more leaks to be fixed.

Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
11 months ago[Debian] Fix deprecated option
gichan2-jang [Wed, 30 Aug 2023 08:41:27 +0000 (17:41 +0900)]
[Debian] Fix deprecated option

Since `enable-datarepo` is  removed, change to `datarepo-support`.

Signed-off-by: gichan2-jang <gichan2.jang@samsung.com>
11 months agomemleak fix: unittest-common forgot to unref
MyungJoo Ham [Wed, 30 Aug 2023 07:40:03 +0000 (16:40 +0900)]
memleak fix: unittest-common forgot to unref

Unref gst-buffer that is allocated in the test case.

Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
11 months agomemleak fix: tensor_demux forgot to free strv
MyungJoo Ham [Wed, 30 Aug 2023 05:39:18 +0000 (14:39 +0900)]
memleak fix: tensor_demux forgot to free strv

g_strsplit_set()'s return should be freed by the caller.

Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
11 months ago[TizenSensor] dimension of sensor data
Jaeyun Jung [Thu, 24 Aug 2023 12:36:24 +0000 (21:36 +0900)]
[TizenSensor] dimension of sensor data

0-init dimension, supposed tensor dimension of Tizen sensor data is [sensor-data][samples].

Signed-off-by: Jaeyun Jung <jy1210.jung@samsung.com>
11 months ago[tensor_filter] Fix wrong spelling in spec string
seungha.son [Tue, 29 Aug 2023 12:08:10 +0000 (21:08 +0900)]
[tensor_filter] Fix wrong spelling in spec string

Signed-off-by: seungha.son <linuxias@gmail.com>
11 months agomemleak fix: tests/trainer gtest accepted/tizen/unified/20230830.170548
MyungJoo Ham [Fri, 25 Aug 2023 09:01:53 +0000 (18:01 +0900)]
memleak fix: tests/trainer gtest

unref-ing GstElement from gst_bin_get_by_name is required
with GST_OBJECT casting.

Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
11 months ago[Common] util to get nth gst-info
Jaeyun Jung [Mon, 28 Aug 2023 09:44:34 +0000 (18:44 +0900)]
[Common] util to get nth gst-info

Use util function to get nth info from tensors-info struct.

Signed-off-by: Jaeyun Jung <jy1210.jung@samsung.com>
11 months ago[Decoder/Pose] condition to check tensor dims
Jaeyun Jung [Mon, 28 Aug 2023 09:56:57 +0000 (18:56 +0900)]
[Decoder/Pose] condition to check tensor dims

Change condition to check tensor dimension - allows 0 dim.

Signed-off-by: Jaeyun Jung <jy1210.jung@samsung.com>
11 months ago[Src/IIO] init gst-info in list
Jaeyun Jung [Mon, 28 Aug 2023 10:00:04 +0000 (19:00 +0900)]
[Src/IIO] init gst-info in list

Bug fix, init gst-info in list inside of the loop.

Signed-off-by: Jaeyun Jung <jy1210.jung@samsung.com>
11 months agomemleak fix: datareposrc json parse leaking.
MyungJoo Ham [Fri, 25 Aug 2023 09:13:19 +0000 (18:13 +0900)]
memleak fix: datareposrc json parse leaking.

set-property may be called repeatedly.
Do not overwrite allocated pointers.

Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
11 months agotest/filter/lua: update null-input/output death test
MyungJoo Ham [Fri, 25 Aug 2023 08:17:16 +0000 (17:17 +0900)]
test/filter/lua: update null-input/output death test

Filter/lua no longer dies for null input/output.
It now returns an error code (C-side) or an exception (C++-side).

Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
11 months agomemleak fix: filter/lua null check
MyungJoo Ham [Fri, 25 Aug 2023 07:07:20 +0000 (16:07 +0900)]
memleak fix: filter/lua null check

It may access a struct of null pointer:
```
==32601== 1 errors in context 1 of 5:
==32601== Invalid read of size 8
==32601==    at 0x81659BA: nnstreamer::tensorfilter_lua::lua_subplugin::invoke(GstTensorMemory const*, GstTensorMemory*) (tensor_filter_lua.cc:498)
==32601==    by 0x8393D7B: nnstreamer::tensor_filter_subplugin::cpp_invoke(_GstTensorFilterFramework const*, _GstTensorFilterProperties*, void*, GstTensorMemory const*, GstTensorMemory*) (tensor_filter_support_cc.cc:168)
==32601==    by 0x16FCDC: nnstreamerFilterLua_invoke01_n_Test::TestBody() (unittest_filter_lua.cc:490)
==32601==    by 0x1A8F0B: void testing::internal::HandleSehExceptionsInMethodIfSupported<testing::Test, void>(testing::Test*, void (testing::Test::*)(), char const*) (gtest.cc:2402)
==32601==    by 0x1A274A: void testing::internal::HandleExceptionsInMethodIfSupported<testing::Test, void>(testing::Test*, void (testing::Test::*)(), char const*) (gtest.cc:2438)
==32601==    by 0x185943: testing::Test::Run() (gtest.cc:2474)
==32601==    by 0x1862B9: testing::TestInfo::Run() (gtest.cc:2656)
==32601==    by 0x18694A: testing::TestCase::Run() (gtest.cc:2776)
==32601==    by 0x18D9FE: testing::internal::UnitTestImpl::RunAllTests() (gtest.cc:4651)
==32601==    by 0x1AA27E: bool testing::internal::HandleSehExceptionsInMethodIfSupported<testing::internal::UnitTestImpl, bool>(testing::internal::UnitTestImpl*, bool (testing::internal::UnitTestImpl::*)(), char const*) (gtest.cc:2402)
==32601==    by 0x1A36D0: bool testing::internal::HandleExceptionsInMethodIfSupported<testing::internal::UnitTestImpl, bool>(testing::internal::UnitTestImpl*, bool (testing::internal::UnitTestImpl::*)(), char const*) (gtest.cc:2438)
==32601==    by 0x18C5F2: testing::UnitTest::Run() (gtest.cc:4259)
==32601==    by 0x178659: RUN_ALL_TESTS() (gtest.h:2233)
==32601==    by 0x176CA7: main (unittest_filter_lua.cc:1069)
==32601==  Address 0x0 is not stack'd, malloc'd or (recently) free'd
```

Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
11 months agomemleak fix: unittest/custom filter
MyungJoo Ham [Fri, 25 Aug 2023 07:11:26 +0000 (16:11 +0900)]
memleak fix: unittest/custom filter

Someone has forgot to call free.

Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
11 months agoworkaround: brew error in github action.
MyungJoo Ham [Mon, 28 Aug 2023 01:39:39 +0000 (10:39 +0900)]
workaround: brew error in github action.

Fix the error:
```
==> Pouring python@3.11--3.11.5.monterey.bottle.tar.gz
Error: The `brew link` step did not complete successfully
The formula built, but is not symlinked into /usr/local
Could not symlink bin/2to3
Target /usr/local/bin/2to3
already exists. You may want to remove it:
  rm '/usr/local/bin/2to3'
```

Reference: https://github.com/universal-ctags/ctags/pull/3759

This is a workaround. When homebrew resumes working in github-action,
we need to revert this.

Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
11 months agomemleak fix: test/sink gtest
MyungJoo Ham [Fri, 25 Aug 2023 02:50:38 +0000 (11:50 +0900)]
memleak fix: test/sink gtest

A few test cases did not call deallocation.

Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
11 months agomemleak fix: decoder/bounding-box mp_palm
MyungJoo Ham [Wed, 23 Aug 2023 06:06:35 +0000 (15:06 +0900)]
memleak fix: decoder/bounding-box mp_palm

It has a few g_array that is not freed.
Fixes #4195

Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
11 months ago[decoder] Add boundingbox decoder for yolov8
Yongjoo Ahn [Tue, 22 Aug 2023 04:20:51 +0000 (13:20 +0900)]
[decoder] Add boundingbox decoder for yolov8

- Add boundingbox decoder for yolov8
TODO: refactor yolov5 and yolov8 which are sharing many common parts

Tested simple pipeline:
```
gst-launch-1.0 \
v4l2src ! videoscale ! videoconvert ! video/x-raw,width=320,height=320,format=RGB,framerate=30/1,pixel-aspect-ratio=1/1 ! tee name=t \
t. ! queue ! tensor_converter ! other/tensors,num_tensors=1,types=uint8,format=static,dimensions=3:320:320:1 ! \
  tensor_transform mode=arithmetic option=typecast:float32,add:0.0,div:255.0 ! \
  queue leaky=2 max-size-buffers=2 ! \
  tensor_filter framework=tensorflow2-lite model=~/ultralytics/yolov8s_saved_model/yolov8s_float16.tflite custom=Delegate:XNNPACK,NumThreads:4 latency=1 ! \
  other/tensors,num_tensors=1,types=float32,format=static,dimensions=2100:84:1 ! \
  tensor_transform mode=transpose option=1:0:2:3 ! \
  tensor_decoder mode=bounding_boxes option1=yolov8 option2=./coco-80.txt option3=0 option4=320:320 option5=320:320 ! \
  video/x-raw,width=320,height=320,format=RGBA ! mix.sink_0 \
t. ! queue ! mix.sink_1 compositor name=mix sink_0::zorder=2 sink_1::zorder=1 ! videoconvert ! autovideosink
```
Note that the used model file yolov8s_float16.tflite is created by official guide of yolov8 project.

REF: https://github.com/ultralytics/ultralytics

Signed-off-by: Yongjoo Ahn <yongjoo1.ahn@samsung.com>
11 months ago[Github Action] Add nntrainer integraion build
gichan2-jang [Thu, 10 Aug 2023 02:13:58 +0000 (11:13 +0900)]
[Github Action] Add nntrainer integraion build

Add Github action for nntrainer intergration build.

Signed-off-by: gichan2-jang <gichan2.jang@samsung.com>
11 months ago[Converter/decoder] Support GRAY16 format
gichan2-jang [Tue, 22 Aug 2023 03:24:37 +0000 (12:24 +0900)]
[Converter/decoder] Support GRAY16 format

Support GRAY16 format for tnesor_converter and
tensor_decoder::direct_video.

Signed-off-by: gichan2-jang <gichan2.jang@samsung.com>
11 months ago[decoder] Fix yolov5 boundingbox dim check
Yongjoo Ahn [Mon, 21 Aug 2023 05:36:12 +0000 (14:36 +0900)]
[decoder] Fix yolov5 boundingbox dim check

- Let 0 dim value be acceptable for yolov5 decoder input's last values

Signed-off-by: Yongjoo Ahn <yongjoo1.ahn@samsung.com>
11 months agomemleak fix: decoder/bounding-box 2
MyungJoo Ham [Fri, 18 Aug 2023 06:43:28 +0000 (15:43 +0900)]
memleak fix: decoder/bounding-box 2

data->anchors is allocated at every init call without freeing.

Fixes #4187

Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
11 months agomemleak fix: decoder/bounding-box
MyungJoo Ham [Fri, 18 Aug 2023 05:26:25 +0000 (14:26 +0900)]
memleak fix: decoder/bounding-box

"results" is allocated in ```_get_objects_mp_palm_detection_``` macro.
Do not allocate it before calling it.

Fixes #4185

Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
11 months agodist: force enable datarepo for Tizen/Ubuntu accepted/tizen/unified/20230818.183539
MyungJoo Ham [Mon, 14 Aug 2023 02:07:39 +0000 (11:07 +0900)]
dist: force enable datarepo for Tizen/Ubuntu

Force enable datarepo in Tizen/Ubuntu so that
we can prevent omitting it in the future accidently.

Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
11 months agodatarepo: clean up meson scripts
MyungJoo Ham [Mon, 14 Aug 2023 02:03:49 +0000 (11:03 +0900)]
datarepo: clean up meson scripts

1. Make it 'feature' so that it can be resolved automatically.
2. Because it has an additional dependency, don't make it default true.

Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
11 months ago[tensor_trainer] Add stop function to GstTensorTrainerFramework
hyunil park [Thu, 3 Aug 2023 06:40:09 +0000 (15:40 +0900)]
[tensor_trainer] Add stop function to GstTensorTrainerFramework

tensor_trainer calls this to stop model training being performed in a sub-plugin,
currently running epoch is finished to the end and sub-plugin saves the model

- Add function to stop model training
- Add ready-to-complete property to tensor_trainer
  User should set when the training is ready to be completed and saved.

Signed-off-by: hyunil park <hyunil46.park@samsung.com>
11 months agostyle: meson dep variable rule
MyungJoo Ham [Fri, 11 Aug 2023 10:01:18 +0000 (19:01 +0900)]
style: meson dep variable rule

- If it is in a dep-list, it should be a dep object. Results of find_program() is not a dep object. Fix it!
- If it is a dep-list, its name should end with 'deps', not 'dep'.

Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
11 months agoedge: update include style
MyungJoo Ham [Fri, 11 Aug 2023 09:50:46 +0000 (18:50 +0900)]
edge: update include style

nnstreamer-edge.h is from another package. Use <> instead of "".

Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
11 months agotensor_query: nnstreamer-edge dependency fix
MyungJoo Ham [Thu, 10 Aug 2023 05:40:37 +0000 (14:40 +0900)]
tensor_query: nnstreamer-edge dependency fix

1. nnstreamer-edge.h is from another package. Use #include appropriately.
2. dependency on nnstreamer-edge is not expressed proprely in meson.

Potential issue: Android build w/ nnstreamer-edge might need further care in /jni

Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
11 months agotest: script updated for better fault handling.
MyungJoo Ham [Tue, 3 May 2022 03:33:17 +0000 (12:33 +0900)]
test: script updated for better fault handling.

If the test is not available (e.g., numpy is not available or
the tested feature is not built), don't test.

Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
11 months agofix: decoder/bounding-box mobilenet threshold logic
MyungJoo Ham [Wed, 9 Aug 2023 02:10:35 +0000 (11:10 +0900)]
fix: decoder/bounding-box mobilenet threshold logic

Let's not ignore labels that may have larger score after
the first label exceeding the threshold.

Fixes #4137

Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
11 months ago[Edge] Add wait connection prop
gichan2-jang [Fri, 14 Jul 2023 02:16:26 +0000 (11:16 +0900)]
[Edge] Add wait connection prop

If wait-connection prop is set true, wait until edgesrc is connected and
don't drop the buffers.

Signed-off-by: gichan2-jang <gichan2.jang@samsung.com>
11 months ago[Tests] Update testcases to support 0-init dimension
Yelin Jeong [Mon, 12 Jun 2023 06:19:24 +0000 (15:19 +0900)]
[Tests] Update testcases to support 0-init dimension

This patch updates testcases to support dimension,
filled 0 by default.

Signed-off-by: Yelin Jeong <yelini.jeong@samsung.com>
11 months ago[tensor] remove padded value of dimensions (0-init)
Yelin Jeong [Mon, 12 Jun 2023 06:14:24 +0000 (15:14 +0900)]
[tensor] remove padded value of dimensions (0-init)

This patch removes padded value of dimensions.
dimension in GstTensorInfo is 0 by default.

Signed-off-by: Yelin Jeong <yelini.jeong@samsung.com>
12 months ago[Svace] fix svace issue accepted/tizen/unified/20230808.074017
Jaeyun Jung [Fri, 4 Aug 2023 05:57:02 +0000 (14:57 +0900)]
[Svace] fix svace issue

Code clean, fix svace issues.
1. prevent duplicated free case.
2. handle returned val when mapping incoming buffer.

Signed-off-by: Jaeyun Jung <jy1210.jung@samsung.com>
12 months ago[Test/CodeClean] prevent duplicated free
Jaeyun Jung [Thu, 3 Aug 2023 12:47:40 +0000 (21:47 +0900)]
[Test/CodeClean] prevent duplicated free

Fix svace issue, set null to prevent duplicated free.

Signed-off-by: Jaeyun Jung <jy1210.jung@samsung.com>
12 months ago[tensor_trainer] Add load_model_path to GstTensorTrainerProperties
hyunil park [Thu, 27 Jul 2023 06:54:04 +0000 (15:54 +0900)]
[tensor_trainer] Add load_model_path to GstTensorTrainerProperties

- Add model_load_path to load an existing model to use for training a new model
- Add model_load_path property to tensor_trainer

Signed-off-by: hyunil park <hyunil46.park@samsung.com>
12 months ago[datareposrc] Push GstBuffer according to framerate
hyunil park [Tue, 18 Jul 2023 01:01:11 +0000 (10:01 +0900)]
[datareposrc] Push GstBuffer according to framerate

datareposrc push GstBuffer according to framerate when sink element sets sync=true

- Set TIMESTAMP to GstBuffer
- Add function to calculate running_time for one frame

Signed-off-by: hyunil park <hyunil46.park@samsung.com>
12 months ago[Documentation] Fix tizen reference link
seungha.son [Wed, 2 Aug 2023 10:28:52 +0000 (19:28 +0900)]
[Documentation] Fix tizen reference link

Tizen reference link has been changed and updated with the latest link.

 - How to install GBS : https://docs.tizen.org/platform/developing/installing/
 - How to build with GBS : https://docs.tizen.org/platform/developing/building/

Signed-off-by: seungha.son <linuxias@gmail.com>
12 months ago[Build/Tizen] allowed elements
Jaeyun Jung [Tue, 1 Aug 2023 11:45:03 +0000 (20:45 +0900)]
[Build/Tizen] allowed elements

Update allowed elements in tizen, clearly define the list of elements.

Signed-off-by: Jaeyun Jung <jy1210.jung@samsung.com>
12 months ago[Documentation] Remove some package related with tensorflow version 1.x
seungha.son [Mon, 31 Jul 2023 08:04:22 +0000 (17:04 +0900)]
[Documentation] Remove some package related with tensorflow version 1.x

 - Removed package : tensorflow-c-dev, tensorflow-lite-dev

Signed-off-by: seungha.son <linuxias@gmail.com>
12 months ago[Documentation] Add libjson-glib-dev package dependency
seungha.son [Thu, 27 Jul 2023 11:16:21 +0000 (20:16 +0900)]
[Documentation] Add libjson-glib-dev package dependency

 If there is no libjson-glib-dev package, occur meson build error below:

 Program sh found: YES (/usr/bin/sh)
 Run-time dependency json-glib-1.0 found: NO (tried pkgconfig and cmake)
 gst/datarepo/meson.build:7:0: ERROR: Dependency "json-glib-1.0" not found, tried pkgconfig and cmake

Signed-off-by: seungha.son <linuxias@gmail.com>
12 months ago[tensor_trainer] Add function to create a framework in the chain function
hyunil park [Fri, 14 Jul 2023 06:02:02 +0000 (15:02 +0900)]
[tensor_trainer] Add function to create a framework in the chain function

A pushed gstbuffer by some src-element(not datareposrc) is prerolled if set sync=true.
so, it needs to create a framework in the chain function
- Add function to create a framework in the chain function
- Modify code related g_cond_wait

Signed-off-by: hyunil park <hyunil46.park@samsung.com>
12 months ago[GitHub Action] Fix MacOS build failure
gichan2-jang [Fri, 28 Jul 2023 02:05:31 +0000 (11:05 +0900)]
[GitHub Action] Fix MacOS build failure

Don't install gstreamer-plugins.

Warning messages:
```
Warning: Formula gst-plugins-base was renamed to gstreamer.
Warning: Formula gst-plugins-good was renamed to gstreamer.
```

Related issue: https://github.com/Homebrew/brew/issues/15488
Bug report from the issue:  There is technically a bug here in that the dependency collector doesn't recognise multiple renames into one formula as being a single formula, so it tries to install gstreamer multiple times.

Signed-off-by: gichan2-jang <gichan2.jang@samsung.com>
12 months ago[datarepo] Add function to read and write sparse tensors accepted/tizen/unified/20230727.173058
hyunil park [Mon, 10 Jul 2023 06:37:18 +0000 (15:37 +0900)]
[datarepo] Add function to read and write sparse tensors

- Add writing sparse tensors to datareposink
  To add memory to gstbuffer by number of sparse tensors when reading a sample in datareposrc,
  sample_offset, tensor_size, and tensor_count fields are added to the JSON file
- Add reading sparse tensors to datareposrc
  If the tensor format of JSON file is sparse, read a sample using the JSON meta information
  (sample_offset, tensor_size, tensor_count) and append memory to GstBuffer as many as the number
  of sparse tensors.
- Add unit test
- bug fix about shuffle index

Signed-off-by: hyunil park <hyunil46.park@samsung.com>
12 months ago[tensor_region] fix memcpy to out buffer
HarshJ20 [Wed, 19 Jul 2023 05:41:15 +0000 (11:11 +0530)]
[tensor_region] fix memcpy to out buffer

    - fixed the out buffer pointer increment size while storing cropping info

Signed-off-by: HarshJ20 <hjain24in@gmail.com>
12 months ago[datareposrc] Add function to read flexible tensors
hyunil park [Tue, 27 Jun 2023 04:13:41 +0000 (13:13 +0900)]
[datareposrc] Add function to read flexible tensors

- If the tensor format of the caps of the JSON file is flexible,
  Reads a sample using the flexible meta information (sample_offset, tensor_size, tensor_count)
  of the JSON file and appends memory to GstBuffer as many as the number of flexible tensors.
- Add unit test
- Add checking if it is a flexible tensor after writing data to GstMemory

- Reference
  * The start offset for reading is sample_offset(sample size).
  * Save each flexible tensor stored in a sample to a gstbuffer according to each
    tensor_size, tensor_size can get tensor_size field in JSON file.
  * A shuffled index is mapped to an index of sample_offset field in JSON file.
  * A shuffled index is also mapped to an index of tensor_count field in JSON file
  * The index value is a number of cumulative tensors, so it is mapped to an index
    of tensor_size field in JSON file

Signed-off-by: hyunil park <hyunil46.park@samsung.com>
12 months ago[tensor_trainer] Apply NNS_TENSOR_SIZE_EXTRA_LIMIT and bug fix for flexible tensor...
hyunil park [Mon, 3 Jul 2023 05:14:29 +0000 (14:14 +0900)]
[tensor_trainer] Apply NNS_TENSOR_SIZE_EXTRA_LIMIT and bug fix for flexible tensor operation

- Apply NNS_TENSOR_SIZE_EXTRA_LIMIT
- Bug fix: remove invalid flexible header pointer
           remove buffer overflow related to the wrong tensor size
- Add check if tensor is flexible

Signed-off-by: hyunil park <hyunil46.park@samsung.com>
12 months ago[test] Add testcases for mux/demx handling extra tensors
Yongjoo Ahn [Fri, 7 Jul 2023 09:32:26 +0000 (18:32 +0900)]
[test] Add testcases for mux/demx handling extra tensors

- Add a TC to test MAX extra tensors with tensor_mux
- Add a TC to test tensor_demux handling extra tensors

Signed-off-by: Yongjoo Ahn <yongjoo1.ahn@samsung.com>
12 months ago[common] Let the util handles extra tensors input
Yongjoo Ahn [Fri, 7 Jul 2023 09:23:02 +0000 (18:23 +0900)]
[common] Let the util handles extra tensors input

- Let `gst_tensor_time_sync_buffer_from_colletpad` support extra tensors
  as its input

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