platform/upstream/nnstreamer.git
6 years ago[Tensors] Add tensor dimensions string for negotiation
jijoong.moon [Mon, 2 Jul 2018 01:59:56 +0000 (10:59 +0900)]
[Tensors] Add tensor dimensions string for negotiation

Add tensors dimensions string for negotiation.
The default cap form of "other/tenosrs" is

"other/tensors, " \
"rank = (int) [ 1, 4 ], " \
"num_tensors = (int) [1, 65535], "\
"type = (string) { float32, float64, int32, uint32,
int16, uint16, int8, uint8 }, " \
"framerate = (fraction) [ 0/1, 2147483647/1 ]" \
/* Dimensions of Tensors for negotiation */
/* "dimensions = (string)
    dim1:dim2:dim3:dim4, dim1:dim2:dim3:dim4" */

Signed-off-by: jijoong.moon <jijoong.moon@samsung.com>
6 years ago[DIST] RPM Build: Add python build dependency
MyungJoo Ham [Mon, 2 Jul 2018 11:57:54 +0000 (20:57 +0900)]
[DIST] RPM Build: Add python build dependency

Although python is implicitly added as build-dep by other packages,
we now uses python explicitly with a few test cases.

Thus, we'd better express it explicitly.

Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
6 years ago[Common/Unittest] move unittest to tests/
MyungJoo Ham [Mon, 2 Jul 2018 12:18:02 +0000 (21:18 +0900)]
[Common/Unittest] move unittest to tests/

TODO: add runTest.sh for tests/common and remove unittest_common from rpm spec.

Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
6 years ago[Filter/Test] Add regression test for issue #190
MyungJoo Ham [Mon, 2 Jul 2018 11:02:28 +0000 (20:02 +0900)]
[Filter/Test] Add regression test for issue #190

Test case with 640x480 --> 320x240 scaler.

Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
6 years ago[Filter] Fix pad-cap tranform bug
MyungJoo Ham [Mon, 2 Jul 2018 11:01:03 +0000 (20:01 +0900)]
[Filter] Fix pad-cap tranform bug

Fixes #190.

Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
6 years ago[Convert/Filter] Add transform size functions
MyungJoo Ham [Mon, 2 Jul 2018 04:18:48 +0000 (13:18 +0900)]
[Convert/Filter] Add transform size functions

This commit enables allocation-type vmethods, "transform_size" for filter
and updates corresponding comments for converter.

Note that allocation units is not requires as transform size is supplied.

Fixes #26

Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
6 years ago[Sink] update testcase
jy1210.jung [Mon, 2 Jul 2018 11:46:37 +0000 (20:46 +0900)]
[Sink] update testcase

1. add test for basesink properties
2. add test for unknown property and signal
3. add signal handle (greater than 0 when successfully connected)
4. add example to get negotiated caps

**Self evaluation:**
1. Build test: [*]Passed [ ]Failed [ ]Skipped
2. Run test: [*]Passed [ ]Failed [ ]Skipped

Signed-off-by: Jaeyun Jung <jy1210.jung@samsung.com>
6 years ago[Tensors] Fix gst buffer error
jijoong.moon [Mon, 2 Jul 2018 02:27:09 +0000 (11:27 +0900)]
[Tensors] Fix gst buffer error

In order to keep buffer data to next element after create new buffer,
we have to increse reference count before push the buffer.

Signed-off-by: jijoong.moon <jijoong.moon@samsung.com>
6 years ago[Example Custom Filter] Scaler Example Custom Filter
MyungJoo Ham [Wed, 27 Jun 2018 08:33:17 +0000 (17:33 +0900)]
[Example Custom Filter] Scaler Example Custom Filter

Added scaler that changes dimension and to meaningful memcpy

Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
6 years ago[Sink] testcases with base pipeline
jy1210.jung [Fri, 29 Jun 2018 11:30:14 +0000 (20:30 +0900)]
[Sink] testcases with base pipeline

1. test code for tensor sink
 - testcases for get/set properties, buffer, render-rate
 - uses simple pipeline
 - can receive buffer after signal connect
2. update cmake for unittest.

**Self evaluation:**
1. Build test: [*]Passed [ ]Failed [ ]Skipped
2. Run test: [ ]Passed [ ]Failed [* ]Skipped

Signed-off-by: Jaeyun Jung <jy1210.jung@samsung.com>
6 years ago[Test] Add plugin dependency and cmake build check.
sewon.oh [Thu, 28 Jun 2018 09:22:16 +0000 (18:22 +0900)]
[Test] Add plugin dependency and cmake build check.

- testAPI.sh: using find and gst-inspect-1.0 to check dependency

Signed-off-by: Sewon Oh <sewon.oh@samsung.com>
6 years ago[CI] Add TAOS-CI config files for nnstreamer
sewon.oh [Thu, 28 Jun 2018 05:31:24 +0000 (14:31 +0900)]
[CI] Add TAOS-CI config files for nnstreamer

1st
- config files: copy files
- Documentation/ci-config/README.md: describe how to use these files.
- ./README.md: add link ci-config readme file.

2nd
- ./README.md: modify to change line

3rd
- merge: some files are added.
- Documentation/ci-config/README.md: command change to link ci-config folder

Signed-off-by: Sewon Oh <sewon.oh@samsung.com>
6 years ago[Code Clean] tensor_fitler clean up
MyungJoo Ham [Tue, 26 Jun 2018 06:39:22 +0000 (15:39 +0900)]
[Code Clean] tensor_fitler clean up

- Remove debugging-only code
- Code clean for repeated expressions & debug prints
- Remove unnecessary code blocks

Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
6 years agoAdded how to use test cases in Documentation folder
Geunsik Lim [Thu, 28 Jun 2018 07:19:34 +0000 (16:19 +0900)]
Added how to use test cases in Documentation folder

This PR is to append how to use test cases in Documentation folder
because the instruction contents of test cases has been increased gradually.

**Changes proposed in this PR:**
1. Added test case document in Documentation directory

**Self assessment:**
1. mark-down test: okay

Signed-off-by: Geunsik Lim <geunsik.lim@samsung.com>
6 years agoAdded getting-started document in Documentation folder
Geunsik Lim [Thu, 28 Jun 2018 04:59:58 +0000 (13:59 +0900)]
Added getting-started document in Documentation folder

The content of `Getting Started` section is too big in README.md file.
This PR is to create getting-started mark-down document in Documentation folder.

**Changes proposed in this PR:**
1. Added getting-started.md file
2. Updated README.md

**Self assessment:**
1. mark-down test: okay
2. gbs build: okay

Signed-off-by: Geunsik Lim <geunsik.lim@samsung.com>
6 years ago[Tests] Added check function to inspect dependent commands
Geunsik Lim [Thu, 28 Jun 2018 01:44:28 +0000 (10:44 +0900)]
[Tests] Added check function to inspect dependent commands

This PR is to append a dependency check routine to inspect the required
packages are install before starting tests/testAPI.sh

**Changes proposed in this PR:**
1. Added dependency check function
2. Applied shell commands with checkDependency()
   - gst-launch-1.0, cmp, dirname, basename, sed, and find

**Self assessment:**
1. gbs build: okay
2. local test: okay

Signed-off-by: Geunsik Lim <geunsik.lim@samsung.com>
6 years ago[Tensors] Complete Set of Test Case for Tensors
jijoong.moon [Wed, 27 Jun 2018 08:09:37 +0000 (17:09 +0900)]
[Tensors] Complete Set of Test Case for Tensors

Test Case is:
  1. generate random png (RGB, 640x480)
  2. read x-raw from png
  3. Make Three Tensors (gsttesttensors)
     . R Tensor [1][640][480][1] : Size 307200
     . G Tensor [1][640][480][1] : Size 307200
     . B Tensor [1][640][480][1] : Size 307200
     . num_tensors : 3
     . glist dimensions : tensor_dim type([1][640][480][1]) x 3

- Add generate golden data from python code
- Add tar for the tizen rpm pacakging
- Add binary difference check
- Modify tensor_meta to work right

Signed-off-by: jijoong.moon <jijoong.moon@samsung.com>
6 years ago[Filter/Main] Fully support flexible (sink->src) dimension
MyungJoo Ham [Mon, 25 Jun 2018 07:42:52 +0000 (16:42 +0900)]
[Filter/Main] Fully support flexible (sink->src) dimension

Fixes #153, thus fixing #71 as well.

Added a test case to prevent regression

Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
6 years ago[Filter/Custom] Support flexible dimension
MyungJoo Ham [Fri, 22 Jun 2018 06:26:44 +0000 (15:26 +0900)]
[Filter/Custom] Support flexible dimension

- Allow to configure input/output dimension in run-time.
- After pad-cap negotiation, if gstremaer somehow fixes input-dimenson,
 a filter subplugin can configure output-dimension accordingly.
- An example custom filter, "passthrough_variable", supports any
 arbitrary tensor for passthrough operations.
- Filter/Main and Filter/Custom has been amended during the development
 of the example custom plugin.

FOUND BUG (mentioned as "known bug" in the code):
- If GST-BaseTransform tries to fixate pad-caps without getting
 any hints on the input dimension, fixate vmethod fixes the input
 dimension to 1:1:1:1. We need to implement non-fixed pad-cap
 declarations in fixated vmethod.
- The disabled test case #4 in tests/nnstreamer_filter_custom
 is the corresponding regression detector.
- However, this bug is to be fixed with another commit.

Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
6 years ago[Git Infra] pre-commit to filter styles
MyungJoo Ham [Wed, 27 Jun 2018 07:05:39 +0000 (16:05 +0900)]
[Git Infra] pre-commit to filter styles

If you want to know if there is coding style errors
before actually creating a commit, use this pre-commit by
copying common/pre-commit to .git/hooks/

Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
6 years ago[Sink] add properties and signals
jy1210.jung [Wed, 27 Jun 2018 10:27:52 +0000 (19:27 +0900)]
[Sink] add properties and signals

1. emit signals when new buffer received, start/end stream event.
2. add properties for signals and render rate.
3. add caps callback from basesink.

**Self evaluation:**
1. Build test: [*]Passed [ ]Failed [ ]Skipped
2. Run test: [ ]Passed [ ]Failed [* ]Skipped

Signed-off-by: Jaeyun Jung <jy1210.jung@samsung.com>
6 years ago[CI/Unit test] Integrate unit test with cmake.
sewon.oh [Wed, 27 Jun 2018 06:48:19 +0000 (15:48 +0900)]
[CI/Unit test] Integrate unit test with cmake.

Test command: ctest -V (you can do after 'make', -V means log output)
- ./CMakeLists.txt: add subdirectory and enable test
- test/CMakeLists.txt: add unit test
- testAll.sh: using `dirname $0` to solve path problem
- testAPI.sh: same as testAll.sh
- debian/control: add dependency for unit testing

Signed-off-by: Sewon Oh <sewon.oh@samsung.com>
6 years ago[Convert] Memory Handling Fixed
MyungJoo Ham [Wed, 27 Jun 2018 06:30:56 +0000 (15:30 +0900)]
[Convert] Memory Handling Fixed

1. Added g_free() to an allocated pointer.
2. Added transform_size() to allow gst framework to allocate
the exact amount needed for output buffer in non-in-place mode.

Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
6 years ago[Filter/Main] Guarantee calling "open" before all other callbacks.
MyungJoo Ham [Fri, 22 Jun 2018 07:23:49 +0000 (16:23 +0900)]
[Filter/Main] Guarantee calling "open" before all other callbacks.

Added "open" virtual methods for tensor_filer subplugins.

TODO: guarantee calling "close" at the end.

Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
6 years ago[Common] Code Clean for common libraries
MyungJoo Ham [Wed, 27 Jun 2018 05:33:45 +0000 (14:33 +0900)]
[Common] Code Clean for common libraries

1. Install tensor_common.a to devel packaging so that external custom plugins may use tensor-common libraries
2. Rearrange headers, straighten up the dependencies
3. Add cap-to-dim API.

Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
6 years ago[Filter/tflite]Add skeleton code for load model file
jinhyuck [Mon, 25 Jun 2018 10:46:26 +0000 (19:46 +0900)]
[Filter/tflite]Add skeleton code for load model file

add skeleton code for load model file of tensorflow lite subplugin
additional implement will be done after applying cpp api of tensorflow lite
could be used in tensorflow_lite_filter.c

Signed-off-by: jinhyuck <jinhyuck83.park@samsung.com>
6 years ago[CI/UnittestCoverage] Exclude tests
MyungJoo Ham [Tue, 26 Jun 2018 08:16:38 +0000 (17:16 +0900)]
[CI/UnittestCoverage] Exclude tests

Do not check unittest coverage of tests/*
Limit the coverage target to gst, nnstreamer_example, include, common.

Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
6 years ago[Documentation] update readme with the progress details
MyungJoo Ham [Tue, 26 Jun 2018 06:47:18 +0000 (15:47 +0900)]
[Documentation] update readme with the progress details

The "known bug" is already fixed.
Add progress updates.

Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
6 years ago[Filter/Main] Support implicit dimension declaration
MyungJoo Ham [Fri, 22 Jun 2018 06:04:28 +0000 (15:04 +0900)]
[Filter/Main] Support implicit dimension declaration

If a subplugin of tensor-filter has declared input/output dimension
with getInputDimenion/getOutputDimension, configure tensor-filter
with such values.

This prepares for configuring dimesions based on pad-cap negotiations as well.
(There are a few TODOs to fully support it)

This does about half of #144 .
Added a test case for implicit dimension declaration as well.

Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
6 years ago[Readme] Fix typo
MyungJoo Ham [Wed, 27 Jun 2018 01:05:46 +0000 (10:05 +0900)]
[Readme] Fix typo

Multi model --> Multi modal
(multiple heterogeneous input sources for NNs; e.g.. cameras and mics)

Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
6 years ago[TensorMeta] Add utility functions to manipilation of tensors (#158)
문지중/동작제어Lab(SR)/Principal Engineer/삼성전자 [Wed, 27 Jun 2018 00:51:19 +0000 (09:51 +0900)]
[TensorMeta] Add utility functions to manipilation of tensors (#158)

* [TensorMeta] Add utility functions to manipilation of tensors

Add Utility functions
- gst_make_tensors
- gst_get_tensor
- gst_get_tensordim
- gst_remove_tensor
- gst_get_num_tensors

Signed-off-by: jijoong.moon <jijoong.moon@samsung.com>
* [Tensors] Add Tensors Generation Testcase

Add Testcase to generate Tensors
 - gsttesttensor
    . take video/x-raw ( RGB type )
    . generate three [1][642][480][1] dimension tensor
    . generate tensors with GstTensorMeta

Signed-off-by: jijoong.moon <jijoong.moon@samsung.com>
* [Tensors] Add Tensors Check Element

In order to check tensors in downstream element, tensorscheck element
is added.
In this element, "other/tensor" type is in sink pad and check if it is
tensors and merge three tensor into one RGB original tensor.

Signed-off-by: jijoong.moon <jijoong.moon@samsung.com>
* [Tensors] Add test for the tensors in tests directory

In order to test tensors, gstreamer pipeline test is added as below.

filesrc location=testcase01_RGB_642x480.png ! pngdec ! videoscale !
imagefreeze ! videoconvert !
video/x-raw,format=RGB,width=642,height=480,framerate=0/1 !
testtensors silent=TRUE ! tensorscheck silent=TRUE ! filesink
location=\"testcase01_RGB_642x480.nonip.log\" sync=true

Signed-off-by: jijoong.moon <jijoong.moon@samsung.com>
6 years ago[Documentation] Added maintainer & committers
Geunsik Lim [Tue, 26 Jun 2018 06:32:26 +0000 (15:32 +0900)]
[Documentation] Added maintainer & committers

This PR is to append the maintainer(s) and committer(s) that were proposed
at `STAR-SteeringCommitte` as follows.

* [STAR On Device] nnstreamer Repo Creation Proposal
   * https://github.sec.samsung.net/STAR/STAR-SteeringCommittee/issues/17

**Changes proposed in this PR:**
1. Added maintainer & committers
2. Updated mark-down template
3. Updated some statements for readability

Signed-off-by: Geunsik Lim <geunsik.lim@samsung.com>
6 years agoRenamed file name to display license info at webpage
Geunsik Lim [Mon, 25 Jun 2018 07:20:48 +0000 (16:20 +0900)]
Renamed file name to display license info at webpage

This PR is to replace `LICENSE.LGPLv2.1` with `LICENSE` in order to
display official license of this repository automatically.

**Changes proposed in this PR:**
1. Replaced LICENSE.LGPLv2.1 with LICENSE
2. Updated nnstreamer.spec

Signed-off-by: Geunsik Lim <geunsik.lim@samsung.com>
6 years ago[Doxygen] Added how to write doxygen tags
Geunsik Lim [Tue, 19 Jun 2018 23:04:43 +0000 (08:04 +0900)]
[Doxygen] Added how to write doxygen tags

This PR is to add how to write doxygen documents in the source code.

**Changes proposed in this PR:**

Ver2:
2. Added addtional case studies for C/C++ code

Ver1:
1 Added how to write doxygen tags

**Self assessment:**
1. GBS build: okay
2. mark-down test: okay

Signed-off-by: Geunsik Lim <geunsik.lim@samsung.com>
6 years ago[Filter] Flexible input/output dimension, prep data structure
MyungJoo Ham [Wed, 20 Jun 2018 10:16:59 +0000 (19:16 +0900)]
[Filter] Flexible input/output dimension, prep data structure

In order to allow flexible input/output dimension for subplugins,
prepare proper data structure and virtual method, "setInputDimension

Additional mod: constify Gst_Tensor_Filter for subplugins

CC: @jinhyuck83-park @hello-ahn : I need your opinion on this vmethod update.
Preparing #71

Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
6 years ago[Sink] register sink plugin
jy1210.jung [Fri, 22 Jun 2018 07:46:18 +0000 (16:46 +0900)]
[Sink] register sink plugin

Update code to register tensor sink plugin.
1. added plugin registration
2. refactor code for interface (later work)

**Self evaluation:**
1. Build test: [*]Passed [ ]Failed [ ]Skipped
2. Run test: [ ]Passed [ ]Failed [* ]Skipped

Signed-off-by: Jaeyun Jung <jy1210.jung@samsung.com>
6 years ago[Merge Error Fix] Missing Merge Conflict Resolve.
MyungJoo Ham [Fri, 22 Jun 2018 06:32:24 +0000 (15:32 +0900)]
[Merge Error Fix] Missing Merge Conflict Resolve.

There were a few missing spots in the previous merge conflict resolve.

Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
6 years ago[TensorMeta] Change TensorMeta -> GstMetaTensor
jijoong.moon [Thu, 21 Jun 2018 07:37:47 +0000 (16:37 +0900)]
[TensorMeta] Change TensorMeta -> GstMetaTensor

- Change Tensor Meta from TensorMeta to GstMetaTensor for more general.
- Add GstMetaTensor in tensor_converter and tensor_decoder and tested.
  . For now, GstMetaTensor->num_tensors is set as 1 in
    tensor_converter and included in GstBuffer.
  . GstBuffer is sent through pipeline and this meta data can get in
    tensordec.

Signed-off-by: jijoong.moon <jijoong.moon@samsung.com>
6 years ago[Sink] update doxygen
jy1210.jung [Thu, 21 Jun 2018 07:07:48 +0000 (16:07 +0900)]
[Sink] update doxygen

Add doxygen eitries and fix doxygen issue.

**Self evaluation:**
1. Build test: [*]Passed [ ]Failed [ ]Skipped
2. Run test: [ ]Passed [ ]Failed [* ]Skipped

Signed-off-by: Jaeyun Jung <jy1210.jung@samsung.com>
6 years ago[Sink] Add template for buffer and QoS event
jy1210.jung [Tue, 19 Jun 2018 11:47:47 +0000 (20:47 +0900)]
[Sink] Add template for buffer and QoS event

1. add function to handle buffer
(render and render_list in BaseSinkClass)
2. add template to set QoS event

Signed-off-by: Jaeyun Jung <jy1210.jung@samsung.com>
6 years ago[Documentation] Added development guide of nnstreamer
Geunsik Lim [Tue, 19 Jun 2018 22:54:58 +0000 (07:54 +0900)]
[Documentation] Added development guide of nnstreamer

This PR is to append some mark-down documents to develop
nnstreamer source code consistently.

Original documents is mirrored from TAOS-CI repository.
Thane, modified the document for nnstreamer project.

**Changes proposed in this PR:**

* Version 3:
1. Removed Python rule
2. Updated how to run gst-indent before submitting PR

* Version 2:
1. Replaced a manual indent command with ./common/gst-indent script

* Version 1:
1. Added coding convention document
2. Added how to contribute code
3. Added generation script to create TOC automatically
4. Added how to archive large data for evaluation
   (In this case, another repository has to be created for only large data.)

**Self assessment:**
1. gbs build: okay
2. markd-down generation: okay

Signed-off-by: Geunsik Lim <geunsik.lim@samsung.com>
6 years ago[Doxygen] Add doxygen entries for common headers and conveter
MyungJoo Ham [Thu, 21 Jun 2018 02:18:06 +0000 (11:18 +0900)]
[Doxygen] Add doxygen entries for common headers and conveter

To comply with doxygen, a few more entires are added.
Hope this will help developers using common headers.

Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
6 years ago[TensorMeta] Add Tensor Meta Data for GstBuffer
jijoong.moon [Wed, 20 Jun 2018 09:27:29 +0000 (18:27 +0900)]
[TensorMeta] Add Tensor Meta Data for GstBuffer

In order to deal with other/tensors, we need GstBuffer which includes
multiple GstMemory for Tensors and GstMeta to describe offset and etc.

This is the first draft commit for the GstMeta for Tensor, say
TensorMeta.

Signed-off-by: jijoong.moon <jijoong.moon@samsung.com>
6 years ago[Code Clean] Type naming & constify
MyungJoo Ham [Wed, 20 Jun 2018 10:26:03 +0000 (19:26 +0900)]
[Code Clean] Type naming & constify

1. We still had "uint32_t *", which should've been replaced by "tensor_dim"
2. Constify input tensor. Incorrect usage will generate compiler errors later :)

Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
6 years agoAdded legacy issue template
Geunsik Lim [Tue, 19 Jun 2018 22:16:21 +0000 (07:16 +0900)]
Added legacy issue template

This PR is to support compatibility of issue template between different github versions.

**Changes proposed in this PR:**
1. Added legacy issue template

**Reference:**
* Legacy issue template: ./.github/ISSUE_TEMPLATE.md
* Up-to-date issue template: ./.github/ISSUE_TEMPLATE/{Bug_report.md|Feature_request.md|Support_request.md}

* Our request for github.sec.samsung.neet:
   * https://github.sec.samsung.net/SERVICE/GitHub/issues/124

**Self assessment:**
1. GBS build: okay
2. Local test: okay

Signed-off-by: Geunsik Lim <geunsik.lim@samsung.com>
6 years ago[License] Remove apache-2.0. Unify to LGPL-2.1
MyungJoo Ham [Tue, 19 Jun 2018 11:00:24 +0000 (20:00 +0900)]
[License] Remove apache-2.0. Unify to LGPL-2.1

Please use LGPL 2.1 for all files

Fixes #130
Fixes PROTEX mismatches

Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
6 years agoUpdated README.md to fix pdebuild issue
Geunsik Lim [Tue, 19 Jun 2018 06:20:09 +0000 (15:20 +0900)]
Updated README.md to fix pdebuild issue

Fix issue #127.
This PR is to solve unexpected build issues when users try to run
`pdebuild` command to do Debian packaging of nnstreamer source.

**Changes proposed in this PR:**
1. Replaced **```** with **```bash**
2. Added how to create a base tarball with correct apt repository
3. Updated how to use pdebuild to avoid build errors
4. Used OTHERMIRROR instead of MIRRORSITE to handle lots of cases

**Self assessment:**
1. Local test with Ubuntu 16.04 (Xenial): Okay
2. GBS Build: Okay

Signed-off-by: Geunsik Lim <geunsik.lim@samsung.com>
6 years ago[Code Clean] Use common functions / typedef.
MyungJoo Ham [Mon, 18 Jun 2018 08:52:39 +0000 (17:52 +0900)]
[Code Clean] Use common functions / typedef.

There had been a few new common functions/typedef introduced.
Use them!

Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
6 years ago[Decode] Minor code refactoring to save mem and cpu
MyungJoo Ham [Mon, 18 Jun 2018 08:02:35 +0000 (17:02 +0900)]
[Decode] Minor code refactoring to save mem and cpu

We do not need to allocate 1024 bytes for RGB/BGRx/Progressive keywords
We do not need to do strcpy for setting such values, either.

Later, we may commonize such keywords into include/*.h

Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
6 years ago[Documentation] Updated how to build nnstreamer
Geunsik Lim [Mon, 18 Jun 2018 06:23:45 +0000 (15:23 +0900)]
[Documentation] Updated how to build nnstreamer

This PR is to update the existing build manual in order to help nnstreamr users.

**Changes proposed in this PR:**

* Version 2:
1. Applied the comments of @myungjoo-ham

* Version 1:
1. Removed Unnecessary statements to avoid complicated explanation
2. Added links for `gbs` and `pdebuild` command
3. Updated the expressions.

Signed-off-by: Geunsik Lim <geunsik.lim@samsung.com>
6 years ago[CI/indent] Fix indent bug
sewon.oh [Mon, 18 Jun 2018 08:05:45 +0000 (17:05 +0900)]
[CI/indent] Fix indent bug

- *.c: add semi-colon to end of function GST_PLUGIN_DEFINE

6 years ago[Decoder] Support the case which is not divided by 4.
jijoong.moon [Mon, 18 Jun 2018 07:45:41 +0000 (16:45 +0900)]
[Decoder] Support the case which is not divided by 4.

If the width of tensor is not divided by 4, it should be padded
with (width % 4). In that case, we should use not use in-place
calculation.

- Add gst_t2c_transform() to add padding
- Add more test cases. (RGBx_642x480, RGBx_640x480, RGB_640x480)

Signed-off-by: jijoong.moon <jijoong.moon@samsung.com>
6 years ago[Sink] initial commit for basesink template (#117)
정재윤/언어이해Lab(SR)/Staff Engineer/삼성전자 [Mon, 18 Jun 2018 07:13:41 +0000 (16:13 +0900)]
[Sink] initial commit for basesink template (#117)

* [Sink] initial commit for basesink template

Add base template for tensor_sink.
This PR does not include cmake changes, also does not include testcase.

Signed-off-by: Jaeyun Jung <jy1210.jung@samsung.com>
[Squahed by: MyungJoo Ham <myungjoo.ham@samsung.com>

6 years agoRemove unnecessary build dependent package
Geunsik Lim [Mon, 18 Jun 2018 04:46:12 +0000 (13:46 +0900)]
Remove unnecessary build dependent package

Fixes issue #118.
This PR is to remove unnecessary a build dependent package such as plugins-good-dev.

**Changes proposed in this PR:**
1. Removed libgstreamer-plugins-good1.0-dev package from Build-Depends statement

**Self assessment:**
1. GBS build: okay

Signed-off-by: Geunsik Lim <geunsik.lim@samsung.com>
6 years agoCreated gst folder that maintains all modules for consistency and efficiency
Geunsik Lim [Fri, 15 Jun 2018 05:28:25 +0000 (14:28 +0900)]
Created gst folder that maintains all modules for consistency and efficiency

This PR is to crate `gst`folder to maintain all modules in same folder.
* Reference: https://github.com/GStreamer/gst-plugins-good/tree/master/gst

**Changes proposed in this PR:**
* Version2:
1. Fxied tests folder

* Version1:
1. Created 'gst' folder
2. Moved all modules (e.g., tensor_***) to 'gst' folder
3. Modified CMakeLists.txt

**Self assessment:**
1. GBS build: okay
2. Debian build:
   - Cmake test: okay
   - mk-build-deps test: okay

Signed-off-by: Geunsik Lim <geunsik.lim@samsung.com>
6 years agoReplaced project name from audri to nnstreamer
Geunsik Lim [Fri, 15 Jun 2018 05:45:38 +0000 (14:45 +0900)]
Replaced project name from audri to nnstreamer

This commit is trivial.
This PR is to replace project name from `audri` to `nnstreamer` in nnstreamer.spec.

Signed-off-by: Geunsik Lim <geunsik.lim@samsung.com>
6 years ago[Filter/Custom] Expose filter properties to custom filters
MyungJoo Ham [Thu, 14 Jun 2018 10:02:42 +0000 (19:02 +0900)]
[Filter/Custom] Expose filter properties to custom filters

In order to let custom filters to be flexible,
they need to be aware of filter/main's properties (e.g., pad caps).

Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
6 years agoFix typo in nnstreamer.spec for gcov report
Geunsik Lim [Fri, 15 Jun 2018 03:41:25 +0000 (12:41 +0900)]
Fix typo in nnstreamer.spec for gcov report

This commit is trivial.

**Changes proposed in this PR:**
1. Fixed incorrect project name in nnstreamer.spec file
* before: AuDri
* After: nnstreamer

Signed-off-by: Geunsik Lim <geunsik.lim@samsung.com>
6 years ago[Common] Provide err_print() and debug_print()
MyungJoo Ham [Thu, 14 Jun 2018 11:16:51 +0000 (20:16 +0900)]
[Common] Provide err_print() and debug_print()

1. Add err_print() and debug_print() for all elements in nnstreamer.
2. Replace dirty logging usages in all current elements.

For later commits in nnstreamer, I'll reject the direct usage of log/print.

Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
6 years ago[Readme] update how-to-build guide for self-hosting
MyungJoo Ham [Fri, 15 Jun 2018 01:50:32 +0000 (10:50 +0900)]
[Readme] update how-to-build guide for self-hosting

Added more information on how to prepare to build nnstreamer in your local pc environment.

Fixes #103

Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
6 years ago[Filter] Refactor properties: remove "debug".
MyungJoo Ham [Thu, 14 Jun 2018 10:21:56 +0000 (19:21 +0900)]
[Filter] Refactor properties: remove "debug".

Silent = !Debug. We do not need to have the two properties.

Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
6 years ago[All Filter] "silent" is TRUE by default.
MyungJoo Ham [Thu, 14 Jun 2018 10:21:19 +0000 (19:21 +0900)]
[All Filter] "silent" is TRUE by default.

We are going to turn it off only when we are doing debugging.

Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
6 years ago[DIST] Debian packaging
MyungJoo Ham [Fri, 15 Jun 2018 00:59:01 +0000 (09:59 +0900)]
[DIST] Debian packaging

Support debian packaging. Use debuild or pdebuild to generate deb packaging

Note that debian packaging does not include unit-test / golden-test and
it does not execute them in the build process either.

Please include it later.

Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
6 years ago[Filter/Main] Add "Custom" Property
MyungJoo Ham [Thu, 14 Jun 2018 09:21:13 +0000 (18:21 +0900)]
[Filter/Main] Add "Custom" Property

Added "Custom" property so that each sub-plugins may get properties
from users (gst apps) directly.

Partially addresses #71

Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
6 years ago[Test] Add GstFailTest API
MyungJoo Ham [Thu, 14 Jun 2018 11:54:30 +0000 (20:54 +0900)]
[Test] Add GstFailTest API

For unit-testing, we need to execute failing cases, where graceful exit is required.

Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
6 years ago[Readme] update how-to-test guide
MyungJoo Ham [Fri, 15 Jun 2018 01:36:45 +0000 (10:36 +0900)]
[Readme] update how-to-test guide

We not have a central testing service at /tests/. Update README accordingly.

Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
6 years ago[CI] Add template for Issue & PR
Geunsik Lim [Fri, 15 Jun 2018 01:22:08 +0000 (10:22 +0900)]
[CI] Add template for Issue & PR

This PR is to create a template to automate issue and PR process.
It is cloned from https://github.sec.samsung.net/STAR/TAOS-CI/tree/tizen/.github

**Changes proposed in this PR:**
1. Added issue template
2. Added PR template

Signed-off-by: Geunsik Lim <geunsik.lim@samsung.com>
6 years ago[SINK]Update README file of tensor_sink
jinhyuck [Thu, 14 Jun 2018 12:09:48 +0000 (21:09 +0900)]
[SINK]Update README file of tensor_sink

Update README file if tensor_sink for first commit to nnstreamer

Signed-off-by: jinhyuck <jinhyuck83.park@samsung.com>
6 years ago[CI] Add CI server web-address for nnstreamer
Geunsik Lim [Fri, 15 Jun 2018 01:16:22 +0000 (10:16 +0900)]
[CI] Add CI server web-address for nnstreamer

This PR is to append web-address of nnstreamer CI service and enable
the nnstreamer CI server.

**Changes proposed in this PR:**
1. Added webpage link for nnstreamer

Signed-off-by: Geunsik Lim <geunsik.lim@samsung.com>
6 years ago[Codeowners] Update. Add all members for reviewers
MyungJoo Ham [Thu, 14 Jun 2018 23:54:44 +0000 (08:54 +0900)]
[Codeowners] Update. Add all members for reviewers

- Add all members to reviewer list
- Update the comments

Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
6 years ago[Common] Add .gitignore
MyungJoo Ham [Fri, 15 Jun 2018 00:00:46 +0000 (09:00 +0900)]
[Common] Add .gitignore

Ignore the following files in the git repo:
- cmake build
- golden test generated files
- vi files
- binary (object) files
- ctag

Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
6 years ago[Decoder] Fix the Bug (#94) and Delete check for SRC direction
jijoong.moon [Thu, 14 Jun 2018 23:45:08 +0000 (08:45 +0900)]
[Decoder] Fix the Bug (#94) and Delete check for SRC direction

- Fix the missing memeory free (#94).
- Delete Check for the GST_PAD_SRC direction. The SRC is ANY, it can
  be Any format and the Sink should be TENSOR Type. Therefore it just
  return GST_TENSOR_CAP_DEFAULT GstCaps.

Signed-off-by: jijoong.moon <jijoong.moon@samsung.com>
6 years agoDoxygen: Create the main page for doxygen generation
Geunsik Lim [Thu, 14 Jun 2018 08:20:01 +0000 (17:20 +0900)]
Doxygen: Create the main page for doxygen generation

This PR is to create the introduction of Main Page  at HTML-based doxygen document.
(e.g., http://aaci.mooo.com/nnstreamer/html/)

**Changes proposed in this PR:**
1. Added Main Page tag

**Self assessment:**
1. GBS build: Okay
2. Local test: Okay

Signed-off-by: Geunsik Lim <geunsik.lim@samsung.com>
6 years ago[Transform] Add tesnsor_transform makrdown title for commit testing
sewon.oh [Thu, 14 Jun 2018 07:38:21 +0000 (16:38 +0900)]
[Transform] Add tesnsor_transform makrdown title for commit testing

- README.md: add title line makrdown file in tensor_transform folder

6 years ago[Decoder] Remove unneeded blank line
Wook Song [Thu, 14 Jun 2018 08:07:01 +0000 (17:07 +0900)]
[Decoder] Remove unneeded blank line

This patch just removes a unneeded blank line.

Signed-off-by: Wook Song <wook16.song@samsung.com>
6 years ago[Tensor Decoder] Add test case
jijoong.moon [Tue, 12 Jun 2018 07:57:25 +0000 (16:57 +0900)]
[Tensor Decoder] Add test case

Add test case for Tensor Decoder. Currently test case which width is
not divided by 4 is not supported.

- Add RGB 640x480

Signed-off-by: jijoong.moon <jijoong.moon@samsung.com>
6 years ago[Converter/Filter] Migrate all testcases into the central test mechanism.
MyungJoo Ham [Thu, 14 Jun 2018 04:38:06 +0000 (13:38 +0900)]
[Converter/Filter] Migrate all testcases into the central test mechanism.

Move rest of tensor_converter/test/* to tests/nnstreamer_converter

Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
6 years ago[Style] ANSI-C89 Comment Style
MyungJoo Ham [Tue, 12 Jun 2018 06:36:39 +0000 (15:36 +0900)]
[Style] ANSI-C89 Comment Style

https://gstreamer.freedesktop.org/documentation/frequently-asked-questions/developing.html#what-is-the-coding-style-for-gstreamer-code
states:

  Comments should be in /* ANSI C comment style */ and code should generally be compatible with ANSI C89, so please declare all variables at the beginning of the block, etc.

Thus, we have updated commenting style.

Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
6 years ago[Style] Apply gst-indent results to all *.c files
MyungJoo Ham [Thu, 14 Jun 2018 04:27:41 +0000 (13:27 +0900)]
[Style] Apply gst-indent results to all *.c files

nnstreamer.git$ for x in `find -name *.c`; do common/gst-indent $x; done

Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
6 years ago[Example] Remove examples. They are useless.
MyungJoo Ham [Tue, 12 Jun 2018 06:31:23 +0000 (15:31 +0900)]
[Example] Remove examples. They are useless.

The files are already published in the tutorial web site.
We do not need gst examples in nnstreamer git.

Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
6 years ago[Common] Import gst-indent script from Gstreamer mainline.
MyungJoo Ham [Tue, 12 Jun 2018 06:29:27 +0000 (15:29 +0900)]
[Common] Import gst-indent script from Gstreamer mainline.

Use the script to do coding style check.

Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
6 years ago[Test F/W] gst-launch-based test framework v 1.0
MyungJoo Ham [Tue, 12 Jun 2018 03:19:39 +0000 (12:19 +0900)]
[Test F/W] gst-launch-based test framework v 1.0

nnstreamer_filter_custom is the example test group.

How to use:
- Add a subdirectory under /tests/ representing a test case group
- In the created subdirectory, write "runTest.sh" with given APIs in testAPI.sh

Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
6 years ago[converter, filter] Reduce log messages
MyungJoo Ham [Tue, 12 Jun 2018 01:37:22 +0000 (10:37 +0900)]
[converter, filter] Reduce log messages

Emit debug/log messages when proper options are given only.
Do not write such messages when no options are specified.

Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
6 years ago[Dist] Run unittest for filter/custom/1 with gbs
MyungJoo Ham [Mon, 11 Jun 2018 09:45:11 +0000 (18:45 +0900)]
[Dist] Run unittest for filter/custom/1 with gbs

Add the new filter/custom/1 testcase as a unittest during the build

Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
6 years ago[Filter/Custom] Add testcase. Fix bugs found by the testcase.
MyungJoo Ham [Mon, 11 Jun 2018 09:33:37 +0000 (18:33 +0900)]
[Filter/Custom] Add testcase. Fix bugs found by the testcase.

1. Added "passthrough with 3x280x4 tensors" Custom Filter Example
2. Added test case with the example.
3. Fixed filter/custom bugs with the test case
4. Relocated headers and their install paths

Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
6 years ago[Filter/Main] First working prototype of filter::main
MyungJoo Ham [Fri, 8 Jun 2018 06:02:01 +0000 (15:02 +0900)]
[Filter/Main] First working prototype of filter::main

The full execution path of tensor_filter::main is tested with testcase-01
although it does not process anything in the model.

Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
6 years ago[Decoder] Tensor Decoder Draft
jijoong.moon [Tue, 12 Jun 2018 07:50:50 +0000 (16:50 +0900)]
[Decoder] Tensor Decoder Draft

The Tensor Decoder revert tensor to media type.
It takes tensor as input and produce media data type. Currently only
video/x-raw supports.

Signed-off-by: jijoong.moon <jijoong.moon@samsung.com>
6 years ago[Filter/Main] Caps Negotiations Implemented
MyungJoo Ham [Thu, 7 Jun 2018 10:00:43 +0000 (19:00 +0900)]
[Filter/Main] Caps Negotiations Implemented

It appears that the simple test case of "videosrctest --> t_converter --> t_filter --> fakesink" works up to caps-negotiations & fixating caps.

Test Case:

gst-launch-1.0 -v --gst-debug=GST_CAPS:4 --gst-plugin-path=${PATH_TO_PLUGIN} videotestsrc num-buffers=1 ! video/x-raw,format=RGB,width=280,height=40,framerate=0/1 ! videoconvert ! video/x-raw, format=BGRx ! tensor_converter silent=FALSE ! tensor_filter debug=TRUE framework='tensorflow-lite' model='./nothing' input='4:280:40' inputtype='uint8' output='1' outputtype='uint8' ! filesink location="test.bgrx.log" sync=true

Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
6 years ago[Filter/Main] Restrict pad-caps when set-property gives enough information.
MyungJoo Ham [Mon, 4 Jun 2018 12:19:57 +0000 (21:19 +0900)]
[Filter/Main] Restrict pad-caps when set-property gives enough information.

With dimension/type information is available via set-property,
restrict pad-caps accordingly before calling set-caps callbacks.

Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
6 years ago[Documentation] How to write test cases
MyungJoo Ham [Tue, 12 Jun 2018 04:41:26 +0000 (13:41 +0900)]
[Documentation] How to write test cases

1. How to write gst-launch based test cases
2. How to write gtest based test cases

Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
6 years ago[Converter] Fix non-in-place (memcpy mode) and add test case for it.
MyungJoo Ham [Thu, 7 Jun 2018 11:15:05 +0000 (20:15 +0900)]
[Converter] Fix non-in-place (memcpy mode) and add test case for it.

Non inplace mode (memcpy mode) is fixed and tested.

Testcase 03 for converter tests memcpy mode.

Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
6 years ago[Common] Commonize default pad-caps for other/tensor
MyungJoo Ham [Tue, 5 Jun 2018 08:58:28 +0000 (17:58 +0900)]
[Common] Commonize default pad-caps for other/tensor

We may be changing the default pad-caps for other/tensor later.
Make it refer to the same code.

Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
6 years ago[Bug Fix] Using memmove for in-place calculation
jijoong.moon [Tue, 5 Jun 2018 08:51:48 +0000 (17:51 +0900)]
[Bug Fix] Using memmove for in-place calculation

Sometimes there is undefined behavior when the source and destination overlaped.
In this case, we have to use memmove to handle overlapping regions.

Signed-off-by: jijoong.moon <jijoong.moon@samsung.com>
6 years ago[Filter/Custom] Custom tensor postprocessing support
MyungJoo Ham [Fri, 1 Jun 2018 04:46:27 +0000 (13:46 +0900)]
[Filter/Custom] Custom tensor postprocessing support

NN developers may define their own custom tensor operations
in the format given byu tensor_common to let NNStreamer
do any custom operations on the tensor stream.

Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
6 years ago[Filter/Main] Parse all properties.
MyungJoo Ham [Thu, 31 May 2018 11:54:34 +0000 (20:54 +0900)]
[Filter/Main] Parse all properties.

1. Complete property parsing code
2. Did a little bit of refactoring & doxygen entry filling

Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
6 years ago[Unittest] Enable unittest coverage anaysis
MyungJoo Ham [Mon, 4 Jun 2018 05:09:50 +0000 (14:09 +0900)]
[Unittest] Enable unittest coverage anaysis

Use TAOS-CI to generate unittest coverage analysis html pages.

Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
6 years ago[Common] Add dimension property parsing API
MyungJoo Ham [Thu, 31 May 2018 11:49:14 +0000 (20:49 +0900)]
[Common] Add dimension property parsing API

Let's use dimension parsing API in tensor_filter

Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
6 years ago[Common] Add get_tensor_type, find_key_strv internal API.
MyungJoo Ham [Thu, 31 May 2018 08:32:26 +0000 (17:32 +0900)]
[Common] Add get_tensor_type, find_key_strv internal API.

1. Added get_tensor_type API for plugins to parse properties
2. Added unittest cases.

get_tensor_type may be implemented with find_key_strv, but, let's
use this "faster" for type property finder.

Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
6 years ago[Filter] Add more property processing
MyungJoo Ham [Thu, 31 May 2018 10:03:47 +0000 (19:03 +0900)]
[Filter] Add more property processing

1. Filter/Main: add property handling for more properites
2. Filter/TF-Lite: updated callback definitions

Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
6 years ago[Convert] Support RSTRIDE = RU4 Cases (RGB && width%4>0)
MyungJoo Ham [Thu, 24 May 2018 02:19:56 +0000 (11:19 +0900)]
[Convert] Support RSTRIDE = RU4 Cases (RGB && width%4>0)

Most (if not all) video/x-raw formats align data with 4-bytes for each
image row.

E.g., if image width = 642 and colorspace = RGB, video/x-raw adds
two zero-bytes for each row's end.

The tensor array should not have such zero-padding; thus
this commit supports zero-padding removal.

However, such operation costs one additional full memcpy; thus,
having such stream input must be discouraged.

This commit includes:
1. Support zero-padding removal
2. Added warnings when zero-paddings exists in the source streams.

Fixes #7

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