platform/upstream/nnstreamer.git
2 weeks ago[Query] util function using integer id accepted/tizen/unified/20240423.164552 accepted/tizen/unified/x/20240425.051115
Jaeyun Jung [Fri, 12 Apr 2024 12:46:21 +0000 (21:46 +0900)]
[Query] util function using integer id

To prevent double free case, remove query handle and use integer id.
Also, add util function to hide edge handle in query elements and fix null ptr case.

Signed-off-by: Jaeyun Jung <jy1210.jung@samsung.com>
3 weeks ago[Query] Release edge handle when stopping the playing
gichan2-jang [Fri, 12 Apr 2024 01:48:41 +0000 (10:48 +0900)]
[Query] Release edge handle when stopping the playing

Problem: When state changes from PAUSED to NULL,the tensor_query_serversrc cannot switch to NULL state because it keeps waiting for data pop.

Solution: Change the creation and destruction of server data and edge handle to be managed according to the state.

 READY->PAUSED: Create query server common data
 PAUSED->PLAYING: Create nns-edge handle
 PLAYING->PAUSED: Rlease nns-edge handle
 PAUSED->READY: Descruct qeury server common data

Releated issue: https://github.com/nnstreamer/api/issues/487

Signed-off-by: gichan2-jang <gichan2.jang@samsung.com>
3 weeks ago[Edge/CodeClean] remove unnecessary connection timeout
Jaeyun Jung [Mon, 8 Apr 2024 08:10:52 +0000 (17:10 +0900)]
[Edge/CodeClean] remove unnecessary connection timeout

Fix svace issue, remove unnecessary code to check connection timeout.

Signed-off-by: Jaeyun Jung <jy1210.jung@samsung.com>
4 weeks ago[tensor_trainer] Add condition to stop model training accepted/tizen/unified/20240408.160707 accepted/tizen/unified/x/20240409.070656
hyunil park [Tue, 26 Mar 2024 02:11:52 +0000 (11:11 +0900)]
[tensor_trainer] Add condition to stop model training

- When a request to stop model training is received,
  if it has already been completed, it is ignored

Signed-off-by: hyunil park <hyunil46.park@samsung.com>
6 weeks ago[Tizen] Fix gcov build error accepted/tizen/unified/20240319.141119 accepted/tizen/unified/20240319.154856 accepted/tizen/unified/20240326.105109 accepted/tizen/unified/x/20240320.132930
gichan2-jang [Tue, 19 Mar 2024 01:52:24 +0000 (10:52 +0900)]
[Tizen] Fix gcov build error

Due to the lcov 2.0 upgrade, the warning is changed to error so the gcov build fails.
Ignore this case. (Tizen PM guide)

Signed-off-by: gichan2-jang <gichan2.jang@samsung.com>
7 weeks agomeson: explicit 'enabled' should spit errors if not found
MyungJoo Ham [Wed, 13 Mar 2024 05:42:31 +0000 (14:42 +0900)]
meson: explicit 'enabled' should spit errors if not found

If -Dsupport-ncnn=enabled is given and ncnn is not found,
an error should be generated by meson.

Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
7 weeks agodecoder/direct_video: detect element size mismatch
MyungJoo Ham [Fri, 8 Mar 2024 04:42:35 +0000 (13:42 +0900)]
decoder/direct_video: detect element size mismatch

Return error with explicit error message (GST_ERROR) if
the element size mismatches.

For example, float32 tensor stream cannot be converted
to RGB video stream without tensor_transform.

Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
7 weeks ago[AITT] Skip AITT test
gichan2-jang [Tue, 12 Mar 2024 07:05:15 +0000 (16:05 +0900)]
[AITT] Skip AITT test

Skip AITT gtest and ssat until aitt-ses is available.

Signed-off-by: gichan2-jang <gichan2.jang@samsung.com>
8 weeks agoFilter/MLAgent: Update build dependency on MLOps Agent accepted/tizen/unified/20240319.020730 accepted/tizen/unified/x/20240320.055305
Wook Song [Mon, 26 Feb 2024 12:02:52 +0000 (21:02 +0900)]
Filter/MLAgent: Update build dependency on MLOps Agent

This patch updates build dependency on MLOps Agent. Note that MLAgent
has been renamed to MLOps Agent and provided from a new repository
separated from the API repository.

Signed-off-by: Wook Song <wook16.song@samsung.com>
8 weeks ago[trivial] Fix bogus date in chagnelog
Yongjoo Ahn [Thu, 7 Mar 2024 04:04:34 +0000 (13:04 +0900)]
[trivial] Fix bogus date in chagnelog

- Fix rpmbuild warning about wrong date

Signed-off-by: Yongjoo Ahn <yongjoo1.ahn@samsung.com>
2 months ago[CodeClean] set null after free
Jaeyun Jung [Mon, 4 Mar 2024 04:39:27 +0000 (13:39 +0900)]
[CodeClean] set null after free

Clearly set null after releasing the name in tensor-info struct.

Signed-off-by: Jaeyun Jung <jy1210.jung@samsung.com>
2 months ago[CodeClean] missing lock
Jaeyun Jung [Thu, 22 Feb 2024 09:58:04 +0000 (18:58 +0900)]
[CodeClean] missing lock

Fix svace issues, add missing lock.

Signed-off-by: Jaeyun Jung <jy1210.jung@samsung.com>
2 months ago[build/debian] add dependency to onnxruntime
Suyeon Kim [Thu, 15 Feb 2024 01:39:49 +0000 (10:39 +0900)]
[build/debian] add dependency to onnxruntime

- add new pkg for onnxruntime in debian build

Signed-off-by: Suyeon Kim <suyeon5.kim@samsung.com>
2 months ago[protobuf] Fix memory leak in nnstreamer_protobuf
Yongjoo Ahn [Wed, 14 Feb 2024 08:56:05 +0000 (17:56 +0900)]
[protobuf] Fix memory leak in nnstreamer_protobuf

- Make GstMemory with properly set GDestroyNotify func

Signed-off-by: Yongjoo Ahn <yongjoo1.ahn@samsung.com>
2 months ago[filter] Fix memory leak in reload model
Yongjoo Ahn [Wed, 14 Feb 2024 08:53:19 +0000 (17:53 +0900)]
[filter] Fix memory leak in reload model

- Fix memory leak when reload tflite model

Signed-off-by: Yongjoo Ahn <yongjoo1.ahn@samsung.com>
2 months ago[fix] Resolve memory leak in tensor_if
Yongjoo Ahn [Wed, 14 Feb 2024 08:52:28 +0000 (17:52 +0900)]
[fix] Resolve memory leak in tensor_if

- Free g_list and GValue properly.

Signed-off-by: Yongjoo Ahn <yongjoo1.ahn@samsung.com>
2 months ago[test] Freeing memory during unittests
Yongjoo Ahn [Wed, 14 Feb 2024 08:51:23 +0000 (17:51 +0900)]
[test] Freeing memory during unittests

- Unref memory properly used in unittests.

Signed-off-by: Yongjoo Ahn <yongjoo1.ahn@samsung.com>
2 months ago[fix] Free option context in gtest
Yongjoo Ahn [Wed, 14 Feb 2024 08:49:48 +0000 (17:49 +0900)]
[fix] Free option context in gtest

- Call g_option_context_free in unittest_latency

Signed-off-by: Yongjoo Ahn <yongjoo1.ahn@samsung.com>
2 months ago[spec] Suppress ORC log level
Yongjoo Ahn [Mon, 19 Feb 2024 01:43:43 +0000 (10:43 +0900)]
[spec] Suppress ORC log level

- Suppress ORC logs as showing WARNING or higher logs to reduce too many
  them during gbs unittests.

Signed-off-by: Yongjoo Ahn <yongjoo1.ahn@samsung.com>
2 months agotest/datareposinK: timing error in test case
MyungJoo Ham [Wed, 7 Feb 2024 07:53:37 +0000 (16:53 +0900)]
test/datareposinK: timing error in test case

Occasionally, in github-action CI, datareposink.writeFlexibleTensors_n
fails due to synchronization errors:

```
[ RUN      ] datareposink.writeFlexibleTensors_n
../tests/nnstreamer_datarepo/unittest_datareposink.cc:570: Failure
Expected: (file_info) != (nullptr), actual: NULL vs (nullptr)
[  FAILED  ] datareposink.writeFlexibleTensors_n (173 ms)
```

It happens when the pipeline is set NULL before the file 'flexible.data'
is writtn within the pipeline.
Allow some time (0.1s) before setting it NULL.

Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
2 months ago[region] Fix memory leak in tensor_region
Yongjoo Ahn [Thu, 8 Feb 2024 07:31:54 +0000 (16:31 +0900)]
[region] Fix memory leak in tensor_region

- mem argument of `gst_tensor_meta_info_append_header` should be freed.
- Properly free old memory after the call and replace the buffer with
  new memory

Signed-off-by: Yongjoo Ahn <yongjoo1.ahn@samsung.com>
2 months ago[test] Fix mem leak in tflite unittest
Yongjoo Ahn [Thu, 8 Feb 2024 07:19:47 +0000 (16:19 +0900)]
[test] Fix mem leak in tflite unittest

- Fix memory leak by unref

Signed-off-by: Yongjoo Ahn <yongjoo1.ahn@samsung.com>
2 months ago[common] Fix mem leak in extra tensors
Yongjoo Ahn [Thu, 8 Feb 2024 07:17:07 +0000 (16:17 +0900)]
[common] Fix mem leak in extra tensors

- Extra tensor names stored in GstMemory leaks.
- Let the extra tensor do not store names.

Signed-off-by: Yongjoo Ahn <yongjoo1.ahn@samsung.com>
2 months agogithub-action: indent style error --> warning
MyungJoo Ham [Thu, 8 Feb 2024 08:17:00 +0000 (17:17 +0900)]
github-action: indent style error --> warning

Indent style error is set down to warning.
Until we have ZERO indent style error in overall,
let's keep them warning.

Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
2 months ago[mlagent] Fix misspelling variable naming and log
linuxias [Thu, 8 Feb 2024 07:39:38 +0000 (16:39 +0900)]
[mlagent] Fix misspelling variable naming and log

 - change misspelling 'stringied' to 'stringfied'

Signed-off-by: linuxias <linuxias@gmail.com>
2 months agogithub-action: import all TAOS-CI post-build
MyungJoo Ham [Wed, 24 Jan 2024 02:54:48 +0000 (11:54 +0900)]
github-action: import all TAOS-CI post-build

- gbs build for x64, x86, arm32, arm64
- pdebuild for { x64, arm64 } x { 22.04, 20.04 }
- yocto build w/ eSDK (Yocto 4.0.15)
- android build w/ nttld/setup-ndk

to enable such github actions,
- android / jni build script fix

and, drop TAOS-CI. (all imported!)

Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
2 months ago[common] Fix mem leak in gst_tensor_buffer_append_memory
Yongjoo Ahn [Tue, 6 Feb 2024 04:33:40 +0000 (13:33 +0900)]
[common] Fix mem leak in gst_tensor_buffer_append_memory

- last_memory should be released before calling
  `gst_buffer_replace_memory`

Signed-off-by: Yongjoo Ahn <yongjoo1.ahn@samsung.com>
2 months agoactions: add sloccount, prohibited-words, signed-off-by, ...
MyungJoo Ham [Tue, 23 Jan 2024 07:52:55 +0000 (16:52 +0900)]
actions: add sloccount, prohibited-words, signed-off-by, ...

The following TAOS-CI pr-prebuild checks are imported
- sloccount
- prohibited words
- signed off by
- shellcheck
- flawfinder
- coverity

Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
3 months ago[test] Fix snpe filter test to support two API versions
Yongjoo Ahn [Mon, 15 Jan 2024 07:51:39 +0000 (16:51 +0900)]
[test] Fix snpe filter test to support two API versions

- Add dlc model files for SNPE2.
- Rename SNPE1 model files.
- Fix unittest to set proper model files.

Signed-off-by: Yongjoo Ahn <yongjoo1.ahn@samsung.com>
3 months ago[filter] Add SNPE filter supports API ver 2
Yongjoo Ahn [Mon, 15 Jan 2024 07:49:21 +0000 (16:49 +0900)]
[filter] Add SNPE filter supports API ver 2

- Add a SNPE filter source `tensor_filter_snpe.cc` to support SNPE API version 2
  - It utilizes new C APIs.
- Let meson decide cpp source file to compile by checking snpe_api_version

Signed-off-by: Yongjoo Ahn <yongjoo1.ahn@samsung.com>
3 months agoactions: add cppcheck, doxygen-build, executable, ...
MyungJoo Ham [Mon, 22 Jan 2024 08:17:42 +0000 (17:17 +0900)]
actions: add cppcheck, doxygen-build, executable, ...

The following TAOS-CI pr-prebuild checks are imported
- cppcheck
- doxygen-build
- executable
- hardcoded-path
- misspelling
- nobody
- timestamp

Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
3 months agoactions: static/rpm-spec check added
MyungJoo Ham [Fri, 19 Jan 2024 07:12:25 +0000 (16:12 +0900)]
actions: static/rpm-spec check added

RPM-SPEC runs rpmlint if .spec file is updated.

Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
3 months agoactions: static/doxygen-tag style clean
MyungJoo Ham [Fri, 19 Jan 2024 06:39:10 +0000 (15:39 +0900)]
actions: static/doxygen-tag style clean

Make the code style consistant with other recent checks.

Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
3 months agoactions: more static checks from TAOC-CI
MyungJoo Ham [Fri, 19 Jan 2024 06:32:37 +0000 (15:32 +0900)]
actions: more static checks from TAOC-CI

- indent
- newline
- pylint

Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
3 months ago[CodeClean] fix svace issue
Jaeyun Jung [Thu, 25 Jan 2024 12:12:27 +0000 (21:12 +0900)]
[CodeClean] fix svace issue

1. change data type to handle gst-memory.
2. use util function to get nth tensor info.
3. add null-init in filter-edgetpu.
4. fix use-after-free case when parsing accel in tensor-filter.

Signed-off-by: Jaeyun Jung <jy1210.jung@samsung.com>
3 months agogithub-action: rebuild only if it's required accepted/tizen/unified/20240125.160253 accepted/tizen/unified/20240126.061442 accepted/tizen/unified/20240126.061459 accepted/tizen/unified/toolchain/20240311.070049 accepted/tizen/unified/x/20240205.063851
MyungJoo Ham [Wed, 17 Jan 2024 06:40:06 +0000 (15:40 +0900)]
github-action: rebuild only if it's required

This adds a workflow routine that checks if rebuild is needed.
Then, if there is no changes in source code, skip rebuilding

Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
3 months agoGitHub/Workflows: Add an action to check C++ source file format
Wook Song [Tue, 23 Jan 2024 05:10:24 +0000 (14:10 +0900)]
GitHub/Workflows: Add an action to check C++ source file format

This patch adds a GitHub Action workflow to check C++ source file
format.

Signed-off-by: Wook Song <wook16.song@samsung.com>
[Imported from deviceMLOps.MLAgent]
Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
3 months agogithub-action: do not run static-checks on deleted files.
MyungJoo Ham [Wed, 24 Jan 2024 03:55:15 +0000 (12:55 +0900)]
github-action: do not run static-checks on deleted files.

The git-changed files may include deleted files.
Do not run static-cchecks on deletec files.

Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
3 months agotest: nondeterministic unit test error.
MyungJoo Ham [Tue, 23 Jan 2024 02:14:31 +0000 (11:14 +0900)]
test: nondeterministic unit test error.

Due to multithread nondeterminism, we get
occasional unit test error from the "new_data_cb"
callback.

Create a lock and make data local to the function.

Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
3 months ago[Filter] remove space of model file
Jaeyun Jung [Mon, 22 Jan 2024 05:07:44 +0000 (14:07 +0900)]
[Filter] remove space of model file

To prevent not-found error, remove space of model path.

Signed-off-by: Jaeyun Jung <jy1210.jung@samsung.com>
3 months agoactions: add static checks
MyungJoo Ham [Fri, 12 Jan 2024 08:45:27 +0000 (17:45 +0900)]
actions: add static checks

Add static checkers & verifiers to github-actions.
Initially, clang-format for C++ files and file size checker
are migrated from TAOS-CI.

Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
3 months agogithub-action/risc-v test update
MyungJoo Ham [Tue, 7 Feb 2023 07:22:09 +0000 (16:22 +0900)]
github-action/risc-v test update

Use dockerfile of nnstreamer's fork designed for nnstreamer packages.
Enable gtest, too.

Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
3 months ago[fix/svace] fix svace issue accepted/tizen/unified/20240119.154754
Suyeon Kim [Thu, 18 Jan 2024 02:01:58 +0000 (11:01 +0900)]
[fix/svace] fix svace issue

Fix covertiy and SVACE issue
- model_path isn't initialized. fixed it.

Signed-off-by: Suyeon Kim <suyeon5.kim@samsung.com>
3 months ago[add/onnxruntime] Update onnxruntime_support on
Suyeon Kim [Wed, 17 Jan 2024 05:33:59 +0000 (14:33 +0900)]
[add/onnxruntime] Update onnxruntime_support on

add true default onnxruntime option for Tizen releases

Signed-off-by: Suyeon Kim <suyeon5.kim@samsung.com>
3 months ago[tensor_trainer] Move the function of checking invalid parameters
hyunil park [Tue, 16 Jan 2024 09:56:49 +0000 (18:56 +0900)]
[tensor_trainer] Move the function of checking invalid parameters

- Move gst_tensor_trainer_check_invalid_param to enable setting properties in PAUSED states

Signed-off-by: hyunil park <hyunil46.park@samsung.com>
3 months ago[CodeClean] util to get list size
Jaeyun Jung [Fri, 12 Jan 2024 11:53:24 +0000 (20:53 +0900)]
[CodeClean] util to get list size

Code clean, fix indent and util function to get list size.

Signed-off-by: Jaeyun Jung <jy1210.jung@samsung.com>
3 months ago[Filter/ArmNN] fix mem leak
Jaeyun Jung [Fri, 12 Jan 2024 11:51:48 +0000 (20:51 +0900)]
[Filter/ArmNN] fix mem leak

Fix mem leak, free model path in destructor.

Signed-off-by: Jaeyun Jung <jy1210.jung@samsung.com>
3 months ago[build] Let meson check API version of SNPE
Yongjoo Ahn [Fri, 12 Jan 2024 07:35:59 +0000 (16:35 +0900)]
[build] Let meson check API version of SNPE

- Let meson.build check SNPE API version.
- Added compile flag `SNPE_VERSION_MAJOR` would be used in future commits.

Signed-off-by: Yongjoo Ahn <yongjoo1.ahn@samsung.com>
3 months ago[filter] Rename `tensor_filter_snpe.cc` to `tensor_filter_snpe_v1.cc`
Yongjoo Ahn [Fri, 12 Jan 2024 07:52:47 +0000 (16:52 +0900)]
[filter] Rename `tensor_filter_snpe.cc` to `tensor_filter_snpe_v1.cc`

- Current source code targets SNPE version 1.
- Future commits will add source code targets SNPE version 2.

Signed-off-by: Yongjoo Ahn <yongjoo1.ahn@samsung.com>
3 months ago[tests] Add SSAT test for padding mode in tensor_transform
Yelin Jeong [Fri, 12 Jan 2024 06:07:35 +0000 (15:07 +0900)]
[tests] Add SSAT test for padding mode in tensor_transform

This patch adds SSAT test for padding mode in tensor_transform.

Signed-off-by: Yelin Jeong <yelini.jeong@samsung.com>
3 months ago[transform] Add tensor padding mode in tensor_transform
Yelin Jeong [Fri, 12 Jan 2024 05:00:09 +0000 (14:00 +0900)]
[transform] Add tensor padding mode in tensor_transform

This patch adds tensor padding mode in tensor_transform.
tensor padding has options like this.
left, right, top, bottom, front, back, type (NCHW or NHWC).

Signed-off-by: Yelin Jeong <yelini.jeong@samsung.com>
3 months ago[common] Move enum tensor_layout
Yelin Jeong [Fri, 12 Jan 2024 04:47:36 +0000 (13:47 +0900)]
[common] Move enum tensor_layout

This patch moves tensor_layout enum to tensor_typedef.
tensor_layout can be used in other elements.

Signed-off-by: Yelin Jeong <yelini.jeong@samsung.com>
3 months ago[trivial] Fix multiline comments to meet doxygen requiremnent
Yongjoo Ahn [Fri, 5 Jan 2024 09:20:45 +0000 (18:20 +0900)]
[trivial] Fix multiline comments to meet doxygen requiremnent

- Fix multiline comments in unittest_mlagent.cc to satisfy CI

Signed-off-by: Yongjoo Ahn <yongjoo1.ahn@samsung.com>
3 months ago[mlagent] Let `mlagent_get_model_path_from` returns uri in fallback
Yongjoo Ahn [Fri, 5 Jan 2024 09:17:27 +0000 (18:17 +0900)]
[mlagent] Let `mlagent_get_model_path_from` returns uri in fallback

- Let the function returns properly allocated gchar* in fallback case.
- Fix memleak (g_strfreev).
- Fix memleak in a testcase.

Signed-off-by: Yongjoo Ahn <yongjoo1.ahn@samsung.com>
3 months ago[test] Add a missing header in mock_mlagent.h
Yongjoo Ahn [Fri, 5 Jan 2024 08:41:38 +0000 (17:41 +0900)]
[test] Add a missing header in mock_mlagent.h

- Add a missing header <utility> in mock_mlagent.h
- It declares `std::exchange`

Signed-off-by: Yongjoo Ahn <yongjoo1.ahn@samsung.com>
3 months ago[fix/onnxruntime-filter] fixed tensor with negative value in shape
Suyeon Kim [Tue, 9 Jan 2024 01:26:24 +0000 (10:26 +0900)]
[fix/onnxruntime-filter] fixed tensor with negative value in shape

Some onnx models had free dimensions for batch. ex) [None,3,720,720]
It fixed that creating tensor with negative value in shape '''Ort::Value''' is treated  as 1.

Signed-off-by: Suyeon Kim <suyeon5.kim@samsung.com>
3 months ago[Py/CodeClean] pylock after checking ptr
Jaeyun Jung [Mon, 8 Jan 2024 10:34:30 +0000 (19:34 +0900)]
[Py/CodeClean] pylock after checking ptr

Code clean, apply gil after checking null ptr.

Signed-off-by: Jaeyun Jung <jy1210.jung@samsung.com>
3 months ago[build] Remove unnecessary BuildRequires
Yongjoo Ahn [Fri, 5 Jan 2024 08:20:36 +0000 (17:20 +0900)]
[build] Remove unnecessary BuildRequires

- The latest tflite2 tizen package has its own flatbuffers header
  internally. Let's remove the `BuildRequires: flatbuffers-debvel`
- Let meson check the header when build_platform is not tizen

Signed-off-by: Yongjoo Ahn <yongjoo1.ahn@samsung.com>
3 months ago[Pkg] fix library name for nns internal
Jaeyun Jung [Mon, 8 Jan 2024 10:36:01 +0000 (19:36 +0900)]
[Pkg] fix library name for nns internal

nnstreamer-internal pkg requires nns-single library.

Signed-off-by: Jaeyun Jung <jy1210.jung@samsung.com>
3 months agoCentralize python interpreter init/fini for subplugins
MyungJoo Ham [Wed, 13 Dec 2023 05:41:54 +0000 (14:41 +0900)]
Centralize python interpreter init/fini for subplugins

Python subplugins of decoder, converter, filter should
share the init/fini status.

Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
3 months agofilter/python3: revise GIL access.
MyungJoo Ham [Wed, 13 Dec 2023 04:44:46 +0000 (13:44 +0900)]
filter/python3: revise GIL access.

Control GIL at C callbacks.
Control mutex at C++ class.
As in decoder/converter changes.
This is the last step before the final step for #3834

Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
3 months agoconverter::python make them thread safe with GIL
MyungJoo Ham [Tue, 12 Dec 2023 10:10:06 +0000 (19:10 +0900)]
converter::python make them thread safe with GIL

Apply GIL control to converter::python3 as in we do with filter::python3.
Fixes converter part of #3834
Overrides #3872

Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
3 months ago[CodeClean/grpc] clearly define release function
Jaeyun Jung [Tue, 2 Jan 2024 05:29:09 +0000 (14:29 +0900)]
[CodeClean/grpc] clearly define release function

The type of data pushed into queue is gst-buffer.
Clearly set the release function when calling free.

Signed-off-by: Jaeyun Jung <jy1210.jung@samsung.com>
4 months ago[CodeClean] fix indent and codestyle
Jaeyun Jung [Wed, 3 Jan 2024 05:01:50 +0000 (14:01 +0900)]
[CodeClean] fix indent and codestyle

Trivial, fix indent and codestyle for line comment.

Signed-off-by: Jaeyun Jung <jy1210.jung@samsung.com>
4 months ago[build] Halt meson setup when NOT-GCC is provided for pytorch subplugin
Yongjoo Ahn [Mon, 11 Dec 2023 09:03:38 +0000 (18:03 +0900)]
[build] Halt meson setup when NOT-GCC is provided for pytorch subplugin

- Halt meson setup procedure when NOT-GCC is given and pytorch-support
  is enabled. Rather than warning and go.

Signed-off-by: Yongjoo Ahn <yongjoo1.ahn@samsung.com>
4 months ago[Pkg] header file for devel package
Jaeyun Jung [Tue, 2 Jan 2024 09:40:23 +0000 (18:40 +0900)]
[Pkg] header file for devel package

1. move util for trainer (single-devel > devel)
2. update library (link to nns-single, internal devel package)

Signed-off-by: Jaeyun Jung <jy1210.jung@samsung.com>
4 months agoDist/Tizen: Add an option to control MLAgent support
Wook Song [Thu, 14 Dec 2023 04:08:03 +0000 (13:08 +0900)]
Dist/Tizen: Add an option to control MLAgent support

This patch adds an option for MLAgent support control to the Tizen RPM
spec file.

Signed-off-by: Wook Song <wook16.song@samsung.com>
4 months agoFilter/MLAgent: Add unit test cases for parsing MLAgent URIs
Wook Song [Thu, 14 Dec 2023 03:57:55 +0000 (12:57 +0900)]
Filter/MLAgent: Add unit test cases for parsing MLAgent URIs

This patch adds test cases for unit testing of parsing the MLAgent URIs.

Signed-off-by: Wook Song <wook16.song@samsung.com>
4 months agoFilter/MLAgent: Implement the JSON parsing logic to get model's path
Wook Song [Tue, 28 Nov 2023 04:38:19 +0000 (13:38 +0900)]
Filter/MLAgent: Implement the JSON parsing logic to get model's path

This patch adds the logic to parse the C-style stringified JSON data
gathered from the ML Agent in order to convert the given URI to the
model's path.

Signed-off-by: Wook Song <wook16.song@samsung.com>
4 months agoFilter/MLAgent: Do not use g_autoptr for a const pointer
Wook Song [Mon, 27 Nov 2023 10:33:37 +0000 (19:33 +0900)]
Filter/MLAgent: Do not use g_autoptr for a const pointer

This is a trivial bug fix that removes the uneccessary attribute,
g_autofree, for the c string gathered from GObject, which is a const
pointer.

Signed-off-by: Wook Song <wook16.song@samsung.com>
4 months agoFilter/MLAgent: Use a proper data type argument for ml_agent_model_get
Wook Song [Tue, 21 Nov 2023 04:47:04 +0000 (13:47 +0900)]
Filter/MLAgent: Use a proper data type argument for ml_agent_model_get

This patch is a trivial bug fix that changes the data type of an
argument for ml_agent_model_get.

Signed-off-by: Wook Song <wook16.song@samsung.com>
4 months ago[build] Let meson check ncnn pkg-config
Yongjoo Ahn [Tue, 26 Dec 2023 07:53:38 +0000 (16:53 +0900)]
[build] Let meson check ncnn pkg-config

- Let meson check ncnn pc file first, and do fallback check then.

Signed-off-by: Yongjoo Ahn <yongjoo1.ahn@samsung.com>
4 months ago[Build/TF-lite-custom] gen shared lib in build dir accepted/tizen_unified_riscv accepted/tizen/unified/20240105.012954 accepted/tizen/unified/riscv/20240105.060141
Jaeyun Jung [Thu, 21 Dec 2023 09:41:50 +0000 (18:41 +0900)]
[Build/TF-lite-custom] gen shared lib in build dir

Code clean, generate tflite-custom library in build directory.

Signed-off-by: Jaeyun Jung <jy1210.jung@samsung.com>
4 months agoRemove flatbuf-python dependency
gichan2-jang [Tue, 26 Dec 2023 05:41:07 +0000 (14:41 +0900)]
Remove flatbuf-python dependency

Remove flatbuf-python dependency from all Tizen profile.

Signed-off-by: gichan2-jang <gichan2.jang@samsung.com>
4 months ago[Protobuf] missing tensor type
Jaeyun Jung [Thu, 21 Dec 2023 10:22:04 +0000 (19:22 +0900)]
[Protobuf] missing tensor type

Add missing tensor type 'float16' when generating protobuf and flatbuf code.

Signed-off-by: Jaeyun Jung <jy1210.jung@samsung.com>
4 months ago[Build/Edge] check nns-edge dependency
Jaeyun Jung [Tue, 19 Dec 2023 12:18:13 +0000 (21:18 +0900)]
[Build/Edge] check nns-edge dependency

Code clean, use pkgconfig to check nnstreamer-edge dependency.

Signed-off-by: Jaeyun Jung <jy1210.jung@samsung.com>
4 months agoUbuntu: clean up control file.
MyungJoo Ham [Fri, 22 Dec 2023 04:52:33 +0000 (13:52 +0900)]
Ubuntu: clean up control file.

We have multiple control files for different distros.
Clean up ubuntu-ppa control file.

Reported by Q2 of #4357
Fixes the first half of #4358

Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
4 months ago[Build] dependency to gstreamer
Jaeyun Jung [Wed, 20 Dec 2023 10:49:30 +0000 (19:49 +0900)]
[Build] dependency to gstreamer

Remove unnecessary dependency of gstreamer when building subplugins.
(e.g., we should support filter-subplugin for single-shot, without gst.)

Signed-off-by: Jaeyun Jung <jy1210.jung@samsung.com>
4 months ago[Doc] fix typo
Jaeyun Jung [Wed, 20 Dec 2023 12:42:17 +0000 (21:42 +0900)]
[Doc] fix typo

Trivial, update docs and lib name.

Signed-off-by: Jaeyun Jung <jy1210.jung@samsung.com>
4 months agoUpdate code based on feedback
Sungbin Jo [Mon, 18 Dec 2023 18:48:01 +0000 (03:48 +0900)]
Update code based on feedback

Incorporate the feedback given from the code review process.

Signed-off-by: Sungbin Jo <goranmoomin@daum.net>
4 months agoAdd documention for the ncnn subplugin
chosanglyul [Mon, 18 Dec 2023 04:25:44 +0000 (13:25 +0900)]
Add documention for the ncnn subplugin

Update usage examples according to nnstreamer-example

Signed-off-by: chosanglyul <chosanglyul@gmail.com>
4 months agoFix ncnn unit test error
Kijun Shin [Sat, 16 Dec 2023 17:48:01 +0000 (02:48 +0900)]
Fix ncnn unit test error

Signed-off-by: Kijun Shin <sharaelong.shin@gmail.com>
4 months agoAdd unit test cases
Kijun Shin [Sat, 16 Dec 2023 16:42:55 +0000 (01:42 +0900)]
Add unit test cases

Signed-off-by: Kijun Shin <sharaelong.shin@gmail.com>
4 months agoWIP ncnn unit test
Kijun Shin [Sat, 16 Dec 2023 16:37:54 +0000 (01:37 +0900)]
WIP ncnn unit test

Signed-off-by: Kijun Shin <sharaelong.shin@gmail.com>
4 months agoFix compilation error when vulkan is disabled
chosanglyul [Sat, 16 Dec 2023 10:31:27 +0000 (19:31 +0900)]
Fix compilation error when vulkan is disabled

Signed-off-by: chosanglyul <chosanglyul@gmail.com>
4 months agoAdd options for the ncnn subplugin
chosanglyul [Sat, 16 Dec 2023 10:10:14 +0000 (19:10 +0900)]
Add options for the ncnn subplugin

Signed-off-by: chosanglyul <chosanglyul@gmail.com>
4 months agoAdd main ncnn inference code
chosanglyul [Sat, 9 Dec 2023 12:36:24 +0000 (21:36 +0900)]
Add main ncnn inference code

Signed-off-by: chosanglyul <chosanglyul@gmail.com>
4 months agoAdd ncnn subplugin skeleton code
Sungbin Jo [Mon, 18 Sep 2023 03:00:14 +0000 (12:00 +0900)]
Add ncnn subplugin skeleton code

Signed-off-by: Sungbin Jo <goranmoomin@daum.net>
4 months ago[nnfw] Check NNFW_MAX_RANK in nnfw filter
Yelin Jeong [Tue, 19 Dec 2023 07:58:31 +0000 (16:58 +0900)]
[nnfw] Check NNFW_MAX_RANK in nnfw filter

This patch adds to check NNFW_MAX_RANK in nnfw filter.
If tensor info's rank is larger than NNFW_MAX_RANK and min_rank is smaller, use min_rank instead.

Signed-off-by: Yelin Jeong <yelini.jeong@samsung.com>
4 months agodecoder::python make them thread safe with GIL.
MyungJoo Ham [Tue, 12 Dec 2023 10:20:54 +0000 (19:20 +0900)]
decoder::python make them thread safe with GIL.

Apply GIL control to decoder::python3 as in we do with filter::python3.

Fixes decoder part of #3834

Overrides #3872

Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
4 months agoAdd SSAT to RISC-V github-action
MyungJoo Ham [Fri, 25 Nov 2022 01:56:52 +0000 (10:56 +0900)]
Add SSAT to RISC-V github-action

Get SSAT and build SSAT for RISC-V
Then, Run!

@TODO: SSAT TC fails in RISC-V.
   Either fix failed cases or let it ignore in RISC-V build.

Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
4 months agofilter::python3: do not break converter/decoder
MyungJoo Ham [Tue, 12 Dec 2023 10:28:41 +0000 (19:28 +0900)]
filter::python3: do not break converter/decoder

A python-global reference counter is required for py-finalize.
This is workaround before applying such a global reference counter.

Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
4 months ago[tensor_transform] Fix confusing usage of transpose
Yongjoo Ahn [Mon, 18 Dec 2023 07:57:29 +0000 (16:57 +0900)]
[tensor_transform] Fix confusing usage of transpose

- Correct usage is `... option=1:2:0:3` when a user want to change tensor
  layout NHWC into NCHW.
- Fix document abuout it.
- Fix incorrect usage in a SSAT test.

Signed-off-by: Yongjoo Ahn <yongjoo1.ahn@samsung.com>
4 months ago[CodeClean] fix svace issue
Jaeyun Jung [Mon, 18 Dec 2023 05:07:02 +0000 (14:07 +0900)]
[CodeClean] fix svace issue

Fix svace issue, prevent index error case.

Signed-off-by: Jaeyun Jung <jy1210.jung@samsung.com>
4 months ago[Test] Remove the MOBILE and WEARABLE tags in header file
Sangjung Woo [Fri, 15 Dec 2023 05:32:58 +0000 (14:32 +0900)]
[Test] Remove the MOBILE and WEARABLE tags in header file

Since both mobile and wearable profiles in Tizen project are removed,
related tags also should be removed. This patch removes them at Tizen
PM's request.

Signed-off-by: Sangjung Woo <sangjung.woo@samsung.com>
4 months ago[build] Check flatbuffers header files before build tflite subplugin
Yongjoo Ahn [Mon, 11 Dec 2023 08:55:04 +0000 (17:55 +0900)]
[build] Check flatbuffers header files before build tflite subplugin

- TFLite API requires flatbuffers header. Let meson check required header
- Add `BuildRequires` flatbuffers-devel explicitly in spec

Signed-off-by: Yongjoo Ahn <yongjoo1.ahn@samsung.com>
4 months agoSuppress valgrind errors due to system libraries
MyungJoo Ham [Thu, 17 Aug 2023 06:02:17 +0000 (15:02 +0900)]
Suppress valgrind errors due to system libraries

Added a valgrind-suppression configuration that ignores Valgrind errors from:
- Python runtime
- Between glib/gstreamer
- Not freeing memory allocated by gstreamer/gobject class init.

This works with SSAT 1.3.0+.

Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
4 months agogithub action: add tests of valgrind, gtest, ssat.
MyungJoo Ham [Fri, 22 Apr 2022 07:57:15 +0000 (16:57 +0900)]
github action: add tests of valgrind, gtest, ssat.

Add test runs for github-action - Ubuntu clean build.
However, do not block PRs for valgrind errors until
we get most valgrind errors fixed.

Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
4 months ago[Filter/TF-lite] fill 1 when changing input dimension accepted/tizen/unified/20231213.162136 accepted/tizen/unified/riscv/20231215.050236
Jaeyun Jung [Fri, 8 Dec 2023 08:50:02 +0000 (17:50 +0900)]
[Filter/TF-lite] fill 1 when changing input dimension

After implementing 0-init dims, tf-lite subplugin fills zero when changing input dimension.
Fill 1 if given dimension is 0 dim value.

Signed-off-by: Jaeyun Jung <jy1210.jung@samsung.com>
4 months ago[Common] check tensor dim to append previous caps
Jaeyun Jung [Mon, 4 Dec 2023 07:48:42 +0000 (16:48 +0900)]
[Common] check tensor dim to append previous caps

Prevent appending same caps if tensor dimension has min rank 4.
(e.g., given dim is 1001:1, previous caps with rank 4 is unnecessary.)

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