platform/core/api/machine-learning.git
23 months ago[ML Agent] Enable PIE option for Tizen security check
Sangjung Woo [Sat, 20 Aug 2022 05:26:57 +0000 (14:26 +0900)]
[ML Agent] Enable PIE option for Tizen security check

This patch enables the PIE (Position Independent Executable) option to
comply with Tizen security. If this option is not enabled, the daemon
file will be lost its executable permission when making platform image.

Signed-off-by: Sangjung Woo <sangjung.woo@samsung.com>
23 months ago[ml-service] Add test for ml-service-agent-client accepted/tizen/unified/20220819.122510 submit/tizen/20220818.081536 submit/tizen/20220819.071123
Yongjoo Ahn [Wed, 13 Jul 2022 02:05:39 +0000 (11:05 +0900)]
[ml-service] Add test for ml-service-agent-client

- Add gtest and GTestDBus based unittest for ml-service-agent-client.
- It use own session mode d-bus to test the features.

Signed-off-by: Yongjoo Ahn <yongjoo1.ahn@samsung.com>
23 months ago[service] Implement ml_service_[set|get|delete]_pipeline use dbus call
Yongjoo Ahn [Thu, 18 Aug 2022 07:01:03 +0000 (16:01 +0900)]
[service] Implement ml_service_[set|get|delete]_pipeline use dbus call

- Implement those APIs using dbus call

Signed-off-by: Yongjoo Ahn <yongjoo1.ahn@samsung.com>
23 months ago[ml-service] Add service APIs using pipelind d-bus interface
Yongjoo Ahn [Fri, 8 Jul 2022 06:01:22 +0000 (15:01 +0900)]
[ml-service] Add service APIs using pipelind d-bus interface

- Implement some service APIs using pipeline d-bus interface

Signed-off-by: Yongjoo Ahn <yongjoo1.ahn@samsung.com>
23 months ago[ml-service] Define API signatures for pipeline service.
Yongjoo Ahn [Thu, 4 Aug 2022 11:11:40 +0000 (20:11 +0900)]
[ml-service] Define API signatures for pipeline service.

- Define ml_service APIs for pipeline.

Signed-off-by: Yongjoo Ahn <yongjoo1.ahn@samsung.com>
23 months ago[service] Remove ml-api-service-db.cc and related test
Yongjoo Ahn [Thu, 18 Aug 2022 06:59:01 +0000 (15:59 +0900)]
[service] Remove ml-api-service-db.cc and related test

- Remove the source, header and tests.
- The APIs are moving to ml-api-service-agent.cc as it should use dbus
  call

Signed-off-by: Yongjoo Ahn <yongjoo1.ahn@samsung.com>
23 months ago[agent] Update policy conf file
Yongjoo Ahn [Fri, 19 Aug 2022 02:34:57 +0000 (11:34 +0900)]
[agent] Update policy conf file

- Change the owner to "service_fw".
- Set default deny for default context.

Signed-off-by: Yongjoo Ahn <yongjoo1.ahn@samsung.com>
23 months ago[ml-agent] Add set/get/delete pipeline dbus call
Yongjoo Ahn [Thu, 18 Aug 2022 06:30:59 +0000 (15:30 +0900)]
[ml-agent] Add set/get/delete pipeline dbus call

- Add `set_pipeline`, `get_pipeline`, and `delete_pipieline` dbus call.
- These correspond with `ml_service_[set|get|delete]_pipeline` APIs.

Signed-off-by: Yongjoo Ahn <yongjoo1.ahn@samsung.com>
23 months ago[Agent] Fix pipeline interface to launch pipeline in the DB
Yongjoo Ahn [Thu, 4 Aug 2022 11:02:23 +0000 (20:02 +0900)]
[Agent] Fix pipeline interface to launch pipeline in the DB

- Change the method name `register_pipeline` -> `launch_pipeline`.
  This method launch pipeline with given service name, if the pipeline
  description is stored in the DB beforehand.
- Change the module source file into cpp file. It's to use the db
  impelemntaion.

Signed-off-by: Yongjoo Ahn <yongjoo1.ahn@samsung.com>
23 months ago[ML Agent] Update systemd service file
Sangjung Woo [Wed, 17 Aug 2022 06:49:10 +0000 (15:49 +0900)]
[ML Agent] Update systemd service file

To comply with the Tizen security rule, this patch updates the systemd
service file.
- Enable DBus activation
- Set User and Group ID as service_fw

Signed-off-by: Sangjung Woo <sangjung.woo@samsung.com>
23 months ago[Debian] Enable test on ubuntu build accepted/tizen/unified/20220811.135945 submit/tizen/20220810.074948
gichan [Wed, 27 Jul 2022 04:40:10 +0000 (13:40 +0900)]
[Debian] Enable test on ubuntu build

 - Enable test on ubuntu build.

Signed-off-by: gichan <gichan2.jang@samsung.com>
23 months ago[ML Agent] Implementation of DBus Model interface
Sangjung Woo [Wed, 27 Jul 2022 07:11:59 +0000 (16:11 +0900)]
[ML Agent] Implementation of DBus Model interface

This patch newly adds the DBus Model interface, which handles the neural
network model files. The name of a model file and its file path is
stored to the internal key-value database. To do this, this patch also
adds the IMLServiceDB interface for database operation and
MLServiceLevelDB class for LevelDB support.

Signed-off-by: Sangjung Woo <sangjung.woo@samsung.com>
23 months ago[Test] Add Testcase for DBus Model interface
Sangjung Woo [Thu, 28 Jul 2022 14:29:18 +0000 (23:29 +0900)]
[Test] Add Testcase for DBus Model interface

This patch newly adds the unit testcase of DBus Model interface. It
contains both positive and negative test cases so covers various cases.

Signed-off-by: Sangjung Woo <sangjung.woo@samsung.com>
23 months ago[Refactoring] do refactoring the NNFW unit test to improve maintainability
Sangjung Woo [Tue, 19 Jul 2022 13:56:01 +0000 (22:56 +0900)]
[Refactoring] do refactoring the NNFW unit test to improve maintainability

This patch applies the Google Test Fixture to the unit test of NNFW
Inference MLAPI test. It removes the duplicate codes such as finalizing
the handle of TensorsInfo, TensorsData, Single, and Pipeline in each
test case. As a result, it helps developers focus on the test case
scenario without considering trivial settings such as model loading,
or memory allocation.

Signed-off-by: Sangjung Woo <sangjung.woo@samsung.com>
23 months ago[spec] FIx lcov option to include missed files
Yongjoo Ahn [Tue, 2 Aug 2022 04:49:44 +0000 (13:49 +0900)]
[spec] FIx lcov option to include missed files

- Current lcov command misses ml-agent source files.
- To include those files, remove --no-external option and exclude some
  external / genterated files in the coverage result.

Signed-off-by: Yongjoo Ahn <yongjoo1.ahn@samsung.com>
2 years ago[Agent] Add pipeline feature to the daemon
Yongjoo Ahn [Thu, 21 Jul 2022 01:52:46 +0000 (10:52 +0900)]
[Agent] Add pipeline feature to the daemon

- Add and implement the pipeline related feature.
- It supports following dbus method call:
  - register_pipeline
  - start_pipeline
  - stop_pipeline
  - destroy_pipeline
  - get_state
  - get_description

Signed-off-by: Yongjoo Ahn <yongjoo1.ahn@samsung.com>
2 years ago[C-API/common] Add fp16 type.
MyungJoo Ham [Wed, 22 Jun 2022 08:08:56 +0000 (17:08 +0900)]
[C-API/common] Add fp16 type.

Declare API formats for API change review process.

Note:
Fp16 is generally supported by arm/arm64 compilers.
However, x64/x86 compilers usually don't support it
(GCC>=12 is required along with some compiler flags).

Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
2 years ago[daemon] Implementation of test ML Agent
Sangjung Woo [Mon, 18 Jul 2022 06:54:08 +0000 (15:54 +0900)]
[daemon] Implementation of test ML Agent

This patch makes a machine-learning-agent-test process for test
purposes. It defines the Test DBus interface and adds the handler for
this interface. Since ML Agent provides the service file for DBus
activation, unit tests can call the Test method via Proxy and get its
result. This process and its service file are not shipped to the test
package.

Signed-off-by: Sangjung Woo <sangjung.woo@samsung.com>
2 years ago[daemon/Test] Add unit test for ML Agent itself
Sangjung Woo [Mon, 18 Jul 2022 06:10:19 +0000 (15:10 +0900)]
[daemon/Test] Add unit test for ML Agent itself

To test the daemon process itself, this patch adds unit tests for
ML Agent in the GBS environment. This test case does not use the
service APIs but directly calls the Proxy methods.

Signed-off-by: Sangjung Woo <sangjung.woo@samsung.com>
2 years ago[daemon] Add DBus service file for unit test
Sangjung Woo [Mon, 18 Jul 2022 05:44:46 +0000 (14:44 +0900)]
[daemon] Add DBus service file for unit test

To run the unit tests in the GBS environment, this patch newly adds
the DBus service file that uses the Session Bus type.

Signed-off-by: Sangjung Woo <sangjung.woo@samsung.com>
2 years ago[daemon] Add command-line option for DBus bus type
Sangjung Woo [Mon, 18 Jul 2022 05:32:03 +0000 (14:32 +0900)]
[daemon] Add command-line option for DBus bus type

To run the unit tests in the GBS environment, the session type of the
DBus is required. This patch adds the command-line option to support
the session bus.

Signed-off-by: Sangjung Woo <sangjung.woo@samsung.com>
2 years ago[ML Agent] Add daemon process code for ML Service accepted/tizen/unified/20220707.133447 submit/tizen/20220706.100329
Sangjung Woo [Thu, 16 Jun 2022 11:35:05 +0000 (20:35 +0900)]
[ML Agent] Add daemon process code for ML Service

This patch newly adds the daemon process for ML Service. It provides a
basic template code so developers can add DBus interface and its service
code.

Signed-off-by: Sangjung Woo <sangjung.woo@samsung.com>
2 years ago[android] Set tensorflow-lite v2.8.1 as default
Yongjoo Ahn [Mon, 20 Jun 2022 07:32:00 +0000 (16:32 +0900)]
[android] Set tensorflow-lite v2.8.1 as default

- Add tflite v2.8.1 support and set it as default

Signed-off-by: Yongjoo Ahn <yongjoo1.ahn@samsung.com>
2 years ago[doc] Fix API header description accepted/tizen/unified/20220615.135329 submit/tizen/20220614.070712 submit/tizen/20220614.100238
Yongjoo Ahn [Mon, 13 Jun 2022 06:56:28 +0000 (15:56 +0900)]
[doc] Fix API header description

- Fix API descriptions to meet the design guide.

Signed-off-by: Yongjoo Ahn <yongjoo1.ahn@samsung.com>
2 years ago[test/ml_option] Add unittests for ml_option
Yongjoo Ahn [Thu, 26 May 2022 01:59:46 +0000 (10:59 +0900)]
[test/ml_option] Add unittests for ml_option

- Add some testcases using newly added ml_option APIs

Signed-off-by: Yongjoo Ahn <yongjoo1.ahn@samsung.com>
2 years ago[C-API/Single] Add new API "ml_single_open_with_option"
Yongjoo Ahn [Thu, 26 May 2022 01:57:16 +0000 (10:57 +0900)]
[C-API/Single] Add new API "ml_single_open_with_option"

- This API handle ml_option provided by user and make single instance

Signed-off-by: Yongjoo Ahn <yongjoo1.ahn@samsung.com>
2 years ago[C-API/common] Add new API for "ml_option"
Yongjoo Ahn [Thu, 26 May 2022 01:53:50 +0000 (10:53 +0900)]
[C-API/common] Add new API for "ml_option"

- Add three new APIs for ml_option:
  ml_option_create
  ml_option_destory
  ml_option_set
- Define related types and structures
- The ml_option use GHashTable {const char* key : void* value} to store
  various values used by ml_*

Signed-off-by: Yongjoo Ahn <yongjoo1.ahn@samsung.com>
2 years ago[C-Api] add NNFW type (TVM)
Jaeyun [Mon, 30 May 2022 02:31:52 +0000 (11:31 +0900)]
[C-Api] add NNFW type (TVM)

Prepare ACR, add new NNFW type (TVM) and mark Tizen version.

Signed-off-by: Jaeyun <jy1210.jung@samsung.com>
2 years ago[trival] Fix header document
Yongjoo Ahn [Tue, 7 Jun 2022 06:29:23 +0000 (15:29 +0900)]
[trival] Fix header document

- Fix a typo in header description.

Signed-off-by: Yongjoo Ahn <yongjoo1.ahn@samsung.com>
2 years ago[C-Api] update API description
Jaeyun [Tue, 31 May 2022 02:58:29 +0000 (11:58 +0900)]
[C-Api] update API description

Prepare ACR, review native API and update description.

Signed-off-by: Jaeyun <jy1210.jung@samsung.com>
2 years ago[Android] update script for mxnet
Jaeyun [Mon, 30 May 2022 02:44:54 +0000 (11:44 +0900)]
[Android] update script for mxnet

1. add version flag and update prebuilt library for mxnet.
2. disable test when building lite version.

Signed-off-by: Jaeyun <jy1210.jung@samsung.com>
2 years ago[JAVA-Api] Update android build scripts.
makesource [Fri, 27 May 2022 07:17:53 +0000 (16:17 +0900)]
[JAVA-Api] Update android build scripts.

Update to use nnstreamer-github-resource github link

Signed-off-by: makesource <makesource@gmail.com>
2 years ago[C-Api] Fix indentation
makesource [Fri, 27 May 2022 05:35:02 +0000 (14:35 +0900)]
[C-Api] Fix indentation

Fix indent at init_filter_mxnet()

Signed-off-by: makesource <makesource@gmail.com>
2 years ago[JAVA-Api] Remove redundant newlines
makesource [Tue, 24 May 2022 05:04:13 +0000 (14:04 +0900)]
[JAVA-Api] Remove redundant newlines

Remove redundant newlines in build-nnstreamer-android.sh and Android.mk

Signed-off-by: makesource <makesource@gmail.com>
2 years ago[C-Api] Add missing enums in ml-api-common
makesource [Tue, 24 May 2022 04:40:22 +0000 (13:40 +0900)]
[C-Api] Add missing enums in ml-api-common

Add missing enums in ml-api-common

Signed-off-by: makesource <makesource@gmail.com>
2 years ago[JAVA-Api] Add missing MXNet enums in JAVA, c++ APIs
makesource [Mon, 23 May 2022 10:39:34 +0000 (19:39 +0900)]
[JAVA-Api] Add missing MXNet enums in JAVA, c++ APIs

Add MXNet enums in JAVA, c++ API.

Signed-off-by: makesource <makesource@gmail.com>
2 years ago[JAVA-Api] Parameterized nnstreamer mxnet subplugin
makesource [Mon, 23 May 2022 10:20:22 +0000 (19:20 +0900)]
[JAVA-Api] Parameterized nnstreamer mxnet subplugin

Add enable_mxnet, ENABLE_MXNET flags.

Signed-off-by: makesource <makesource@gmail.com>
2 years ago[JAVA-Api] Fix MXNet version
makesource [Mon, 23 May 2022 09:27:47 +0000 (18:27 +0900)]
[JAVA-Api] Fix MXNet version

Use MXNet 1.9.1 tag version

Signed-off-by: makesource <makesource@gmail.com>
2 years ago [JAVA-Api] Modify build script for MXNet build
makesource [Mon, 23 May 2022 09:07:56 +0000 (18:07 +0900)]
 [JAVA-Api] Modify build script for MXNet build

Modify build script flag that does not related with mxnet

Signed-off-by: makesource <makesource@gmail.com>
2 years ago[JAVA-Api] Modify build script for MXNet build
makesource [Sun, 1 May 2022 06:16:06 +0000 (15:16 +0900)]
[JAVA-Api] Modify build script for MXNet build

Modify build script to download MXNet so files

Signed-off-by: makesource <makesource@gmail.com>
2 years ago[JAVA-Api] Add and update MXNet related mk files
makesource [Sun, 1 May 2022 03:50:02 +0000 (12:50 +0900)]
[JAVA-Api] Add and update MXNet related mk files

Add mk files for prebuilt MXNet shared library files

Signed-off-by: makesource <makesource@gmail.com>
2 years ago[trivial] Fix some typos
Yongjoo Ahn [Thu, 26 May 2022 12:02:49 +0000 (21:02 +0900)]
[trivial] Fix some typos

- Fix some typos.

Signed-off-by: Yongjoo Ahn <yongjoo1.ahn@samsung.com>
2 years ago[C-API] Fix the typo accepted/tizen/unified/20220526.143636 submit/tizen/20220525.063351
Sangjung Woo [Mon, 23 May 2022 01:33:46 +0000 (10:33 +0900)]
[C-API] Fix the typo

This patch fixes the typo in ml-api-common.h file.

Signed-off-by: Sangjung Woo <sangjung.woo@samsung.com>
2 years ago[test] Add test for decoding pngfile using appsrc
Yongjoo Ahn [Fri, 13 May 2022 06:58:54 +0000 (15:58 +0900)]
[test] Add test for decoding pngfile using appsrc

- Add a test for decoding pngfile using appsrc (C API and android JAVA)
- It check the equality of decoded orange.png using simple pipline
  with raw file (orange.raw)

Signed-off-by: Yongjoo Ahn <yongjoo1.ahn@samsung.com>
2 years ago[pipeline] Let pipeline src use current caps when it's given
Yongjoo Ahn [Wed, 11 May 2022 07:21:08 +0000 (16:21 +0900)]
[pipeline] Let pipeline src use current caps when it's given

- If current caps is given, use it rather than allowed caps.
- Use caps "image/png" when the pipeline is "appsrc caps=image/png ! pngdec ! ... "

Signed-off-by: Yongjoo Ahn <yongjoo1.ahn@samsung.com>
2 years ago[Single] Remove gst dependency from single-shot
gichan [Mon, 9 May 2022 01:54:36 +0000 (10:54 +0900)]
[Single] Remove gst dependency from single-shot

Remove gst dependency from singlep-shot

Signed-off-by: gichan <gichan2.jang@samsung.com>
2 years ago[C/common] Remove unnecessary NULL assignment
Sangjung Woo [Mon, 2 May 2022 13:13:17 +0000 (22:13 +0900)]
[C/common] Remove unnecessary NULL assignment

This patch removes the unnecessary NULL asignment in
_ml_tensors_info_free() since _ml_tensors_info_initialize() function
internally asigns the NULL to the name of each ml_tensor_info_s. It
removes redundant code and increase the performance.

Signed-off-by: Sangjung Woo <sangjung.woo@samsung.com>
2 years ago[C/Inference] Apply extract method technique to remove redundant code
Sangjung Woo [Mon, 2 May 2022 11:54:35 +0000 (20:54 +0900)]
[C/Inference] Apply extract method technique to remove redundant code

Three internal functions for appsrc callback have the redundant code to
fetch the callback function. This patch applies the extract method
technique to remove it and increase maintainability.

Signed-off-by: Sangjung Woo <sangjung.woo@samsung.com>
2 years ago[C/Inference] Cleanup the nested-if statement
Sangjung Woo [Mon, 2 May 2022 11:05:16 +0000 (20:05 +0900)]
[C/Inference] Cleanup the nested-if statement

ml_pipeline_src_parse_tensors_info() has the deep nested-if statement
and it makes it hard to understand and maintain. This patch does
refactoring the code structure and increases readability and
maintainability.

Signed-off-by: Sangjung Woo <sangjung.woo@samsung.com>
2 years ago[C-API] Revert "Move ml_strerror() to internal header" accepted/tizen/unified/20220505.024815 submit/tizen/20220503.135114
Sangjung Woo [Tue, 3 May 2022 11:12:37 +0000 (20:12 +0900)]
[C-API] Revert "Move ml_strerror() to internal header"

Since ml_strerror() & ml_error() functions are used in webapi-plugins
module, they should be in ml-api-common.h header.

Signed-off-by: Sangjung Woo <sangjung.woo@samsung.com>
2 years ago[C-API] Move ml_strerror() to internal header submit/tizen/20220503.091109
Sangjung Woo [Tue, 3 May 2022 07:36:08 +0000 (16:36 +0900)]
[C-API] Move ml_strerror() to internal header

ml_strerror(), ml_error() functions are not ready to release. So they
are moved to internal header.

Signed-off-by: Sangjung Woo <sangjung.woo@samsung.com>
2 years ago[trivial] Fix some typos
Yongjoo Ahn [Tue, 3 May 2022 06:47:45 +0000 (15:47 +0900)]
[trivial] Fix some typos

- Fix some typos in several files

Signed-off-by: Yongjoo Ahn <yongjoo1.ahn@samsung.com>
2 years ago[C-API/Service] Refactoring for ML Service API
Sangjung Woo [Sat, 9 Apr 2022 14:47:33 +0000 (23:47 +0900)]
[C-API/Service] Refactoring for ML Service API

This patch adds disconnectDB() interface in IMLServiceDB and closes
the DB handle explicitly after use. Since some embedded database
such as LevelDB does not support multi-process so only one process
can access the DB at one time and it might cause the IO exceptions.
This patch reduces the deadlock situation.

Signed-off-by: Sangjung Woo <sangjung.woo@samsung.com>
2 years ago[C-API/Test] Add Mock testcase for Service API
Sangjung Woo [Sat, 9 Apr 2022 00:36:55 +0000 (09:36 +0900)]
[C-API/Test] Add Mock testcase for Service API

ML Service API uses an external database library and it could raise
unexpected errors such as IO Exception. To handle their exceptions,
lots of error handling code was added but it is hard to test because
exceptions are not raised in normal cases. In this patch, we use GMock
for dependency injection of external libraries. We can define the
expected exception when calling an external API so can verify its operation.

Signed-off-by: Sangjung Woo <sangjung.woo@samsung.com>
2 years ago[C-API] Remove unnecessary doxygen tag
Sangjung Woo [Tue, 26 Apr 2022 04:36:30 +0000 (13:36 +0900)]
[C-API] Remove unnecessary doxygen tag

This patch removes the unnecessary doxygen tag in doc.h file.

Signed-off-by: Sangjung Woo <sangjung.woo@samsung.com>
2 years ago[C-Api/pipeline] clear element callback accepted/tizen/unified/20220426.132018 submit/tizen/20220426.050006
Jaeyun [Mon, 25 Apr 2022 06:30:35 +0000 (15:30 +0900)]
[C-Api/pipeline] clear element callback

1. Clear element callback before changing the pipeline state - receiving the EOS event.
2. Fix element lock when an error occurs in internal process.

Signed-off-by: Jaeyun <jy1210.jung@samsung.com>
2 years ago[C-API] Update doc file for ML Service API submit/tizen/20220422.081403 submit/tizen/20220425.043951
Sangjung Woo [Fri, 22 Apr 2022 05:37:35 +0000 (14:37 +0900)]
[C-API] Update doc file for ML Service API

This patch adds the doxygen section and updates doc.h file for ML Service API.

Signed-off-by: Sangjung Woo <sangjung.woo@samsung.com>
2 years ago[ML-API] version info
Jaeyun [Fri, 22 Apr 2022 06:05:23 +0000 (15:05 +0900)]
[ML-API] version info

Set project version to 1.8.1 (will be updated later - 1.8.2 for Tizen M2)

Signed-off-by: Jaeyun <jy1210.jung@samsung.com>
2 years ago[C-Api] handle each feature state
Jaeyun [Thu, 21 Apr 2022 08:26:01 +0000 (17:26 +0900)]
[C-Api] handle each feature state

Each Tizen ML feature state (inference, training, service) should be managed separately.

Signed-off-by: Jaeyun <jy1210.jung@samsung.com>
2 years ago[C-Api/Service] fix svace issue
Jaeyun [Fri, 22 Apr 2022 02:35:12 +0000 (11:35 +0900)]
[C-Api/Service] fix svace issue

Fix svace issue - remove memory leak.

Signed-off-by: Jaeyun <jy1210.jung@samsung.com>
2 years ago[Feature] Add ml-service feature check function
gichan [Wed, 20 Apr 2022 10:12:16 +0000 (19:12 +0900)]
[Feature] Add ml-service feature check function

Add machine learning service feature check function.

Signed-off-by: gichan <gichan2.jang@samsung.com>
2 years ago[Doc] Change CI server domain name
gichan [Wed, 20 Apr 2022 02:19:10 +0000 (11:19 +0900)]
[Doc] Change CI server domain name

Change CI server domain name from nnstreamer.mooo.com to ci.nnstreamer.ai

Signed-off-by: gichan <gichan2.jang@samsung.com>
2 years ago[single] Allow tvn model when using VD_AIFW
yelini-jeong [Mon, 18 Apr 2022 09:55:54 +0000 (18:55 +0900)]
[single] Allow tvn model when using VD_AIFW

This patch allows tvn model when using VD_AIFW framework.

Signed-off-by: yelini-jeong <yelini.jeong@samsung.com>
2 years ago[C-Api/Service] update API description accepted/tizen/unified/20220419.142256 submit/tizen/20220418.053521
Jaeyun [Mon, 11 Apr 2022 05:25:51 +0000 (14:25 +0900)]
[C-Api/Service] update API description

Under the API review, update API description and example code.

Signed-off-by: Jaeyun <jy1210.jung@samsung.com>
2 years ago[C-API/Service] Workaround for dbspace failure
Sangjung Woo [Mon, 18 Apr 2022 01:58:29 +0000 (10:58 +0900)]
[C-API/Service] Workaround for dbspace failure

Because of SMACK control, the application process cannot access the
'/opt/usr/dbspace'. To meet the Tizen M1 release schedule, this patch
uses '/tmp' as database space. It is just a workaround and will be fixed
in the right way.

Signed-off-by: Sangjung Woo <sangjung.woo@samsung.com>
2 years ago[Package] Add SMACK label and cleanup the package
Sangjung Woo [Thu, 14 Apr 2022 15:19:04 +0000 (00:19 +0900)]
[Package] Add SMACK label and cleanup the package

After modifying C-API packages, the SMACK label was omitted for
each package. And library packages contain unnecessary so file.
This patch adds omitted SMACK label and cleans up the contents of
the package.

Signed-off-by: Sangjung Woo <sangjung.woo@samsung.com>
2 years agoCODEOWNERS: update reviewers.
MyungJoo Ham [Wed, 13 Apr 2022 10:04:27 +0000 (19:04 +0900)]
CODEOWNERS: update reviewers.

New members introduced: @songgot (will be writing APIs soon)

Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
2 years agoC/common: ml_tensors_info_set_tensor_dimension error message.
MyungJoo Ham [Wed, 13 Apr 2022 10:00:56 +0000 (19:00 +0900)]
C/common: ml_tensors_info_set_tensor_dimension error message.

Tell the API users why the error happens and how they can mend it.

Fixes https://github.com/nnstreamer/nnstreamer/issues/3562

Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
2 years ago[C-API/Test] Apply test fixture to remove duplicate code
Sangjung Woo [Mon, 4 Apr 2022 12:42:12 +0000 (21:42 +0900)]
[C-API/Test] Apply test fixture to remove duplicate code

To remove duplicate code in each test case, this patch applies the
test fixture framework. g_autofree macro is used for allocated space
to be freed automatically no matter test case is passed or not.

Signed-off-by: Sangjung Woo <sangjung.woo@samsung.com>
2 years ago[CodeClean] cleanup headers
Jaeyun [Thu, 7 Apr 2022 06:51:01 +0000 (15:51 +0900)]
[CodeClean] cleanup headers

cleanup headers and warning in meson build script before starting ACR process.

Signed-off-by: Jaeyun <jy1210.jung@samsung.com>
2 years ago[Package] Change package dependency.
gichan [Wed, 6 Apr 2022 05:15:29 +0000 (14:15 +0900)]
[Package] Change package dependency.

Previously, the single and pipeline API were separated.
Change the pipeline package contain the single package.

Signed-off-by: gichan <gichan2.jang@samsung.com>
2 years ago[C-API/Service] Apply Singleton pattern
Sangjung Woo [Mon, 4 Apr 2022 03:27:01 +0000 (12:27 +0900)]
[C-API/Service] Apply Singleton pattern

This patch applies the singleton pattern to MLServiceLevelDB class
so that a single instance exists in runtime.

Signed-off-by: Sangjung Woo <sangjung.woo@samsung.com>
2 years ago[C-API/Service] Refactoring the service API for maintainability and readability
Sangjung Woo [Mon, 28 Mar 2022 02:39:25 +0000 (11:39 +0900)]
[C-API/Service] Refactoring the service API for maintainability and readability

To support various database systems, this patch defines the interface
class IMLServiceDB and implements MLServiceLevelDB using LevelDB. If the
backend DB is changed, we just add a new class for the new DB without
changing the existing code. That increases the maintainability.
Moreover, this patch updates the signature of user-level APIs to
increase readability.

Signed-off-by: Sangjung Woo <sangjung.woo@samsung.com>
2 years ago[C-API/TEST] Add various test cases for ML Service API
Sangjung Woo [Mon, 28 Mar 2022 07:27:30 +0000 (16:27 +0900)]
[C-API/TEST] Add various test cases for ML Service API

This patch newly adds the test cases for ML Service APIs. They include
the positive and negative cases for setting, getting, and deleting the
pipeline description.

Signed-off-by: Sangjung Woo <sangjung.woo@samsung.com>
2 years ago[C-API] Add Error code for DB and filesystem
Sangjung Woo [Mon, 28 Mar 2022 02:17:51 +0000 (11:17 +0900)]
[C-API] Add Error code for DB and filesystem

This patch newly adds the ML_ERROR_IO_ERROR code for the failure
of DB and filesystem operation.

Signed-off-by: Sangjung Woo <sangjung.woo@samsung.com>
2 years ago[Package] Bugfix for package dependency
Sangjung Woo [Thu, 31 Mar 2022 12:05:44 +0000 (21:05 +0900)]
[Package] Bugfix for package dependency

To maintain backward compatibility, capi-machine-learning-inference
package should require pipeline, single and common libraries. However,
common is omitted and it can cause break issues when making platform
:1image. This patch fixes this bug.

Signed-off-by: Sangjung Woo <sangjung.woo@samsung.com>
2 years ago[C-API/Serivce] Update the doxygen tag
Sangjung Woo [Wed, 16 Mar 2022 02:21:37 +0000 (11:21 +0900)]
[C-API/Serivce] Update the doxygen tag

This patch updates the doxygen tag and comments for ML Service API.

Signed-off-by: Sangjung Woo <sangjung.woo@samsung.com>
2 years ago[C-API/Serivce] Set SYS_DB_DIR as build configuration
Sangjung Woo [Tue, 15 Mar 2022 13:22:57 +0000 (22:22 +0900)]
[C-API/Serivce] Set SYS_DB_DIR as build configuration

This patch sets the SYS_DB_DIR as build configuration. In the case
of Tizen, a predefined DB path (i.e. TZ_SYS_GLOBALUSER_DB) is used.

Signed-off-by: Sangjung Woo <sangjung.woo@samsung.com>
2 years ago[C-API/Service] Add testcase for ML Service API
Sangjung Woo [Tue, 8 Mar 2022 03:24:28 +0000 (12:24 +0900)]
[C-API/Service] Add testcase for ML Service API

This patch adds the basic testcase of the ML Service API for adding
and getting the pipeline description with the name.

Signed-off-by: Sangjung Woo <sangjung.woo@samsung.com>
2 years ago[C-API/Service] implement ML Service API
Sangjung Woo [Tue, 8 Mar 2022 03:13:18 +0000 (12:13 +0900)]
[C-API/Service] implement ML Service API

This patch newly adds the ML Service APIs for adding and getting the
pipeline description with the name. To store the pipeline description,
leveldb is used.

Signed-off-by: Sangjung Woo <sangjung.woo@samsung.com>
2 years ago[C-API/Service] Fix the compile-time error
Sangjung Woo [Tue, 8 Mar 2022 01:53:27 +0000 (10:53 +0900)]
[C-API/Service] Fix the compile-time error

Because of an omitted semicolon and header file, there is a compile-time error
when using ml-api-service.h header. This patch fixes this bug.

Signed-off-by: Sangjung Woo <sangjung.woo@samsung.com>
2 years ago[debian] Rename invalid .install file names
gichan [Fri, 25 Mar 2022 05:12:50 +0000 (14:12 +0900)]
[debian] Rename invalid .install file names

Rename invalid .install file names.
...-dev-api.install -> ..-api-dev.install

Signed-off-by: gichan <gichan2.jang@samsung.com>
2 years ago[debian] Separate debian packaging
gichan [Wed, 23 Mar 2022 07:47:41 +0000 (16:47 +0900)]
[debian] Separate debian packaging

 - Separate single/pipeline debian package
 - Change library name (capi-nnstreamer-* -> ml-inference-*)

Signed-off-by: gichan <gichan2.jang@samsung.com>
2 years ago[C/inference] Apply Substitute Algorithm instead of Switch-Case statement
Sangjung Woo [Fri, 11 Mar 2022 12:18:51 +0000 (21:18 +0900)]
[C/inference] Apply Substitute Algorithm instead of Switch-Case statement

This patch does refactoring the code by applying the Substitute
Algorithm technique. Instead of a Switch-Case statement, a hash table is
used and it increases both readability and performance.

Signed-off-by: Sangjung Woo <sangjung.woo@samsung.com>
2 years ago[C/inference] Refactoring the nested-if statement
Sangjung Woo [Thu, 10 Mar 2022 11:32:24 +0000 (20:32 +0900)]
[C/inference] Refactoring the nested-if statement

A nested if statement makes it hard to understand and maintain the code.
This patch reorganizes the code structure and increases readability.

Signed-off-by: Sangjung Woo <sangjung.woo@samsung.com>
2 years ago[C/inference] Apply extract method for type converting
Sangjung Woo [Thu, 10 Mar 2022 10:35:56 +0000 (19:35 +0900)]
[C/inference] Apply extract method for type converting

Instead of a complicated switch-case statement in the function, this
patch extracts a new function for type converting. Since the enumeration
of both types is the same order, typecasting is good enough for
converting.

Signed-off-by: Sangjung Woo <sangjung.woo@samsung.com>
2 years ago[meson] change global link -> project link
Jihoon Lee [Sat, 12 Mar 2022 05:35:19 +0000 (14:35 +0900)]
[meson] change global link -> project link

As recommended from a review in #137, add_global_link_argument has
changed to add_project_link_argument

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

Signed-off-by: Jihoon Lee <jhoon.it.lee@samsung.com>
2 years ago[Debian] update ml-inference-api-dev package
Jihoon Lee [Fri, 11 Mar 2022 02:39:13 +0000 (11:39 +0900)]
[Debian] update ml-inference-api-dev package

After #131, ml-inference-api-dev is relying on capi-ml-inference-single
and capi-ml-inference-pipeline pc.

It might have been better that ml-inference-api-dev relying on
ml-inference-single/pipeline-dev. As the package is not introduced,
this patch add pc files into the ml-inference-api-dev package.

See also: https://github.com/nnstreamer/nntrainer/issues/1853#issuecomment-1064220362

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

Signed-off-by: Jihoon Lee <jhoon.it.lee@samsung.com>
2 years agoFix libcapi-nnstremer is empty due to linker optimization
Jihoon Lee [Tue, 8 Mar 2022 14:26:52 +0000 (23:26 +0900)]
Fix libcapi-nnstremer is empty due to linker optimization

From #131, libcapi-nnstreamer.so became empty because
libcapi-nnstreamer.so does not contain any symbol from
libcapi-nnstreamer-single, libcapi-nnstreamer-pipeline.so

This should be semantically resolvable by using 'link-whole' argument in
meson but it is not implemented for shared_library.

This patch address the issue by disabling `-bas-needed=false` in meson
and add -Wl,--as-needed to global linker argument.

https://github.com/mesonbuild/meson/issues/3046.

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

Signed-off-by: Jihoon Lee <jhoon.it.lee@samsung.com>
2 years ago[Log] log utils from nnstreamer
Jaeyun [Thu, 3 Mar 2022 08:23:05 +0000 (17:23 +0900)]
[Log] log utils from nnstreamer

The log util was separated from nnstreamer repo.
Remove unnecessary header and update log util.

Signed-off-by: Jaeyun <jy1210.jung@samsung.com>
2 years ago[Package] Separate single-shot and pipeline API.
Gichan Jang [Mon, 24 Jan 2022 04:59:59 +0000 (13:59 +0900)]
[Package] Separate single-shot and pipeline API.

 - `machine-learning-inference` is separated to `machine-learning-inference-single` and `machine-learning-inference-pipeline`.
 - Separate internal header files.

Signed-off-by: gichan <gichan2.jang@samsung.com>
2 years ago[build] Build android api with gstreamer v1.20.0 accepted/tizen/unified/20220223.132524 submit/tizen/20220222.112350
Yongjoo Ahn [Fri, 11 Feb 2022 05:45:35 +0000 (14:45 +0900)]
[build] Build android api with gstreamer v1.20.0

- Assume that android builds are with gstreamer v1.20.0
- Remove the patch file which is no needed for the new version
- Modify the patch file for tracing

Signed-off-by: Yongjoo Ahn <yongjoo1.ahn@samsung.com>
2 years ago[Tizen/TEST] Add gcov package
Gichan Jang [Wed, 26 Jan 2022 07:31:15 +0000 (16:31 +0900)]
[Tizen/TEST] Add gcov package

Add gcov package for tizen coverage auto measurement tool.

Signed-off-by: Gichan Jang <gichan2.jang@samsung.com>
2 years ago[C-Api/Test] condition to check allowed element
Jaeyun [Fri, 21 Jan 2022 05:11:11 +0000 (14:11 +0900)]
[C-Api/Test] condition to check allowed element

1. init gstreamer before starting the unittest.
2. check element restriction flag from config file.

Signed-off-by: Jaeyun <jy1210.jung@samsung.com>
2 years ago[C-Api/CodeClean] internal struct for pipeline
Jaeyun [Fri, 21 Jan 2022 03:17:51 +0000 (12:17 +0900)]
[C-Api/CodeClean] internal struct for pipeline

Code clean, cleanup definition for internal data struct.

TODO: We now have a plan to separate single and pipeline source.
Then it is necessary to hide internal data struct for pipeline functions.

Signed-off-by: Jaeyun <jy1210.jung@samsung.com>
2 years ago[C-Api/Util] util function to get gst element
Jaeyun [Fri, 21 Jan 2022 03:15:07 +0000 (12:15 +0900)]
[C-Api/Util] util function to get gst element

Add util function to get gst-element instance.

Signed-off-by: Jaeyun <jy1210.jung@samsung.com>
2 years ago[TEST] Check restricted elements. accepted/tizen/unified/20220124.125228 submit/tizen/20220121.055425
Gichan Jang [Thu, 30 Dec 2021 02:22:17 +0000 (11:22 +0900)]
[TEST] Check restricted elements.

Check whether the restricted elements are properly handled or not.

Signed-off-by: Gichan Jang <gichan2.jang@samsung.com>
2 years agoC/Service: first prototypes of service API Phase 1
MyungJoo Ham [Wed, 3 Nov 2021 03:36:36 +0000 (12:36 +0900)]
C/Service: first prototypes of service API Phase 1

This is the start of designing https://github.com/nnstreamer/nnstreamer/issues/3473
Phase 1 and 2 APIs are declared.

Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
2 years agoC/common: refactor data structure locations for service API
MyungJoo Ham [Wed, 17 Nov 2021 03:29:27 +0000 (12:29 +0900)]
C/common: refactor data structure locations for service API

A few definitions in pipeline/single APIs are used by service API.
Move such definitions to the common header.

Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
2 years ago[C/inference] Use allowed_elements instead of restricted-elements
Sangjung Woo [Thu, 6 Jan 2022 10:31:46 +0000 (19:31 +0900)]
[C/inference] Use allowed_elements instead of restricted-elements

The name 'restricted-elements' of nnstreamer configuration is not
matched as its real operation. Because of this reason, its name is
renamed to 'allowed_elements'. This patch updates the related code.

Signed-off-by: Sangjung Woo <sangjung.woo@samsung.com>