platform/upstream/nnstreamer.git
3 years ago[Dist/Tizen] Include the MQTT elements in the misc package
Wook Song [Mon, 7 Jun 2021 01:34:27 +0000 (10:34 +0900)]
[Dist/Tizen] Include the MQTT elements in the misc package

This patch updates the rpm spec file to include the MQTT elements in the
nnstreamer-misc package.

Signed-off-by: Wook Song <wook16.song@samsung.com>
3 years ago[Test/MQTT] Fix the wrong usages of integer literals in g_object_set
Wook Song [Mon, 7 Jun 2021 05:25:42 +0000 (14:25 +0900)]
[Test/MQTT] Fix the wrong usages of integer literals in g_object_set

This patch fixes the wrong usages of integer literals in g_object_set.
In detail, G_GINT64_CONSTANT or G_GUINT64_CONSTANT macros are used for
the 64bit wide integer literals and the 'UL' suffixes are used for the
unsigned long integer literals.

Signed-off-by: Wook Song <wook16.song@samsung.com>
3 years ago[Gst/MQTTSink] Use the platform dependent conversion specifier of gsize
Wook Song [Mon, 7 Jun 2021 03:46:59 +0000 (12:46 +0900)]
[Gst/MQTTSink] Use the platform dependent conversion specifier of gsize

This patch fixes a trivial bug. Since the length of gsize depends on
whether the platform is 32-bit or 64-bit, this patch replaces %lu with
GSIZE_FORMAT that is the platform-dependent conversion specifier of it.

Signed-off-by: Wook Song <wook16.song@samsung.com>
3 years agoDist/spec: code clean w/ proper macro if/endif for unittest submit/tizen/20210630.024211
MyungJoo Ham [Mon, 28 Jun 2021 09:31:48 +0000 (18:31 +0900)]
Dist/spec: code clean w/ proper macro if/endif for unittest

Rewrite if-conditions for unit test executions.
Use direct conditions, not indirect conditions.
Add comments for conditions requiring further explanations.

Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
3 years ago[TensorFilter] Add SLSI NPU option as HW accelerator
Sangjung Woo [Tue, 29 Jun 2021 03:22:20 +0000 (12:22 +0900)]
[TensorFilter] Add SLSI NPU option as HW accelerator

This patch newly adds the SLSI NPU option as the HW accelerator.

Signed-off-by: Sangjung Woo <sangjung.woo@samsung.com>
3 years ago[Crop] remove tensor-config struct
Jaeyun [Fri, 25 Jun 2021 08:21:19 +0000 (17:21 +0900)]
[Crop] remove tensor-config struct

Prepare refactoring about tensor config, remove tensor-config struct and replace to tensors-config.

Signed-off-by: Jaeyun <jy1210.jung@samsung.com>
3 years agomeson: configure inidir properly when a relative path is given.
MyungJoo Ham [Fri, 25 Jun 2021 07:11:35 +0000 (16:11 +0900)]
meson: configure inidir properly when a relative path is given.

If sysconfdir option is not given or a relative path is given,
add prefix so that its actual install path (which uses prefix
if a relative path is given) matches NNSTREAMER_CONF_FILE
macro in nnstreamer_conf.h

Fixes #3161

Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
3 years agopkgconfig: add nnstreamer-internal for API developers.
MyungJoo Ham [Wed, 23 Jun 2021 01:41:20 +0000 (10:41 +0900)]
pkgconfig: add nnstreamer-internal for API developers.

API developers require additional headers than subplugin writers,
which is packaged as "nnstreamer-internal".
With this additional pkgconfig file, such dependency can be met.

Fixes #3230

Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
3 years agoDist/spec: update pkg desc of devel/devel-internal
MyungJoo Ham [Wed, 23 Jun 2021 01:36:04 +0000 (10:36 +0900)]
Dist/spec: update pkg desc of devel/devel-internal

The role of devel package has been expanded since the
introduction. Update the descriptions.

Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
3 years ago[Test/TVM] Fix gbs test to run only on x86_64
Junhwan Kim [Fri, 25 Jun 2021 01:48:20 +0000 (10:48 +0900)]
[Test/TVM] Fix gbs test to run only on x86_64

TVM test model is compiled for x86_64, disable test on other architectures
TODO: prepare test models for more target devices

Signed-off-by: Junhwan Kim <jejudo.kim@samsung.com>
3 years ago[fix/lua] Fix convertiy/svace issues issued in lua source code
Yongjoo Ahn [Fri, 25 Jun 2021 01:55:45 +0000 (10:55 +0900)]
[fix/lua] Fix convertiy/svace issues issued in lua source code

- Use `g_malloc` instead of `malloc` to abort program when malloc fails
- Give correct size to `lua_newuserdata`

Signed-off-by: Yongjoo Ahn <yongjoo1.ahn@samsung.com>
3 years ago[Transform/Test] arith mode in flex tensor stream
Jaeyun [Mon, 14 Jun 2021 11:28:41 +0000 (20:28 +0900)]
[Transform/Test] arith mode in flex tensor stream

Add testcase to check flex tensor stream.
Input and output buffer should have header if caps is flexible.

Signed-off-by: Jaeyun <jy1210.jung@samsung.com>
3 years ago[Transform] support flex tensor
Jaeyun [Mon, 14 Jun 2021 11:25:54 +0000 (20:25 +0900)]
[Transform] support flex tensor

Add pad template and update chain function to support flexible tensor stream.

TODO: Now max rank supported in tensor-transform is 4.
Signed-off-by: Jaeyun <jy1210.jung@samsung.com>
3 years ago[Transform/CodeClean] in/out info in chain function
Jaeyun [Mon, 14 Jun 2021 05:05:00 +0000 (14:05 +0900)]
[Transform/CodeClean] in/out info in chain function

Code clean, prepare flex-tensor in tensor-transform.
Pass in/out tensor info in chain function.

Signed-off-by: Jaeyun <jy1210.jung@samsung.com>
3 years ago[Common] parse flex config from caps
Jaeyun [Fri, 18 Jun 2021 11:57:28 +0000 (20:57 +0900)]
[Common] parse flex config from caps

When getting config from caps, if caps is flexible, do not get the type and dimension from caps.

Signed-off-by: Jaeyun <jy1210.jung@samsung.com>
3 years ago[unittest/lua] Add unittests for Lua filter
Yongjoo Ahn [Mon, 14 Jun 2021 07:06:12 +0000 (16:06 +0900)]
[unittest/lua] Add unittests for Lua filter

- Add gtest based unittests for Lua filter

Signed-off-by: Yongjoo Ahn <yongjoo1.ahn@samsung.com>
3 years ago[Lua] Add guide for script mode and negative TCs
Yongjoo Ahn [Fri, 11 Jun 2021 06:13:56 +0000 (15:13 +0900)]
[Lua] Add guide for script mode and negative TCs

- Add guide for using script mode
- Add some negative cases

Signed-off-by: Yongjoo Ahn <yongjoo1.ahn@samsung.com>
3 years ago[lua] Support multi input/output tensors and tensor types
Yongjoo Ahn [Wed, 9 Jun 2021 10:56:38 +0000 (19:56 +0900)]
[lua] Support multi input/output tensors and tensor types

- Support multiple input/output tensors
- Support all supported data types
- Fix SSAT testcases

Signed-off-by: Yongjoo Ahn <yongjoo1.ahn@samsung.com>
3 years ago[test/join] Add timeout option
Gichan Jang [Wed, 23 Jun 2021 03:06:34 +0000 (12:06 +0900)]
[test/join] Add timeout option

Add timeout option to fail test.
Pipeline does not end after test failure on arm arch.

Signed-off-by: Gichan Jang <gichan2.jang@samsung.com>
3 years ago[Crop] flex tensor on raw data pad
Jaeyun [Fri, 18 Jun 2021 11:38:16 +0000 (20:38 +0900)]
[Crop] flex tensor on raw data pad

support flex tensor on raw data pad.

Signed-off-by: Jaeyun <jy1210.jung@samsung.com>
3 years ago[util] Replace atoi to g_ascii_strtoll accepted/tizen/unified/20210624.131714 submit/tizen/20210624.024019
Gichan Jang [Wed, 23 Jun 2021 07:15:02 +0000 (16:15 +0900)]
[util] Replace atoi to g_ascii_strtoll

Replace ato to g_ascii_strtoll.
Let's avoid C functions.

Signed-off-by: Gichan Jang <gichan2.jang@samsung.com>
3 years ago[Filter] Initialize class members
Gichan Jang [Wed, 23 Jun 2021 07:08:21 +0000 (16:08 +0900)]
[Filter] Initialize class members

Initialize the class member of the tensorflow-lite

Signed-off-by: Gichan Jang <gichan2.jang@samsung.com>
3 years ago[filter/cpp] Catch exceptions in invoke and open
Yongjoo Ahn [Mon, 14 Jun 2021 05:06:08 +0000 (14:06 +0900)]
[filter/cpp] Catch exceptions in invoke and open

- Catch other exceptions and print the error msg in invoke function.
- runtime_error or exception have wide coverage, Let those cpp exceptions
  return error code EINVAL.
- Developer should throw exceptions with detailed error message.

Signed-off-by: Yongjoo Ahn <yongjoo1.ahn@samsung.com>
3 years ago[Spec] Fix DA build error accepted/tizen/unified/20210621.123005 submit/tizen/20210621.072743
Junhwan Kim [Mon, 21 Jun 2021 05:16:28 +0000 (14:16 +0900)]
[Spec] Fix DA build error

Unittest not built with DA profile

Signed-off-by: Junhwan Kim <jejudo.kim@samsung.com>
3 years ago[Test/Crop] testcases for tensor-crop
Jaeyun [Wed, 2 Jun 2021 11:34:46 +0000 (20:34 +0900)]
[Test/Crop] testcases for tensor-crop

add new testcases for tensor-crop (default crop region)

Signed-off-by: Jaeyun <jy1210.jung@samsung.com>
3 years ago[Crop] handle buffer timestamp
Jaeyun [Wed, 2 Jun 2021 11:32:01 +0000 (20:32 +0900)]
[Crop] handle buffer timestamp

Add new property lateness.
If user sets lateness, then tensor-crop will compare the timestamp of incoming buffers and will drop buffer if time-diff is larger than lateness.

Signed-off-by: Jaeyun <jy1210.jung@samsung.com>
3 years ago[Crop] crop region
Jaeyun [Mon, 31 May 2021 10:30:46 +0000 (19:30 +0900)]
[Crop] crop region

First and default mode to crop region of raw data.

TODO:
We should handle various crop-mode and lateness in tensor-crop.

Signed-off-by: Jaeyun <jy1210.jung@samsung.com>
3 years ago[Doc] caps in tensor-converter
Jaeyun [Tue, 15 Jun 2021 05:24:29 +0000 (14:24 +0900)]
[Doc] caps in tensor-converter

update docs - flex tensor and caps in tensor-converter.

Signed-off-by: Jaeyun <jy1210.jung@samsung.com>
3 years agoTensor-filter: error handling w/o goto
MyungJoo Ham [Thu, 17 Jun 2021 02:49:40 +0000 (11:49 +0900)]
Tensor-filter: error handling w/o goto

Error handling of element internal data validity does not require goto.
Rewrite it without goto.

Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
3 years agoTensor-filter: elaborate error messages with invoke.
MyungJoo Ham [Thu, 27 May 2021 10:56:11 +0000 (19:56 +0900)]
Tensor-filter: elaborate error messages with invoke.

The runtime error messages of tensor-filter are not
meeting the standard. Elaborate the messages with
enough information for debugging.

Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
3 years agoTensor-filter: reduce CC by separating parameter checks.
MyungJoo Ham [Thu, 27 May 2021 10:41:54 +0000 (19:41 +0900)]
Tensor-filter: reduce CC by separating parameter checks.

Separate parameter check subrountine to reduce CC, which is
mentioned by "SAM".

Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
3 years ago[CodeClean] use util function to free tensor config
Jaeyun [Wed, 16 Jun 2021 02:48:02 +0000 (11:48 +0900)]
[CodeClean] use util function to free tensor config

Code clean, use common util function to free tensor config struct.

Signed-off-by: Jaeyun <jy1210.jung@samsung.com>
3 years ago[TEST] Fix python converter test fail on arm arch
Gichan Jang [Mon, 14 Jun 2021 02:19:53 +0000 (11:19 +0900)]
[TEST] Fix python converter test fail on arm arch

 - Fix python converter test fail on arm arch becasuse of slow speed of the
arm emulator.
 - Fix size of the input memory for test.

Signed-off-by: Gichan Jang <gichan2.jang@samsung.com>
3 years ago[filter/tvm] Fix dimension order and add custom prop
Junhwan Kim [Tue, 15 Jun 2021 02:34:49 +0000 (11:34 +0900)]
[filter/tvm] Fix dimension order and add custom prop

Bug fix: inversed dimension order
Add custom prop `num_input_tensors`
- Since `get_num_inputs` API for tvm model returns (#inputs + #params), user should specify only #inputs

Signed-off-by: Junhwan Kim <jejudo.kim@samsung.com>
3 years ago[Common/Util] util function to free config struct
Jaeyun [Tue, 15 Jun 2021 07:58:35 +0000 (16:58 +0900)]
[Common/Util] util function to free config struct

Prepare later work, define util function to free config structure.

Signed-off-by: Jaeyun <jy1210.jung@samsung.com>
3 years ago[mqtt] Clear mutex of mqttsrc and mqttsink
Gichan Jang [Mon, 14 Jun 2021 08:02:35 +0000 (17:02 +0900)]
[mqtt] Clear mutex of mqttsrc and mqttsink

Clear mutex when this is no longer used.`

Signed-off-by: Gichan Jang <gichan2.jang@samsung.com>
3 years ago[Debian] fix debian control for TVM
Junhwan Kim [Mon, 7 Jun 2021 08:15:13 +0000 (17:15 +0900)]
[Debian] fix debian control for TVM

This patch adds debian packaging for TVM filter
Fix meson.build corresponding to tvm-dev package

Signed-off-by: Junhwan Kim <jejudo.kim@samsung.com>
3 years ago[test/trivial] Fix signed-unsigned compare
Yongjoo Ahn [Fri, 11 Jun 2021 07:06:12 +0000 (16:06 +0900)]
[test/trivial] Fix signed-unsigned compare

- Fix gtest signed-unsigned compare cases
- Change unittest_converter.cc CRLF -> LF

Signed-off-by: Yongjoo Ahn <yongjoo1.ahn@samsung.com>
3 years ago[lua] Support script mode accepted/tizen/unified/20210611.144938 submit/tizen/20210611.070742
Yongjoo Ahn [Fri, 4 Jun 2021 06:36:06 +0000 (15:36 +0900)]
[lua] Support script mode

- Support lua script in raw string given by tensor_filter model prop
- Add related SSAT testcase

Signed-off-by: Yongjoo Ahn <yongjoo1.ahn@samsung.com>
3 years ago[spec] Enable Lua filter subplugin in Tizen
Yongjoo Ahn [Thu, 3 Jun 2021 09:34:46 +0000 (18:34 +0900)]
[spec] Enable Lua filter subplugin in Tizen

- Enable lua filter support by default in Tizen

Signed-off-by: Yongjoo Ahn <yongjoo1.ahn@samsung.com>
3 years ago[test/lua] Add ssat test for lua filter
Yongjoo Ahn [Thu, 3 Jun 2021 09:32:14 +0000 (18:32 +0900)]
[test/lua] Add ssat test for lua filter

- Add SSAT testcases for lua tensor_filter subplugin
- It tests two model; one is passthrough and the other is scaler

Signed-off-by: Yongjoo Ahn <yongjoo1.ahn@samsung.com>
3 years ago[Filter/Lua] Add Lua tensor_filter subplugin
Yongjoo Ahn [Thu, 3 Jun 2021 09:30:28 +0000 (18:30 +0900)]
[Filter/Lua] Add Lua tensor_filter subplugin

- Add Lua filter working with Lua5.1
- For now, it only supports num_tensors == 1 for input/output and
  only supports uint8 type

TODO:
- scale for num_tensors > 1
- Support various tensor type
- Support script given by raw string

Signed-off-by: Yongjoo Ahn <yongjoo1.ahn@samsung.com>
3 years ago[Common/MemFlag] remove read-only flag
Jaeyun [Fri, 11 Jun 2021 04:55:33 +0000 (13:55 +0900)]
[Common/MemFlag] remove read-only flag

remove unnecessary read-only flag when creating memory block with raw data.

Signed-off-by: Jaeyun <jy1210.jung@samsung.com>
3 years ago[Test/Flex] add header if buffer is flex tensor
Jaeyun [Fri, 21 May 2021 08:36:54 +0000 (17:36 +0900)]
[Test/Flex] add header if buffer is flex tensor

handle flex-tensor meta and header in memory in the testcases.

Signed-off-by: Jaeyun <jy1210.jung@samsung.com>
3 years ago[Mux] add header if out is flex tensor
Jaeyun [Fri, 21 May 2021 08:33:27 +0000 (17:33 +0900)]
[Mux] add header if out is flex tensor

When incoming tensor is static tensor stream and out is flex, append header in each memory block.

Signed-off-by: Jaeyun <jy1210.jung@samsung.com>
3 years ago[Filter] header to handle flex tensor
Jaeyun [Fri, 21 May 2021 08:31:48 +0000 (17:31 +0900)]
[Filter] header to handle flex tensor

handle header in flex tensor.
- parse header and set ptr to invoke the model, if incoming buffer is flex tensor.
- append header if output is flex tensor.

Signed-off-by: Jaeyun <jy1210.jung@samsung.com>
3 years ago[Converter] header to process flex tensor
Jaeyun [Tue, 18 May 2021 11:41:32 +0000 (20:41 +0900)]
[Converter] header to process flex tensor

Using meta utils, parse and add header into each memory in buffer.

Signed-off-by: Jaeyun <jy1210.jung@samsung.com>
3 years ago[Meta/Test] testcases for util functions
Jaeyun [Mon, 24 May 2021 05:04:26 +0000 (14:04 +0900)]
[Meta/Test] testcases for util functions

add testcases for tensor meta util functions.

Signed-off-by: Jaeyun <jy1210.jung@samsung.com>
3 years ago[Meta] util functions
Jaeyun [Tue, 18 May 2021 11:38:09 +0000 (20:38 +0900)]
[Meta] util functions

add util functions to handle tensor meta info.

Signed-off-by: Jaeyun <jy1210.jung@samsung.com>
3 years agoRelease of NNStreamer 1.7.2 devel accepted/tizen/unified/20210611.013603 submit/tizen/20210610.101630 v1.7.2
MyungJoo Ham [Thu, 3 Jun 2021 05:42:05 +0000 (14:42 +0900)]
Release of NNStreamer 1.7.2 devel

This is a developmental release of NNStreamaer 1.7.2.

1.7.1 -> 1.7.2 (includes a huge amount of changes)

        - NNStreamer for Edge-AI project started.
                - Main festures of 1.8.0 release and its immediate successors will be "Edge-AI", which allows distributed on-device AI inferences.

                - The new stream type, "Flex-Tensor", is introduced. Dimensions and types of tensor stream may vary per frame without cap-renegotiations.
                        - Many nnstreamer's tensor-* elements support Flex-Tensor.
                        - You may use tensor-converter to convert between flex-tensor and (static) tensor.
                - MQTT-SINK and MQTT-SRC elements are added for edge-AI systems with MQTT pub/sub streams.
                        - MQTT streams support "ANY" capabilities.
                        - Assuming that clocks of nodes are synchronized by NTP or other mechanisms, pipeline users may send timestamp related info via MQTT streams for multi-source synchronization.
                - Tensor-crop, a new nnstreamer-gstreamer element.
                        - Basic feature only (cropping a tensor stream with information of another tensor stream)

        - Major features
                - GSTPipeline to PBTXT parser. You can use PBTXT-pipeline visualization tools with the parsed results.
                - FlexBuffers support.
                - TVM support

                - Tensor-IF with custom (user code plugged at run-time) conditions
                - Tensorflow-lite delegation designation is generalized.
                - Tensorflow2-lite XNNPACK delegation
                - NNTrainer-inference can be attached as a filter along with both API sets.
                - CAPI: updated documentation, added new enums for recent nnstreamer features, ...
                - API interface and implementation is separated to another git repository for better architecture.
                - Tensor-converter and Tensor-decoder support custom ops.
        - Minor features
                - Filter subplugin priority with ini file configuration.
                - Decoder/Bounding-Box improved: output tensor mapping, clamp bounding box locations, labeling issues, more options.
                - Decoder/Pose-Estimation improved: proper labeling.
                - Testcases added for gRPC, Android, Tensor-rate, ...
                - Refactoring (reduce complexity, remove duplicity, build options, ...)
                - Android build & release upgraded.
                - Converter usability upgrade: property to list subplugins, subplugin naming/install rules.
                - Pytorch: exception handling, Android build
                - gRPC: per-IDL packaging, interface updates, common-code revise, async mode, ...
                - Support Tensorflow 2.4 API (TF has broken backward compatibility again)
                - Tensor-transform: may operate on chosen tensor or channel only.
        - Fixes
                - Android resource leak.
                - CAPI timing, header issues, seg-faults, memory leaks, ...
                - MacOS build errors.
                - TensorRT dependency bugs
                - Edge-TPU compatibility issues.
                - Unit test fixes (memory leaks, resource leaks, skip disabled features, ...)
                - Fixed reported issues (security, memory leaks, query-caps, ...)
        - Extra
                - Support for Python 2.x is dropped.
                - Automated doc-page generation with Hotdoc.
                - Android build now includes GST-Shark for performance profiling.

Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
3 years ago[Converter] Add custom python converter testcases
Gichan Jang [Wed, 26 May 2021 09:52:21 +0000 (18:52 +0900)]
[Converter] Add custom python converter testcases

Add custom python converter testcases.
 1. Test dynamic dimension
 2. Test custom python conveter using json

Signed-off-by: Gichan Jang <gichan2.jang@samsung.com>
3 years agoDocumentation: meson build description updated.
MyungJoo Ham [Fri, 4 Jun 2021 03:34:58 +0000 (12:34 +0900)]
Documentation: meson build description updated.

Per the request of #3320, the document is updated.

Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
3 years ago[Filter/ONE] change backend str
Jaeyun [Wed, 9 Jun 2021 06:25:48 +0000 (15:25 +0900)]
[Filter/ONE] change backend str

MM team request, before implementing fallback mode in ONE, set backend str w/cpu.

Signed-off-by: Jaeyun <jy1210.jung@samsung.com>
3 years ago[Transform] set write flag
Jaeyun [Thu, 10 Jun 2021 02:25:04 +0000 (11:25 +0900)]
[Transform] set write flag

In transform() function, set write flag when mapping the output buffer.

Signed-off-by: Jaeyun <jy1210.jung@samsung.com>
3 years ago[Flatbuffers] Add faltbuffers python
Gichan Jang [Mon, 7 Jun 2021 08:15:09 +0000 (17:15 +0900)]
[Flatbuffers] Add faltbuffers python

Add flatbuffers python support to tizen.
This will enable tensor converter and decoder unittest of the python.

Signed-off-by: Gichan Jang <gichan2.jang@samsung.com>
3 years ago[README] Change android release link
Gichan Jang [Mon, 7 Jun 2021 09:43:30 +0000 (18:43 +0900)]
[README] Change android release link

 - Since JCenter service is stopped, replaced with daily build release temporarily.
 - Change android official releases table

Signed-off-by: Gichan Jang <gichan2.jang@samsung.com>
3 years ago[TEST] Change state change timeout
Gichan Jang [Mon, 7 Jun 2021 07:52:36 +0000 (16:52 +0900)]
[TEST] Change state change timeout

Change state change time out of the unittest util from 500 ms to 1,000 ms.
For cppFilterObj_base03 test, it takes an average of 700 ms to change the state in the armv7l arch.

Signed-off-by: Gichan Jang <gichan2.jang@samsung.com>
3 years ago[debian] Install the link of nnstreamer lib
Gichan Jang [Mon, 7 Jun 2021 06:56:06 +0000 (15:56 +0900)]
[debian] Install the link of nnstreamer lib

Install symlink of nnstreamer shared object in libdir.
This fixes build fail of the nnstreamer-api.
https://code.launchpad.net/~gichan-jang/+recipe/ml-api-daily

Signed-off-by: Gichan Jang <gichan2.jang@samsung.com>
3 years ago[Gst/MQTTSrc] Replace g_cond_wait() with g_cond_wait_until()
Wook Song [Fri, 4 Jun 2021 08:22:04 +0000 (17:22 +0900)]
[Gst/MQTTSrc] Replace g_cond_wait() with g_cond_wait_until()

To avoid deadlock, this patch replaces g_cond_wait() with
g_cond_wait_until() in the GstMQTTSrc element.

Signed-off-by: Wook Song <wook16.song@samsung.com>
3 years ago[Gst/MQTTSrc] Revise re-connection and re-subscription mechanism
Wook Song [Thu, 3 Jun 2021 12:50:14 +0000 (21:50 +0900)]
[Gst/MQTTSrc] Revise re-connection and re-subscription mechanism

When the MQTTSrc element goes to the GST_STATE_PAUSED state, it will
lose the connection to the broker. In order to restore the connection
and subscriptions established before, this patch modifies the code
snippet that handles the case when the state is changed to PLAYING by
using the GST_BASE_SRC_IS_STARTED and MQTTAsync_reconnect functions.

Signed-off-by: Wook Song <wook16.song@samsung.com>
3 years ago[Gst/MQTT/Src] Do not wait for the start completion in the sync mode
Wook Song [Thu, 3 Jun 2021 07:50:43 +0000 (16:50 +0900)]
[Gst/MQTT/Src] Do not wait for the start completion in the sync mode

The sychronous mode in the src elements inherited from GstBaseSrc does
not invoke gst_base_src_start_complete() for which
gst_base_src_start_wait() waits. To avoid stuch at
gst_base_src_start_wait(), this patch adds another if-condition that
checking for the element's sychronous behaviour.

Signed-off-by: Wook Song <wook16.song@samsung.com>
3 years ago[Gst/MQTT/Sink] Fix the timeout to wait for disconnection
Wook Song [Wed, 2 Jun 2021 05:51:32 +0000 (14:51 +0900)]
[Gst/MQTT/Sink] Fix the timeout to wait for disconnection

This patch corrects the timeout to wait for the disconnection to the
broker.

Signed-off-by: Wook Song <wook16.song@samsung.com>
3 years ago[Gst/MQTT/Src] Revise renegotiation procedure
Wook Song [Wed, 2 Jun 2021 05:36:46 +0000 (14:36 +0900)]
[Gst/MQTT/Src] Revise renegotiation procedure

In the re-negotiation procedure, the peer's caps, the result of
gst_pad_peer_query_caps, which is filtered by the newly received caps,
could be empty even if it is not NULL. This patch adds the omitted
condition checking the emptiness of the caps before using the peer
caps for re-negotiation.

Signed-off-by: Wook Song <wook16.song@samsung.com>
3 years ago[Gst/MQTTSink] Reduce unnecessary mutex lock when changing states
Wook Song [Fri, 28 May 2021 13:56:24 +0000 (22:56 +0900)]
[Gst/MQTTSink] Reduce unnecessary mutex lock when changing states

This patch reduces unnecessary mutex lock operations when changing
MQTTSink's internal states. In addition, g_cond_wait is replaced with
g_cond_wait_until to avoid possible deadlocks.

Signed-off-by: Wook Song <wook16.song@samsung.com>
3 years ago[debian] Make the link of nnstreamer lib
Gichan Jang [Mon, 7 Jun 2021 02:59:27 +0000 (11:59 +0900)]
[debian] Make the link of nnstreamer lib

Make symlink of nnstreamer shared object in libdir.
This fixes build fail of the nnstreamer-api.
https://code.launchpad.net/~gichan-jang/+recipe/ml-api-daily

Signed-off-by: Gichan Jang <gichan2.jang@samsung.com>
3 years agoBuild: create libnnstreamer.so symlink in meson. accepted/tizen/unified/20210604.120706 submit/tizen/20210604.065820
MyungJoo Ham [Wed, 2 Jun 2021 09:36:32 +0000 (18:36 +0900)]
Build: create libnnstreamer.so symlink in meson.

Instead of creating symlinks in packaging (RPM/DEB),
create symlinks at meson so that local-build & user-install
works appropriately.

Fixes #3316
CC: @smohantty
Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
3 years ago[TensorFilter] add a property shared-tensor-filter-key
Hyoung Joo Ahn [Fri, 4 Jun 2021 01:30:42 +0000 (10:30 +0900)]
[TensorFilter] add a property shared-tensor-filter-key

to share the model representation(interpreter for TFLite), a new property is required. Through this property, user can set the filters that share their model representation. Additional logics(like checking duplication) will be added later.

Signed-off-by: Hyoung Joo Ahn <hello.ahn@samsung.com>
3 years ago[Filter/TFLite] change interpreter to pointer
Hyoung Joo Ahn [Wed, 26 May 2021 03:44:09 +0000 (12:44 +0900)]
[Filter/TFLite] change interpreter to pointer

To make the interpreter class shareable, need to change to a pointer.

Signed-off-by: Hyoung Joo Ahn <hello.ahn@samsung.com>
3 years agoRefactor/GRPC: remove duplicated get-property codes
MyungJoo Ham [Wed, 26 May 2021 02:33:52 +0000 (11:33 +0900)]
Refactor/GRPC: remove duplicated get-property codes

grpc-sink and grpc-src have suplicated codes of get-property.
Remove them.

Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
3 years ago[TEST] Change timeout of the tensor_if test
Gichan Jang [Thu, 3 Jun 2021 09:54:07 +0000 (18:54 +0900)]
[TEST] Change timeout of the tensor_if test

Change timeout of the tensor_if test.
Timeout occurs somtimes because of slow speed of the armv7l to save files.

Signed-off-by: Gichan Jang <gichan2.jang@samsung.com>
3 years ago[Tests/GstMQTT] Add more test cases for MQTTSink
Wook Song [Fri, 28 May 2021 13:45:12 +0000 (22:45 +0900)]
[Tests/GstMQTT] Add more test cases for MQTTSink

This patch adds more MQTTSink test cases that can run without the
broker.

Signed-off-by: Wook Song <wook16.song@samsung.com>
3 years ago[Gst/MQTT] Revise the meson build script for GstMQTT
Wook Song [Fri, 28 May 2021 13:29:48 +0000 (22:29 +0900)]
[Gst/MQTT] Revise the meson build script for GstMQTT

It is not supported to load GStreamer plugins from a static library. For
this reason, this patch removes the static library for the GstMQTT
plugins from the meson build script. In addition, the meson build script
is modifed to install the shared library for the GstMQTT plugins by
default.

Signed-off-by: Wook Song <wook16.song@samsung.com>
3 years ago[Flex/Common] util functions to handle pad caps
Jaeyun [Fri, 21 May 2021 08:11:24 +0000 (17:11 +0900)]
[Flex/Common] util functions to handle pad caps

add util fucntions to handle pad caps and move these to internal header.

Signed-off-by: Jaeyun <jy1210.jung@samsung.com>
3 years ago[doc] Add guide for profiling Android app
Yongjoo Ahn [Mon, 17 May 2021 09:13:08 +0000 (18:13 +0900)]
[doc] Add guide for profiling Android app

- Add guide for using GstShark to profile Android NNStreamer pipeline

Signed-off-by: Yongjoo Ahn <yongjoo1.ahn@samsung.com>
3 years ago[doc] Fix android API build guide
Yongjoo Ahn [Mon, 17 May 2021 09:11:40 +0000 (18:11 +0900)]
[doc] Fix android API build guide

- Remove the guide for modifying gstreamer build script
  It would be done by build script in nnstreamer/api repo
- Add description for tracing build option

Signed-off-by: Yongjoo Ahn <yongjoo1.ahn@samsung.com>
3 years ago[Python3] Fix flexbuffers custom converter
Gichan Jang [Mon, 24 May 2021 06:55:04 +0000 (15:55 +0900)]
[Python3] Fix flexbuffers custom converter

Fix flexbuffers custom converter script.

Signed-off-by: Gichan Jang <gichan2.jang@samsung.com>
3 years ago[Python3] Remove duplicated code
Gichan Jang [Tue, 18 May 2021 04:47:02 +0000 (13:47 +0900)]
[Python3] Remove duplicated code

Remove duplicated code for tensor converter, decoder and filter.

Signed-off-by: Gichan Jang <gichan2.jang@samsung.com>
3 years ago[Meta] define tensor meta
Jaeyun [Thu, 13 May 2021 10:27:34 +0000 (19:27 +0900)]
[Meta] define tensor meta

Define new struct for tensor metadata.
The flex-tensor buffer will have a fixed-size header per mem block.

Signed-off-by: Jaeyun <jy1210.jung@samsung.com>
3 years ago[Converter/Flatbuf,Flexbuf,Protobuf] Remove duplicated code
MyungJoo Ham [Wed, 26 May 2021 02:52:01 +0000 (11:52 +0900)]
[Converter/Flatbuf,Flexbuf,Protobuf] Remove duplicated code

Remove the duplicated function definition.
Create tensor-converter extra subplugin's common util.

Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
3 years ago[Test/Mux] testcases for flex tensor
Jaeyun [Mon, 26 Apr 2021 10:48:59 +0000 (19:48 +0900)]
[Test/Mux] testcases for flex tensor

add stream testcases for flex tensor (tensor-mux and tensor-demux)

Signed-off-by: Jaeyun <jy1210.jung@samsung.com>
3 years ago[Demux] accept flex tensor
Jaeyun [Mon, 26 Apr 2021 10:45:26 +0000 (19:45 +0900)]
[Demux] accept flex tensor

add pad template to accept flex tensor, and update source to configure tensor info for static/flex tensor stream.

Signed-off-by: Jaeyun <jy1210.jung@samsung.com>
3 years ago[Mux] accept flex tensor
Jaeyun [Mon, 26 Apr 2021 10:41:46 +0000 (19:41 +0900)]
[Mux] accept flex tensor

add pad template to support flex tensor in tensor-mux.

Signed-off-by: Jaeyun <jy1210.jung@samsung.com>
3 years ago[CodeClean/Tool] remove gv in am report
Jaeyun [Thu, 27 May 2021 03:27:02 +0000 (12:27 +0900)]
[CodeClean/Tool] remove gv in am report

improve score, remove gv in sam report.

Signed-off-by: Jaeyun <jy1210.jung@samsung.com>
3 years ago[MQTT/Test] add unittest for mqtt
Hyoung Joo Ahn [Tue, 25 May 2021 03:44:16 +0000 (12:44 +0900)]
[MQTT/Test] add unittest for mqtt

the basic test for get/set properties have been added.

Signed-off-by: Hyoung Joo Ahn <hello.ahn@samsung.com>
3 years ago[Converter/subplugins] Fix use after free
Gichan Jang [Tue, 25 May 2021 10:11:00 +0000 (19:11 +0900)]
[Converter/subplugins] Fix use after free

The internal representation of temporary of type std::string is freed by its destructor.
Copy the std::string to avoid use after free.

Signed-off-by: Gichan Jang <gichan2.jang@samsung.com>
3 years ago[TF2-Lite] Use tensorflow2 directory for include path.
MyungJoo Ham [Wed, 26 May 2021 00:55:24 +0000 (09:55 +0900)]
[TF2-Lite] Use tensorflow2 directory for include path.

If tensorflow2 headers appear in tensorflow2 directory, use it.

Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
3 years agoDist/Deb: add tf2-lite for Ubuntu
MyungJoo Ham [Tue, 18 May 2021 02:31:56 +0000 (11:31 +0900)]
Dist/Deb: add tf2-lite for Ubuntu

Per the request of #3282, add tf2-lite subpackage for Ubuntu releases.

Note that this requires merges of
https://review.tizen.org/gerrit/#/c/platform/upstream/tensorflow2/+/258437/
and then, refreshes of
https://code.launchpad.net/~nnstreamer/+recipe/tensorflow2-daily

After those, we can test build this commit.

Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
3 years ago[Alloc] ref count in allocator
Jaeyun [Tue, 25 May 2021 05:40:39 +0000 (14:40 +0900)]
[Alloc] ref count in allocator

release object after finding allocator, fix possible leak.

Signed-off-by: Jaeyun <jy1210.jung@samsung.com>
3 years ago[Tests/Meson] Include unit tests for GSTMqtt in the meson build script
Wook Song [Thu, 20 May 2021 11:52:41 +0000 (20:52 +0900)]
[Tests/Meson] Include unit tests for GSTMqtt in the meson build script

This patch modifies the meson build script to generate and run the
executable for the unit tests of the GSTMqtt elements.

Signed-off-by: Wook Song <wook16.song@samsung.com>
3 years ago[Tests/GstMQTT] Add skeleton code for MQTT elements' unit test cases
Wook Song [Thu, 20 May 2021 11:40:16 +0000 (20:40 +0900)]
[Tests/GstMQTT] Add skeleton code for MQTT elements' unit test cases

Prior to enabling the dummy operation mode, this patch adds skeleton code
for MQTT elements' unit test cases.

Signed-off-by: Wook Song <wook16.song@samsung.com>
3 years ago[Filter/tvm] set input without memory copy
Junhwan Kim [Fri, 7 May 2021 04:06:16 +0000 (13:06 +0900)]
[Filter/tvm] set input without memory copy

- Update aligned allocator to provide API for memory alignment
- Fix `set_input` to `set_input_zero_copy`
- Requires calling gst_tensor_alloc_init (127) at initial time

Signed-off-by: Junhwan Kim <jejudo.kim@samsung.com>
3 years ago[MQTTsrc] add mqtt QoS as a property
Hyoung Joo Ahn [Thu, 13 May 2021 10:28:24 +0000 (19:28 +0900)]
[MQTTsrc] add mqtt QoS as a property

MQTTsrc will return ack to server when it receives messages according to QoS level.

Signed-off-by: Hyoung Joo Ahn <hello.ahn@samsung.com>
3 years ago[Converter/CodeClean] unnecessary memory map
Jaeyun [Tue, 18 May 2021 09:24:44 +0000 (18:24 +0900)]
[Converter/CodeClean] unnecessary memory map

1. remove unnecessary memory map in chain function.
2. failure case when configuring multi tensors.

Signed-off-by: Jaeyun <jy1210.jung@samsung.com>
3 years ago[Gst/MQTT/Src] Keep subscribing to the topic only in the PLAYING state
Wook Song [Fri, 14 May 2021 06:40:10 +0000 (15:40 +0900)]
[Gst/MQTT/Src] Keep subscribing to the topic only in the PLAYING state

This patch makes the subscription be removed when the state of the
element is changed to PAUSED from PLAYING. In addition, to block the
extra invocation of the receiving message handler running on the other
thread, checking the subscription flag is added to this handler.

Signed-off-by: Wook Song <wook16.song@samsung.com>
3 years ago[Coverage/Tools] Ignore coverage report of source codes in tools
Dongju Chae [Mon, 24 May 2021 07:37:46 +0000 (16:37 +0900)]
[Coverage/Tools] Ignore coverage report of source codes in tools

This patch makes the coverage analyzer ignore the reports of source
codes in tools. We don't need to add unittests for tools.

Signed-off-by: Dongju Chae <dongju.chae@samsung.com>
3 years ago[Fix/Trivial] Fix mem leak in tensordec-pose
Yongjoo Ahn [Mon, 24 May 2021 04:27:09 +0000 (13:27 +0900)]
[Fix/Trivial] Fix mem leak in tensordec-pose

- Free allocated string in tensordec-pose

Signed-off-by: Yongjoo Ahn <yongjoo1.ahn@samsung.com>
3 years ago[TEST] Initialize tensor(s) info and config
Gichan Jang [Mon, 24 May 2021 05:26:42 +0000 (14:26 +0900)]
[TEST] Initialize tensor(s) info and config

Initialize tensor(s) info and config.

Signed-off-by: Gichan Jang <gichan2.jang@samsung.com>
3 years ago[IF] Fix uninitialized value
Gichan Jang [Mon, 24 May 2021 04:59:24 +0000 (13:59 +0900)]
[IF] Fix uninitialized value

Fix uninitialized supplied value 2.
Don't need to check the number of the supplied value.

Signed-off-by: Gichan Jang <gichan2.jang@samsung.com>
3 years ago[TEST] Fix unittest util function
Gichan Jang [Mon, 24 May 2021 04:30:40 +0000 (13:30 +0900)]
[TEST] Fix unittest util function

Fix possible double free case.

Signed-off-by: Gichan Jang <gichan2.jang@samsung.com>
3 years agoRefactor/GRPC: remove duplicated codes
MyungJoo Ham [Tue, 18 May 2021 04:45:43 +0000 (13:45 +0900)]
Refactor/GRPC: remove duplicated codes

grpc-sink and grpc-src have duplicated codes. Remove them.

Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>