platform/upstream/nnstreamer.git
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>
3 years ago[Tool/Parser] check null ptr
Jaeyun [Thu, 20 May 2021 03:35:23 +0000 (12:35 +0900)]
[Tool/Parser] check null ptr

In tool/parser, check null ptr before comparing the id.

Signed-off-by: Jaeyun <jy1210.jung@samsung.com>
3 years ago[Gst/MQTT] Revise README.md
Wook Song [Thu, 20 May 2021 04:21:52 +0000 (13:21 +0900)]
[Gst/MQTT] Revise README.md

This patch slightly revises README.md.

Signed-off-by: Wook Song <wook16.song@samsung.com>
3 years ago[Converter/CodeClean] remove unnecessary arg
Jaeyun [Mon, 17 May 2021 11:19:36 +0000 (20:19 +0900)]
[Converter/CodeClean] remove unnecessary arg

Code clean, remove unnecessary arg in converter internal functions.

Signed-off-by: Jaeyun <jy1210.jung@samsung.com>
3 years ago[Tools/Parser] Convert gst pipeline to pbtxt (w/ mediapipe demo site)
Dongju Chae [Thu, 13 May 2021 07:48:32 +0000 (16:48 +0900)]
[Tools/Parser] Convert gst pipeline to pbtxt (w/ mediapipe demo site)

This patch converts gst pipeline to pbtxt. It also works on mediapipe demo site.

Signed-off-by: Dongju Chae <dongju.chae@samsung.com>
3 years agoAdding information about misc ppa
shortcipher3 [Mon, 17 May 2021 15:00:14 +0000 (09:00 -0600)]
Adding information about misc ppa

Adding information about misc ppa to make join plugin more discoverable, also added details to make other packages more discoverable.

Signed-off-by: shortcipher3 <chris.jon.hall@gmail.com>
3 years ago[Crop] output framerate
Jaeyun [Fri, 14 May 2021 09:33:51 +0000 (18:33 +0900)]
[Crop] output framerate

While caps negotiation, set output framerate from input configuration.

Signed-off-by: Jaeyun <jy1210.jung@samsung.com>
3 years ago[MQTTsink] revive the removed callback
Hyoung Joo Ahn [Mon, 17 May 2021 08:33:57 +0000 (17:33 +0900)]
[MQTTsink] revive the removed callback

according to the `paho-c-mqtt`, if the `message_arrived` callback is null, the others are not registered. For this reason, the removed callback should be existed even they are not called.

Signed-off-by: Hyoung Joo Ahn <hello.ahn@samsung.com>
3 years ago[Tools/Parser] Add nnstreamer-parser to util package
Dongju Chae [Thu, 13 May 2021 04:38:26 +0000 (13:38 +0900)]
[Tools/Parser] Add nnstreamer-parser to util package

This patch nnstreamer-parser to util package.

Signed-off-by: Dongju Chae <dongju.chae@samsung.com>
3 years ago[Test/Filter] testcase for flex tensor
Jaeyun [Mon, 3 May 2021 09:21:32 +0000 (18:21 +0900)]
[Test/Filter] testcase for flex tensor

add testcases to handle flexible tensor.

Signed-off-by: Jaeyun <jy1210.jung@samsung.com>
3 years ago[Filter] support flex tensor
Jaeyun [Mon, 3 May 2021 09:17:55 +0000 (18:17 +0900)]
[Filter] support flex tensor

Add pad template to support flex tensor in tensor-filter.

If incoming tensor is flexible, tensor-filter cannot get the meta from caps.
In this case, tensor-filter gets model info from subplugin and compares buffer size in transform().
That means, if the model handles non-static info (e.g., set-dimension with input info), it cannot support flex tensor.

Signed-off-by: Jaeyun <jy1210.jung@samsung.com>
3 years ago[Crop] add two sink pads
Jaeyun [Thu, 13 May 2021 03:16:54 +0000 (12:16 +0900)]
[Crop] add two sink pads

tensor-crop has 2 sink pads - raw and info.
- raw: receive raw tensor data to be cropped (other/tensor)
- info: receive crop info (other/tensors-flexible)

The output is cropped tensors (flex tensor format).

TODO
1. define GstTensorCropInfo (x,y,w,h) in tensor_typedef.h
2. add cropping in chain function

Signed-off-by: Jaeyun <jy1210.jung@samsung.com>
3 years ago[Gst/MQTT/Src] Avoid deadlock cases in create() of GstBaseSrcClass
Wook Song [Fri, 14 May 2021 04:09:11 +0000 (13:09 +0900)]
[Gst/MQTT/Src] Avoid deadlock cases in create() of GstBaseSrcClass

In the current implementation of GstBaseSrcClass's create vmethod, it is
possible that deadlock occurs since some error cases during the
initialization are not properly handled. This patch fixes this bug.

Signed-off-by: Wook Song <wook16.song@samsung.com>
3 years ago[TEST] Fix tensor converter python3 test
Gichan Jang [Fri, 14 May 2021 06:16:15 +0000 (15:16 +0900)]
[TEST] Fix tensor converter python3 test

 - Remove the test related files.
 - Remove debugging messages

Signed-off-by: Gichan Jang <gichan2.jang@samsung.com>
3 years ago[Decoder] Add tensor decoder python subplugins
Gichan Jang [Mon, 3 May 2021 10:56:37 +0000 (19:56 +0900)]
[Decoder] Add tensor decoder python subplugins

Add tensor decoder python subplugins.

Signed-off-by: Gichan Jang <gichan2.jang@samsung.com>
3 years ago[MQTTsink] remove message arrived cb
Hyoung Joo Ahn [Thu, 13 May 2021 10:43:41 +0000 (19:43 +0900)]
[MQTTsink] remove message arrived cb

The callback `on_message_arrived ()` is not required for MQTTsink because it publishes the messages

Signed-off-by: Hyoung Joo Ahn <hello.ahn@samsung.com>
3 years ago[Test] testcases for flex tensor
Jaeyun [Fri, 23 Apr 2021 11:30:08 +0000 (20:30 +0900)]
[Test] testcases for flex tensor

add testcases about flex-tensor stream.

Signed-off-by: Jaeyun <jy1210.jung@samsung.com>
3 years ago[Converter] support flex tensor
Jaeyun [Fri, 23 Apr 2021 11:28:36 +0000 (20:28 +0900)]
[Converter] support flex tensor

Add pad template to handle flex tensors.
tensor-converter supports changing capability from flex to static, or static to flex if downstream element has flex-tensor caps.

Signed-off-by: Jaeyun <jy1210.jung@samsung.com>
3 years ago[Tools/Parser] Find element name in the pipeline
Dongju Chae [Tue, 11 May 2021 09:03:56 +0000 (18:03 +0900)]
[Tools/Parser] Find element name in the pipeline

This patch finds element name in the pipeline.

Signed-off-by: Dongju Chae <dongju.chae@samsung.com>
3 years ago[Fix/Filter] Fix tensors info initialization
Junhwan Kim [Thu, 13 May 2021 04:54:19 +0000 (13:54 +0900)]
[Fix/Filter] Fix tensors info initialization

- Internal tensors-info is not correctly initialized for some sub filters, causing incompatible format error.

Signed-off-by: Junhwan Kim <jejudo.kim@samsung.com>
3 years ago[MQTTsink] add mqtt QoS as a property
Hyoung Joo Ahn [Thu, 13 May 2021 03:26:40 +0000 (12:26 +0900)]
[MQTTsink] add mqtt QoS as a property

To activate the delivery_complete callback, the `mqtt-qos` property is required.

Signed-off-by: Hyoung Joo Ahn <hello.ahn@samsung.com>
3 years ago[Converter] Add subplugins for python custom converter
Gichan Jang [Thu, 22 Apr 2021 00:29:13 +0000 (09:29 +0900)]
[Converter] Add subplugins for python custom converter

Add subplugins for python custom converter

Signed-off-by: Gichan Jang <gichan2.jang@samsung.com>
3 years ago[MQTTsrc] remove cb_mqtt_on_delivery_complete ()
Hyoung Joo Ahn [Wed, 12 May 2021 11:40:32 +0000 (20:40 +0900)]
[MQTTsrc] remove cb_mqtt_on_delivery_complete ()

this callbeck is useless for the subscriber

Signed-off-by: Hyoung Joo Ahn <hello.ahn@samsung.com>
3 years ago[MQTTsrc] add log messages when connection lost
Hyoung Joo Ahn [Wed, 12 May 2021 11:12:48 +0000 (20:12 +0900)]
[MQTTsrc] add log messages when connection lost

Since the `cause` of cb_connection_lost is always null, IMO, we need to guide user to check the log messages of the broker

Signed-off-by: Hyoung Joo Ahn <hello.ahn@samsung.com>
3 years ago[MQTTsrc] change the keep alive interval
Hyoung Joo Ahn [Wed, 12 May 2021 11:12:38 +0000 (20:12 +0900)]
[MQTTsrc] change the keep alive interval

set the DEFAULT_MQTT_KEEP_ALIVE_INTERVAL to 1 minute.

Signed-off-by: Hyoung Joo Ahn <hello.ahn@samsung.com>