platform/upstream/nnstreamer.git
3 years ago[Filter] add a hash table for shared key
Hyoung Joo Ahn [Tue, 29 Jun 2021 15:15:29 +0000 (00:15 +0900)]
[Filter] add a hash table for shared key

[Filter] add a hash table for shared key

Signed-off-by: Hyoung Joo Ahn <hello.ahn@samsung.com>
3 years ago[Filter/Common] declare extern
Jaeyun [Fri, 27 Aug 2021 09:29:07 +0000 (18:29 +0900)]
[Filter/Common] declare extern

Declare extern to prevent warning when using filter common functions in cpp.

Signed-off-by: Jaeyun <jy1210.jung@samsung.com>
3 years ago[query/server] Fix possible leaks in query_server_data_free
Yongjoo Ahn [Fri, 27 Aug 2021 08:19:00 +0000 (17:19 +0900)]
[query/server] Fix possible leaks in query_server_data_free

- Free remaining TensorQueryConnection in conn_queue
- Clear error in query_connect

Signed-off-by: Yongjoo Ahn <yongjoo1.ahn@samsung.com>
3 years ago[Query/Sink] handle error case
Jaeyun [Thu, 26 Aug 2021 07:57:03 +0000 (16:57 +0900)]
[Query/Sink] handle error case

Fix error case, unmap memory block when failed to send data to client.

Signed-off-by: Jaeyun <jy1210.jung@samsung.com>
3 years ago[Query] Fix unnecessary unreference accepted/tizen/unified/20210826.123536 submit/tizen/20210826.061507
Gichan Jang [Tue, 24 Aug 2021 08:24:58 +0000 (17:24 +0900)]
[Query] Fix unnecessary unreference

GstBaseSink unref object after render.
So, don't need to unref out buffer.

Signed-off-by: Gichan Jang <gichan2.jang@samsung.com>
3 years ago[Query] Handle tensor query meta
Gichan Jang [Fri, 20 Aug 2021 06:12:21 +0000 (15:12 +0900)]
[Query] Handle tensor query meta

 - Null check of the tensor query meta
 - Copy GstMeta of the first buffer to outbuf for collect pad.
   -> Copy policy should be updated considering multiple clients.

Signed-off-by: Gichan Jang <gichan2.jang@samsung.com>
3 years ago[Query] Change property type
Gichan Jang [Wed, 25 Aug 2021 07:46:46 +0000 (16:46 +0900)]
[Query] Change property type

Change port property type to unsigned int.

Signed-off-by: Gichan Jang <gichan2.jang@samsung.com>
3 years ago[Filter/Sub] add event handler for filter-fw v0
Jaeyun [Fri, 20 Aug 2021 06:16:05 +0000 (15:16 +0900)]
[Filter/Sub] add event handler for filter-fw v0

Add event handler for filter framework v0 and new event to check hw availability with custom option.

Signed-off-by: Jaeyun <jy1210.jung@samsung.com>
3 years ago[mqtt/trivial] Fix typos in mqtt related codes
Yongjoo Ahn [Mon, 23 Aug 2021 06:30:27 +0000 (15:30 +0900)]
[mqtt/trivial] Fix typos in mqtt related codes

- Fix some minor typos in mqtt related codes

Signed-off-by: Yongjoo Ahn <yongjoo1.ahn@samsung.com>
3 years ago[Test] unittest pkg
Jaeyun [Wed, 18 Aug 2021 11:57:56 +0000 (20:57 +0900)]
[Test] unittest pkg

Add test directory into unittest pkg and remove generated files.

Signed-off-by: Jaeyun <jy1210.jung@samsung.com>
3 years ago[Test/Py/CodeClean] util functions to run test
Jaeyun [Fri, 20 Aug 2021 02:59:32 +0000 (11:59 +0900)]
[Test/Py/CodeClean] util functions to run test

Code clean, reduce duplicated source. Add util functions to run the unittest.

Signed-off-by: Jaeyun <jy1210.jung@samsung.com>
3 years ago[tools/pbtxt/py] fix warning
Jaeyun [Thu, 19 Aug 2021 09:06:42 +0000 (18:06 +0900)]
[tools/pbtxt/py] fix warning

remove global variables - it complains not to set global val.

Signed-off-by: Jaeyun <jy1210.jung@samsung.com>
3 years ago[Test/bmp2png]: Fix -Werror errors after warnings level increase
Xavier Roumegue [Thu, 19 Aug 2021 13:02:51 +0000 (13:02 +0000)]
[Test/bmp2png]: Fix -Werror errors after warnings level increase

This fixes the following error, encountered with gcc 10.2:

| ../../../../../../workspace/sources/nnstreamer/tests/bmp2png.c: In function 'save_png_to_file':
| ../../../../../../workspace/sources/nnstreamer/tests/bmp2png.c:95:16: error: variable 'status' might be clobbered by 'longjmp' or 'vfork' [-Werror=clobbered]
|    95 |   register int status = -1;
|       |                ^~~~~~
| cc1: all warnings being treated as errors

Signed-off-by: Xavier Roumegue <xavier.roumegue@nxp.com>
3 years ago[Filter/Vivante] Fix -Werror after warnings level increase
Xavier Roumegue [Thu, 19 Aug 2021 12:59:16 +0000 (12:59 +0000)]
[Filter/Vivante] Fix -Werror after warnings level increase

This fixes the following errors:

../../../../../../workspace/sources/nnstreamer/ext/nnstreamer/tensor_filter/vivante/tensor_filter_subplugin.c:411:50: error: unused parameter 'prop' [-Werror=unused-parameter]
  411 | vivante_close (const GstTensorFilterProperties * prop, void **private_data)
      |                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~
../../../../../../workspace/sources/nnstreamer/ext/nnstreamer/tensor_filter/vivante/tensor_filter_subplugin.c: In function 'vivante_invoke':
../../../../../../workspace/sources/nnstreamer/ext/nnstreamer/tensor_filter/vivante/tensor_filter_subplugin.c:456:17: error: comparison of integer expressions of different signedness: 'int' and 'uint32_t' {aka 'unsigned int'} [-Werror=sign-compare]
  456 |   for (i = 0; i < pdata->graph->input.num; i++) {
      |                 ^
../../../../../../workspace/sources/nnstreamer/ext/nnstreamer/tensor_filter/vivante/tensor_filter_subplugin.c:507:17: error: comparison of integer expressions of different signedness: 'int' and 'uint32_t' {aka 'unsigned int'} [-Werror=sign-compare]
  507 |   for (i = 0; i < pdata->graph->output.num; i++) {
      |                 ^
../../../../../../workspace/sources/nnstreamer/ext/nnstreamer/tensor_filter/vivante/tensor_filter_subplugin.c:438:51: error: unused parameter 'prop' [-Werror=unused-parameter]
  438 | vivante_invoke (const GstTensorFilterProperties * prop,
      |                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~
../../../../../../workspace/sources/nnstreamer/ext/nnstreamer/tensor_filter/vivante/tensor_filter_subplugin.c: In function 'vivante_getInputDim':
../../../../../../workspace/sources/nnstreamer/ext/nnstreamer/tensor_filter/vivante/tensor_filter_subplugin.c:538:56: error: unused parameter 'prop' [-Werror=unused-parameter]
  538 | vivante_getInputDim (const GstTensorFilterProperties * prop,
      |                      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~
../../../../../../workspace/sources/nnstreamer/ext/nnstreamer/tensor_filter/vivante/tensor_filter_subplugin.c: In function 'vivante_getOutputDim':
../../../../../../workspace/sources/nnstreamer/ext/nnstreamer/tensor_filter/vivante/tensor_filter_subplugin.c:561:57: error: unused parameter 'prop' [-Werror=unused-parameter]
  561 | vivante_getOutputDim (const GstTensorFilterProperties * prop,
      |                       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~
cc1: all warnings being treated as errors

Signed-off-by: Xavier Roumegue <xavier.roumegue@nxp.com>
3 years ago[tools/pbtxt/py] fix warning
Jaeyun [Thu, 19 Aug 2021 07:07:43 +0000 (16:07 +0900)]
[tools/pbtxt/py] fix warning

Fix warning - undefined variables.

Signed-off-by: Jaeyun <jy1210.jung@samsung.com>
3 years ago[Query] Support flexible tensors format
Gichan Jang [Thu, 12 Aug 2021 09:55:37 +0000 (18:55 +0900)]
[Query] Support flexible tensors format

Support flexible tensors format for tensor query.

Test pipeline
server:
 gst-launch-1.0 tensor_query_serversrc host=127.0.0.1 ! other/tensors,format=flexible ! tensor_query_serversink host=127.0.0.1
client:
 gst-launch-1.0 v4l2src ! videoconvert ! videoscale !  video/x-raw,width=320,height=240,format=RGB,framerate=30/1 ! tensor_converter ! other/tensors,format=flexible ! tensor_query_client src-host=127.0.0.1 sink-host=127.0.0.1 ! tensor_converter input-dim=3:320:240 input-type=uint8 ! tensor_decoder mode=direct_video ! videoconvert ! ximagesink

Signed-off-by: Gichan Jang <gichan2.jang@samsung.com>
3 years ago[SAM/CodeClean/Py] fix pylint and syntax error
Jaeyun [Tue, 17 Aug 2021 03:19:52 +0000 (12:19 +0900)]
[SAM/CodeClean/Py] fix pylint and syntax error

Code clean, fix pylint warning and syntax error.
- indent with 4 spaces
- function name rule: lowercase
- 2 blank lines between class and function

Signed-off-by: Jaeyun <jy1210.jung@samsung.com>
3 years ago[LICENSE] Add SPDX reference in LICENSE file.
gichan [Tue, 17 Aug 2021 07:10:14 +0000 (16:10 +0900)]
[LICENSE] Add SPDX reference in LICENSE file.

Add SPDX license identifier reference in LICENSE file.

Signed-off-by: gichan <gichan2.jang@samsung.com>
3 years ago[tensor_query] Fix double free in tensor_query_server
Yongjoo Ahn [Wed, 18 Aug 2021 04:53:51 +0000 (13:53 +0900)]
[tensor_query] Fix double free in tensor_query_server

- Assign NULL value after call `query_server_data_free` to  prevent double free
- Remove some trailing spaces

Signed-off-by: Yongjoo Ahn <yongjoo1.ahn@samsung.com>
3 years ago[Query] Change GLib types to standard types.
gichan [Tue, 17 Aug 2021 02:13:52 +0000 (11:13 +0900)]
[Query] Change GLib types to standard types.

 - Change type of the port from uint32 to uint16.
 - Change Glib types to standard types.

Signed-off-by: Gichan Jang <gichan2.jang@samsung.com>
3 years ago[Query] Add address resolver for server
gichan [Fri, 13 Aug 2021 07:13:42 +0000 (16:13 +0900)]
[Query] Add address resolver for server

Add address resolver for server.

Signed-off-by: gichan <gichan2.jang@samsung.com>
3 years ago[Filter/Sub] unnecessary log to get subplugin from ini
Jaeyun [Tue, 17 Aug 2021 09:56:46 +0000 (18:56 +0900)]
[Filter/Sub] unnecessary log to get subplugin from ini

Remove unnecessary log while loading sub-plugins from conf file.

Signed-off-by: Jaeyun <jy1210.jung@samsung.com>
3 years ago[Query] Fix resource leak
Gichan Jang [Wed, 18 Aug 2021 01:59:19 +0000 (10:59 +0900)]
[Query] Fix resource leak

Fix resource leaks reported by coverity.

Signed-off-by: Gichan Jang <gichan2.jang@samsung.com>
3 years ago[Build] Set 'filter-aliases' option for trix-engine
Sangjung Woo [Wed, 11 Aug 2021 07:40:25 +0000 (16:40 +0900)]
[Build] Set 'filter-aliases' option for trix-engine

The sub-plugin name of SRNPU is changed to trix-engine. So this patch
add 'trix-engine = srnpu' option in 'filter-aliases' field to provide
backward compatibility.

Signed-off-by: Sangjung Woo <sangjung.woo@samsung.com>
3 years ago[Filter/Sub] Support 'filter-aliases' option
Sangjung Woo [Wed, 11 Aug 2021 07:36:46 +0000 (16:36 +0900)]
[Filter/Sub] Support 'filter-aliases' option

This patch supports the 'filter-aliases' option for searching the
sub-plugin. For example, if 'tf = tensorflow' option is given,
application developers can use 'framework = tf' in pipeline description
to use 'tensorflow' sub-plugin.

Signed-off-by: Sangjung Woo <sangjung.woo@samsung.com>
3 years ago[fix/build] Fix build error unused vars
Yongjoo Ahn [Tue, 17 Aug 2021 04:59:26 +0000 (13:59 +0900)]
[fix/build] Fix build error unused vars

- Fix unused var build error in tensorrt related codes

Signed-off-by: Yongjoo Ahn <yongjoo1.ahn@samsung.com>
3 years ago[Query] res leak
Jaeyun [Fri, 13 Aug 2021 05:41:06 +0000 (14:41 +0900)]
[Query] res leak

Code clean, fix possible res leak and invalid param.

Signed-off-by: Jaeyun <jy1210.jung@samsung.com>
3 years ago[Query] Update server elements
Junhwan Kim [Tue, 10 Aug 2021 13:07:06 +0000 (22:07 +0900)]
[Query] Update server elements

Update query serversrc, serversink & meta-query
Src accepts connection from clients receiving messages such as
- Request Info : send back to client w/ src tensor config
- Start : indicates beginning of data transfer
- Data : contains tensor data
- End : ends transfer

Sink can identify client by meta-query, which contains host address
Sink sends transformed tensor by same policy

Example pipeline
```
gst-launch-1.0 tensor_query_serversrc host=127.0.0.1 ! other/tensors,num_tensors=1,dimensions=3:300:300:1,types=uint8,framerate=30/1 ! tensor_query_serversink host=127.0.0.1

gst-launch-1.0 v4l2src ! videoconvert ! videoscale ! video/x-raw,width=300,height=300,format=RGB,framerate=30/1 ! tensor_converter ! tensor_query_client src-host=127.0.0.1 sink-host=127.0.0.1 ! tensor_decoder mode=direct_video ! videoconvert ! ximagesink
```

Signed-off-by: Junhwan Kim <jejudo.kim@samsung.com>
3 years ago[Query/common] Update server to handle multi-clients
Junhwan Kim [Tue, 10 Aug 2021 12:56:39 +0000 (21:56 +0900)]
[Query/common] Update server to handle multi-clients

Query server should be capable of serving multi-clients
Update asynchronous handler to accept async connection

Signed-off-by: Junhwan Kim <jejudo.kim@samsung.com>
3 years ago[Query] Implement tensor query client
Gichan Jang [Wed, 11 Aug 2021 01:03:55 +0000 (10:03 +0900)]
[Query] Implement tensor query client

Implement tensor query client.
todo: support various protocols, error handling

Signed-off-by: Gichan Jang <gichan2.jang@samsung.com>
3 years ago[Repo] remove meta
Jaeyun [Mon, 9 Aug 2021 09:03:21 +0000 (18:03 +0900)]
[Repo] remove meta

Gstreamer-meta in tensor repo only handles pad caps. Move caps into repo-data and remove repo-meta info.

Signed-off-by: Jaeyun <jy1210.jung@samsung.com>
3 years ago[Query] Implement common utils for TCP
Junhwan Kim [Tue, 3 Aug 2021 08:32:17 +0000 (17:32 +0900)]
[Query] Implement common utils for TCP

Common API functions used for both client and server elements
Currently based on TCP connections

TODO
- Enable timeout

Signed-off-by: Junhwan Kim <jejudo.kim@samsung.com>
3 years ago[Gst/Mqtt] Resolve compiler warnings
Gichan Jang [Mon, 9 Aug 2021 02:58:32 +0000 (11:58 +0900)]
[Gst/Mqtt] Resolve compiler warnings

Resolve compiler warnings.
 - Unused parameter
 - Different type comparison

Signed-off-by: Gichan Jang <gichan2.jang@samsung.com>
3 years ago[Filter] Rename srnpu to trix-engine accepted/tizen/unified/20210810.135401 submit/main/20210806.045326 submit/tizen/20210806.045403 submit/tizen/20210809.021120
Sangjung Woo [Wed, 4 Aug 2021 05:38:18 +0000 (14:38 +0900)]
[Filter] Rename srnpu to trix-engine

The patch update the name 'srnpu' to 'trix-engine'.

Signed-off-by: Sangjung Woo <sangjung.woo@samsung.com>
3 years ago[Config/Format] tensor format in config
Jaeyun [Tue, 20 Jul 2021 10:00:37 +0000 (19:00 +0900)]
[Config/Format] tensor format in config

Set tensor format from caps struct.
tensor stream has single format, so format in tensor-info struct is unnecessary.

Signed-off-by: Jaeyun <jy1210.jung@samsung.com>
3 years agoTFLite: Allow to skip flatbuf dep check
MyungJoo Ham [Wed, 4 Aug 2021 02:26:43 +0000 (11:26 +0900)]
TFLite: Allow to skip flatbuf dep check

In Yocto build, it appears that flatbuf dep check
is not available:
https://github.com/nnstreamer/meta-neural-network/blob/master/recipes-nnstreamer/nnstreamer/files/0001-Disable-flatbuf-check-for-tf-lite-for-yocto-build.patch

@anyj0527 : Let's remove all *.patch files from
meta-neural-network by updating related nnstreamer/*.git
*.patch files in meta-neural-network are obvious
hazards.

Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
3 years ago[filter/SNAP] Add TensorFlow Lite support
Yongjoo Ahn [Mon, 2 Aug 2021 11:13:54 +0000 (20:13 +0900)]
[filter/SNAP] Add TensorFlow Lite support

- SNAP v3.0 supports inference with TensorFlow Lite.
- Add the supported enum.

Signed-off-by: Yongjoo Ahn <yongjoo1.ahn@samsung.com>
3 years ago[Subplugin/Py] prevent resizing the array length
Jaeyun [Mon, 2 Aug 2021 02:30:22 +0000 (11:30 +0900)]
[Subplugin/Py] prevent resizing the array length

In the sub-plugins for python, prevent resizing the array length when creating new array object.

Signed-off-by: Jaeyun <jy1210.jung@samsung.com>
3 years ago[Doc] Add serialized buffer description
gichan [Tue, 3 Aug 2021 01:15:42 +0000 (10:15 +0900)]
[Doc] Add serialized buffer description

Add serialized buffer description.(flatbuf, protobuf, flexbuf)

Signed-off-by: gichan <gichan2.jang@samsung.com>
3 years ago[Test/Ubuntu] add nnfw test
Jaeyun [Tue, 27 Jul 2021 06:20:52 +0000 (15:20 +0900)]
[Test/Ubuntu] add nnfw test

enable nnfw subplugin test in ubuntu build.

Signed-off-by: Jaeyun <jy1210.jung@samsung.com>
3 years ago[Converter/Py] mem size
Jaeyun [Thu, 29 Jul 2021 07:29:53 +0000 (16:29 +0900)]
[Converter/Py] mem size

set memory size from mapped info, not buffer size.

Signed-off-by: Jaeyun <jy1210.jung@samsung.com>
3 years ago[Build] fix build error
Jaeyun [Fri, 30 Jul 2021 11:07:32 +0000 (20:07 +0900)]
[Build] fix build error

Fix build error after changing warning level.

Signed-off-by: Jaeyun <jy1210.jung@samsung.com>
3 years agoDIST (rpm/deb): add nnstreamer-util.h
MyungJoo Ham [Wed, 28 Jul 2021 09:20:13 +0000 (18:20 +0900)]
DIST (rpm/deb): add nnstreamer-util.h

The newly introduced external header should be
included in devel package.

Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
3 years agoStyle fix of gst-indent
MyungJoo Ham [Wed, 28 Jul 2021 08:21:01 +0000 (17:21 +0900)]
Style fix of gst-indent

With a lot of files modified by previous "warning fix" commit,
unrelated style fixes are required.

Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
3 years agoIncrease warning level and resolve compiler warnings.
MyungJoo Ham [Tue, 27 Jul 2021 10:31:11 +0000 (19:31 +0900)]
Increase warning level and resolve compiler warnings.

1. Increase warning level of meson from 1 --> 2.
2. Resolve all warnings.

TODO: Increase warning level further.

Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
3 years agoCommon: add a common util header.
MyungJoo Ham [Wed, 28 Jul 2021 08:18:01 +0000 (17:18 +0900)]
Common: add a common util header.

For nnstreamer developers including sub-plugin writers,
provide a common nnstreamer utility header that does not
depend on additional libraries.

TODO: migrate such functions from other external headers.

Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
3 years agoTransform: ignore warnings from generated files.
MyungJoo Ham [Wed, 28 Jul 2021 01:18:22 +0000 (10:18 +0900)]
Transform: ignore warnings from generated files.

For the increased warning level, add a script to ignore
warnings from generated C files.

Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
3 years ago[Test] fix res leak
Jaeyun [Thu, 29 Jul 2021 06:09:07 +0000 (15:09 +0900)]
[Test] fix res leak

fix res leak in tvm testcase.

Signed-off-by: Jaeyun <jy1210.jung@samsung.com>
3 years agoMove nnstreamer_example to tests/
MyungJoo Ham [Wed, 28 Jul 2021 09:17:23 +0000 (18:17 +0900)]
Move nnstreamer_example to tests/

With nnstreamer_example directory at the top,
some users are confused and thought that this directory
is the official nnstreamer example apps.

However, these are merely example codes for unit tests;
thus, they should be moved into tests to prevent
the confusion.

Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
3 years agoCommon: refactor silent_debug() and make it common
MyungJoo Ham [Thu, 15 Jul 2021 07:44:28 +0000 (16:44 +0900)]
Common: refactor silent_debug() and make it common

1. Provide common macro of silent_debug and silent_debug_caps,
 which had been repeatedly defined in each plugin.
2. Refactor the two macros to get "object" as an argument
 so that it wouldn't use implicit argument exceot for "DBG".

The same macros are not touched in /ext directory
because they are not supposed to include "tensor_common.h",
which is an internal header.

@todo There are a few subplugins in /ext (not tensor-filter)
that uses "tensor_common.h". They should be refactored not to
use internal headers so that we can separate them to
independent repo anytime. Although we don't have such plans,
we need to keep them as appropriate examples for users.

Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
3 years ago[Common] remove tensor-config struct
Jaeyun [Wed, 7 Jul 2021 08:40:16 +0000 (17:40 +0900)]
[Common] remove tensor-config struct

Remove tensor-config struct (for single tensor) and replace it to tensors-config.

Signed-off-by: Jaeyun <jy1210.jung@samsung.com>
3 years ago[Query] Define tensor query common data structures.
Gichan Jang [Thu, 22 Jul 2021 05:17:23 +0000 (14:17 +0900)]
[Query] Define tensor query common data structures.

Re-define tensor query common data structures.

Signed-off-by: Gichan Jang <gichan2.jang@samsung.com>
3 years ago[TVM/test] Add models for more architectures
Junhwan Kim [Fri, 16 Jul 2021 10:59:24 +0000 (19:59 +0900)]
[TVM/test] Add models for more architectures

Add tvm test models to support test on arm and aarch64

Signed-off-by: Junhwan Kim <jejudo.kim@samsung.com>
3 years ago[Test] update testcases about changed caps
Jaeyun [Mon, 5 Jul 2021 11:14:02 +0000 (20:14 +0900)]
[Test] update testcases about changed caps

Old mime type for flex-tensor is removed, and added format in caps string.
Fix all related testcases.

Signed-off-by: Jaeyun <jy1210.jung@samsung.com>
3 years ago[Caps/Format] add tensor format in caps
Jaeyun [Mon, 5 Jul 2021 11:05:16 +0000 (20:05 +0900)]
[Caps/Format] add tensor format in caps

Add tensor format in caps.
Fix pad template with flex tensor and remove old mimetype.
Now caps string for flex-tensor has framerate field.

Signed-off-by: Jaeyun <jy1210.jung@samsung.com>
3 years ago[SparseTensor] Define SparseTensor and API
Yongjoo Ahn [Wed, 16 Jun 2021 04:27:00 +0000 (13:27 +0900)]
[SparseTensor] Define SparseTensor and API

- Define a tensor_format for SparseTensor
- Define a info structure for SparseTensor which has "length" of
  non-zero elements
- Add a internal header `tensor_sparse_util.h` for util functions that
  will be used in related elements
- Add a union in GstTensorMetaInfo for SparseTensor

SparseTensors could be more efficient on processing of tensors that
contain a lot of zero values.
I'll adopt the coordinate list (COO) format for encoding it, same as
other NN frameworks.

The COO encoding for sparse tensors is comprised of REF:
(https://www.tensorflow.org/guide/sparse_tensor):

values: A 1D tensor with shape [N] containing all nonzero values.
indices: A 2D tensor with shape [N, rank], containing the indices of the
nonzero values.
dense_shape: A 1D tensor with shape [rank], specifying the shape of the
tensor.

For example a Tensor
```
[[1, 0, 0, 0]
 [0, 0, 2, 0]
 [0, 0, 0, 0]]
```
can be encoded as
```
SparseTensor(values=[1, 2], indices=[[0, 0], [1, 2]], dense_shape=[3, 4])
```

In our project, a SparseTensor should be encoded with these information:
```cpp
tensor_type   data_type;
tensor_dim    dense_shape;
unsigned int  nnz; /* the number of non-zero elements */
data_type     values[nnz];
unsigned int  indices[nnz][RANK_LIMIT];
```

Since data_type and dense_shape are could be represented in `GstTensorMetaInfo`,
Add a `GstSparseTensorInfo`, and let it have the `nnz` (number of non-zeros).
The values and indices are stored in a single memory chunk, and the
`nnz` information would be used for parsing the buffer.

Signed-off-by: Yongjoo Ahn <yongjoo1.ahn@samsung.com>
3 years ago[Build/Deb] dependency to NNFW
Jaeyun [Tue, 20 Jul 2021 10:57:09 +0000 (19:57 +0900)]
[Build/Deb] dependency to NNFW

Add new pkg for NNFW (ONE) in debian build.

Related issue: https://github.com/Samsung/ONE/issues/7196

Signed-off-by: Jaeyun <jy1210.jung@samsung.com>
3 years agoPaho-mqtt: enable to use paho-mqtt w/o pkgconfig submit/tizen/20210723.070532
MyungJoo Ham [Fri, 9 Jul 2021 06:46:04 +0000 (15:46 +0900)]
Paho-mqtt: enable to use paho-mqtt w/o pkgconfig

In case pkgconfig is not available for paho-mqtt,
prepare hardcoded library dependencies for paho-mqtt.

However, using this hardcoded dependency is not recommended
and using pkgconfig files is already recommended.

paho-mqtt build is force-enabled for Debian, too.

Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
3 years agoDebian: add debian release changelog for Sid
MyungJoo Ham [Wed, 7 Jul 2021 10:53:39 +0000 (19:53 +0900)]
Debian: add debian release changelog for Sid

Add Debian Sid as debian release target.
Sid is the "devel" version of Debian.

Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
3 years agoDebian: enable armnn in Sid.
MyungJoo Ham [Mon, 5 Jul 2021 06:55:59 +0000 (15:55 +0900)]
Debian: enable armnn in Sid.

Debian-Sid has armnn without pkgconfig.
Allow to use armnn without pkgconfig file.

Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
3 years agoMeson: use flatbuf if it's >= 2.0.0
MyungJoo Ham [Mon, 5 Jul 2021 05:19:29 +0000 (14:19 +0900)]
Meson: use flatbuf if it's >= 2.0.0

Restrict flatbuf version to 2.0.0 or higher.
Older flatbuf incurs test case errors.
Disable related test cases, too.

Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
3 years agoUbuntu: Xenial build fail with pdebuild fixed.
MyungJoo Ham [Mon, 5 Jul 2021 03:30:30 +0000 (12:30 +0900)]
Ubuntu: Xenial build fail with pdebuild fixed.

Xenial appears to identify build-deps before dh_clean.
Keep Ubuntu-Xenial control file as default for this issue.

In Ubuntu-Bionic or Debian-Sid, there is no such issues.

Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
3 years agoDebian: disable edge-tpu and openvino.
MyungJoo Ham [Mon, 5 Jul 2021 03:06:53 +0000 (12:06 +0900)]
Debian: disable edge-tpu and openvino.

Debian does not have edge-tpu or openvino ready, yet.

Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
3 years agoDebian: skip SSAT for Debian
MyungJoo Ham [Mon, 5 Jul 2021 02:50:09 +0000 (11:50 +0900)]
Debian: skip SSAT for Debian

We have not duploaded SSAT for Debian.
Skip SSAT for Debian.

Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
3 years agoDebian: draft Debian distro build files.
MyungJoo Ham [Thu, 1 Jul 2021 02:00:51 +0000 (11:00 +0900)]
Debian: draft Debian distro build files.

Provided packages are a bit different between Ubuntu and Debian.
Provide a different control file for Debian builds.

Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
3 years agoDebian: multiple control files for different distros.
MyungJoo Ham [Wed, 30 Jun 2021 09:35:20 +0000 (18:35 +0900)]
Debian: multiple control files for different distros.

Build-deps cannot be dynamically replaced per distro.
Thus, we need to prepare multiple control files and
slap in appropriate control files with rules.

This allow to prepare Debian and Ubuntu simultaneously.

Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
3 years ago[Coverity/MQTT/Sink] Fix a critical Coverity defect (WGID 1238814)
Wook Song [Thu, 22 Jul 2021 04:29:11 +0000 (13:29 +0900)]
[Coverity/MQTT/Sink] Fix a critical Coverity defect (WGID 1238814)

This patch fixes a critical Coverity defect (WGID 1238814), which is
tagged as FORWARD_NULL, in the GstMQTTSink plugin.

Signed-off-by: Wook Song <wook16.song@samsung.com>
3 years ago[Coverity/Tests/MQTT] Fix critical defects in MQTT test cases
Wook Song [Thu, 22 Jul 2021 00:54:56 +0000 (09:54 +0900)]
[Coverity/Tests/MQTT] Fix critical defects in MQTT test cases

This patch fixes the critical defects, 1238819,1238820, 1238824,
1238830, and 1238821, which are related to resource leak, in the MQTT
test cases.

Signed-off-by: Wook Song <wook16.song@samsung.com>
3 years ago[Coverity/MQTT/Src] Fix major coverity issues 1238821, 1238825, 1238826
Wook Song [Wed, 21 Jul 2021 08:13:29 +0000 (17:13 +0900)]
[Coverity/MQTT/Src] Fix major coverity issues 1238821, 1238825, 1238826

This patch fixes the major coverity issues related to missing locks in
the MQTT source element.

Signed-off-by: Wook Song <wook16.song@samsung.com>
3 years ago[Coverity/Tests/MQTT] Fix a critical coverity issue 1238828
Wook Song [Wed, 21 Jul 2021 07:35:00 +0000 (16:35 +0900)]
[Coverity/Tests/MQTT] Fix a critical coverity issue 1238828

This patch fixes a critical coverity issue (WGID: 1238828), which is
about uninitialized non-static variables in the GstMqttTestHelper class.

Signed-off-by: Wook Song <wook16.song@samsung.com>
3 years ago[Build] framework priority option
Jaeyun [Mon, 19 Jul 2021 06:57:24 +0000 (15:57 +0900)]
[Build] framework priority option

Add meson-option to set fw priority for file extension (.nb, .bin)

Signed-off-by: Jaeyun <jy1210.jung@samsung.com>
3 years agoDecoder: Bounding boxes: option3 comments update
MyungJoo Ham [Fri, 16 Jul 2021 00:33:38 +0000 (09:33 +0900)]
Decoder: Bounding boxes: option3 comments update

Mobilenet-ssd-postprocess has its own syntax for option3.
Describe it for users.

This should be merged AFTER #3408

Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
3 years ago[Filter] init properites
Jaeyun [Tue, 20 Jul 2021 08:25:28 +0000 (17:25 +0900)]
[Filter] init properites

Add init code - newly updated properties in filter.

Signed-off-by: Jaeyun <jy1210.jung@samsung.com>
3 years ago[Coverity] Fix coverity issues (689481, 689480)
Junhwan Kim [Tue, 20 Jul 2021 01:29:10 +0000 (10:29 +0900)]
[Coverity] Fix coverity issues (689481, 689480)

Uninitialized read on `PackedFunc` assignment
Fix dynamic overflow

Signed-off-by: Junhwan Kim <jejudo.kim@samsung.com>
3 years ago[armnn] Fix coverity issue
Gichan Jang [Wed, 21 Jul 2021 02:51:06 +0000 (11:51 +0900)]
[armnn] Fix coverity issue

Fix converity issue
 - Fix resource leak (delete core when init failed)
 - Initialize networkid.
 - Fix use after free (stop test when there isn't test model)

Signed-off-by: Gichan Jang <gichan2.jang@samsung.com>
3 years ago[Common] util function to copy tensor config
Jaeyun [Mon, 19 Jul 2021 11:08:24 +0000 (20:08 +0900)]
[Common] util function to copy tensor config

Add util function to copy tensor config struct.

Signed-off-by: Jaeyun <jy1210.jung@samsung.com>
3 years ago[Decoder/BoundingBox]: SSD: Estimate valid detection against sigmoid value
Xavier Roumegue [Tue, 13 Jul 2021 16:04:19 +0000 (16:04 +0000)]
[Decoder/BoundingBox]: SSD: Estimate valid detection against sigmoid value

The sigmoid/logistic function is mathematically monotonic by definition.
Hence, computing the bijective threshold value thanks to its inverse
function (logit) once and compare it directly against logistic activation
values while sorting out the valid detected objects, helps to significantly
improve pipeline latency, and reduce power consumption/cpu load.

Signed-off-by: Xavier Roumegue <xavier.roumegue@nxp.com>
3 years ago[Decoder/BoundingBox]: SSD: PP parameters can be set through option3
Xavier Roumegue [Tue, 13 Jul 2021 14:37:40 +0000 (14:37 +0000)]
[Decoder/BoundingBox]: SSD: PP parameters can be set through option3

The post processing parameters used to decode a mobilenet SSD neural
network can be optionally set through option3, using ':' as parameter
delimiter.

The option3 definition scheme is, in order, the following:
- box priors location file (mandatory)
- Detection threshold (optional, default set to 0.5)
- Y box scale (optional, default set to 10.0)
- X box scale (optional, default set to 10.0)
- h box scale (optional, default set to 5.0)
- w box scale (optional, default set to 5.0)
- IOU box valid threshold (optional, default set to 0.5)

The default parameters value could be set through the following option3
example:

... option3=box-priors.txt:0.5:10.0:10.0:5.0:5.0:0.5 ...
or
... option3=box-priors.txt ...
or
... option3=box-priors.txt:::::: ...

It's possible to set only few values, using the default values for
those not specified through the command line.
You could specify respectively the detection and IOU thresholds to 0.65
and 0.6 with the option3 parameter as follow:

... option3=box-priors.txt:0.65:::::0.6 ...

Signed-off-by: Xavier Roumegue <xavier.roumegue@nxp.com>
3 years ago[Tests/GRPC] Skip GRPC tests on the qemu/arm environment either
Wook Song [Wed, 14 Jul 2021 08:35:02 +0000 (17:35 +0900)]
[Tests/GRPC] Skip GRPC tests on the qemu/arm environment either

Since some system calls required by GRPC are not supported on qemu/arm
as well, this patch blocks SSAT-based GRPC test cases' running on such
environment.

See also: 8a3eedc95a814a27949de4850f4ed6b670ac3616

Signed-off-by: Wook Song <wook16.song@samsung.com>
3 years agoFilter/Vivante: apply gst-indent
MyungJoo Ham [Tue, 13 Jul 2021 09:33:53 +0000 (18:33 +0900)]
Filter/Vivante: apply gst-indent

Vivante filter codes incur gst-indent complaints.

Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
3 years agoFilters: add custom property descriptions
MyungJoo Ham [Tue, 13 Jul 2021 09:32:59 +0000 (18:32 +0900)]
Filters: add custom property descriptions

This adds custom property descriptions for
- edge-tpu
- python3
- snap
- snpe
- tf-lite
- vivante

Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
3 years ago[Filter/NNFW] add custom description accepted/tizen/unified/20210714.014142 submit/tizen/20210713.072613
Jaeyun [Mon, 12 Jul 2021 08:22:45 +0000 (17:22 +0900)]
[Filter/NNFW] add custom description

add custom option description in nnfw sub-plugin.

Signed-off-by: Jaeyun <jy1210.jung@samsung.com>
3 years ago[Query] add tensor query boilerplate
Junhwan Kim [Fri, 9 Jul 2021 04:18:17 +0000 (13:18 +0900)]
[Query] add tensor query boilerplate

- draft for tensor-query

Signed-off-by: Junhwan Kim <jejudo.kim@samsung.com>
3 years ago[Common/Util] function to get possible caps
Jaeyun [Mon, 5 Jul 2021 09:11:37 +0000 (18:11 +0900)]
[Common/Util] function to get possible caps

Fix nego error case, add new function to get possible caps from config.
When receives caps event, element should return all possible caps.

Signed-off-by: Jaeyun <jy1210.jung@samsung.com>
3 years ago[Doc] Fix android documentation
Junhwan Kim [Mon, 12 Jul 2021 09:20:18 +0000 (18:20 +0900)]
[Doc] Fix android documentation

- fix docs more likely to work for beginners

Signed-off-by: Junhwan Kim <jejudo.kim@samsung.com>
3 years ago[Common] util function to handle tensor format
Jaeyun [Mon, 5 Jul 2021 10:38:39 +0000 (19:38 +0900)]
[Common] util function to handle tensor format

Add util function to handle tensor format.

Signed-off-by: Jaeyun <jy1210.jung@samsung.com>
3 years ago[Caps/Tensor] caps string with format
Jaeyun [Thu, 24 Jun 2021 09:49:29 +0000 (18:49 +0900)]
[Caps/Tensor] caps string with format

Define caps template with tensor format.
After this PR, old caps (tensors/tensors-flexible) will be removed, and nnstreamer elements/testcases will be updated with new caps string.

Signed-off-by: Jaeyun <jy1210.jung@samsung.com>
3 years ago[Spec] Remove flatbuffers-python recommends section
Sangjung Woo [Mon, 12 Jul 2021 02:18:04 +0000 (11:18 +0900)]
[Spec] Remove flatbuffers-python recommends section

Because of the security issue, VD does not use the script language.
Moreover, VD officially uses Python 3.5 for debugging purposes but the
latest Tizen 6.5 uses Python 3.9. Because of this reason, 'Recommends:
flatbuffers-python' section should be removed for VD build infra.

Signed-off-by: Sangjung Woo <sangjung.woo@samsung.com>
3 years ago[Query] Add common socket functions
Gichan Jang [Fri, 9 Jul 2021 03:20:14 +0000 (12:20 +0900)]
[Query] Add common socket functions

Add common sokcet functions for tensor-query.
Other common functions are added later.
tensor_query_src, tensor_query_sink and tensor_query_filter will use
these functions.

Signed-off-by: Gichan Jang <gichan2.jang@samsung.com>
3 years ago[Split/Merge/Aggregator] caps template for single tensor
Jaeyun [Wed, 7 Jul 2021 06:36:11 +0000 (15:36 +0900)]
[Split/Merge/Aggregator] caps template for single tensor

Modify pad caps template - other/tensors with num 1.
Set src-pad caps using peer caps.

Signed-off-by: Jaeyun <jy1210.jung@samsung.com>
3 years agoARMNN: fix unittest fail
MyungJoo Ham [Tue, 6 Jul 2021 09:55:37 +0000 (18:55 +0900)]
ARMNN: fix unittest fail

1. Fix segmentation fault.

nnstreamerFilterArmnn.invoke02_n tests armnn_invoke() where
private_data == NULL, which incurs segmentation fault
of armnn subplugin.

2. Fix -EPERM of open()

If a Caffe/TFLite parser was not available at build time,
opening Caffe/TFLite file results in -EPERM.
Such cases should not be regarded as test-fail.

3. Fix error handling of armnn subplugin

Use the proper error codes!

Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
3 years agoTizen: re-enable armnn build.
MyungJoo Ham [Tue, 6 Jul 2021 02:46:49 +0000 (11:46 +0900)]
Tizen: re-enable armnn build.

Provide as many tensor-filter subplugins as possible!

Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
3 years agoARMNN: update deprecated type enum.
MyungJoo Ham [Tue, 6 Jul 2021 02:45:14 +0000 (11:45 +0900)]
ARMNN: update deprecated type enum.

QuantisedAsymm8 and QuantisedSymm16 are deprecated by both
Tizen and Debian's ARMNN versions.
Use new enum declarations.

Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
3 years agoARMNN: enable Caffe/TFLite parses only when available
MyungJoo Ham [Mon, 5 Jul 2021 10:43:35 +0000 (19:43 +0900)]
ARMNN: enable Caffe/TFLite parses only when available

Include Caffe-parser or TFLite-parser only if they are
available at build-time.

Note that Debian-Sid does not have Caffe-parser ready with
its ARMNN-devel packages.

Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
3 years agoARMNN: Fix comments
MyungJoo Ham [Tue, 6 Jul 2021 03:22:09 +0000 (12:22 +0900)]
ARMNN: Fix comments

Fix ArmNNCore::makeTfLiteNetwork's Doxygen description.

Reported-by: Dongju Chae <dongju.chae@samsung.com>
Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
3 years ago[TEST] Fix streambuffers test
Gichan Jang [Fri, 25 Jun 2021 05:48:34 +0000 (14:48 +0900)]
[TEST] Fix streambuffers test

Test fails on arm arch(gbs build) because buffer conversion takes long time.
The purpose of the test is converting other/tensors to streambuffers, so modifies the test.

Signed-off-by: Gichan Jang <gichan2.jang@samsung.com>
3 years ago[Tests/GstMQTT] Initialize PTS and DTS in the dummy header
Wook Song [Wed, 7 Jul 2021 06:35:24 +0000 (15:35 +0900)]
[Tests/GstMQTT] Initialize PTS and DTS in the dummy header

This patch adds the initialization code of PTS and DTS in the dummy
header to the helper function that fills the timestamp information.

Signed-off-by: Wook Song <wook16.song@samsung.com>
3 years ago[Tests/GstMQTT] Increase the timeout for receiving a message
Wook Song [Tue, 6 Jul 2021 06:50:27 +0000 (15:50 +0900)]
[Tests/GstMQTT] Increase the timeout for receiving a message

The default timeout, 10 secs, for receiving a message from the
subscribed topic might be short for sandboxed-test environments such as
GBS and Pbuilder. To avoid failure of GstMQTT test cases due to the
timeout, this patch increases the timeout to 1 min instead of using the
defualt one, 10 secs.

Signed-off-by: Wook Song <wook16.song@samsung.com>
3 years ago[Tests/GstMQTT] Do not use 'fakevideosink' in test cases
Wook Song [Mon, 5 Jul 2021 12:21:14 +0000 (21:21 +0900)]
[Tests/GstMQTT] Do not use 'fakevideosink' in test cases

Since 'fakevideosink' is included in gst-plugins-bad, extra dependency
should be declared to use this element. To avoid it, this patch replaces
'fakevideosink' in the MQTT test cases with 'fakesink'.

Signed-off-by: Wook Song <wook16.song@samsung.com>
3 years ago[Tests/GstMQTT] Rename the test suite that uses the mocking library
Wook Song [Mon, 5 Jul 2021 11:23:41 +0000 (20:23 +0900)]
[Tests/GstMQTT] Rename the test suite that uses the mocking library

This patch changes the test suite name including the test cases based
on the mocking Paho-MQTT APIs.

Signed-off-by: Wook Song <wook16.song@samsung.com>