platform/core/api/machine-learning.git
15 months ago[C-Api/Service] define API for ml-resource
Jaeyun Jung [Wed, 5 Jul 2023 12:16:07 +0000 (21:16 +0900)]
[C-Api/Service] define API for ml-resource

Define new API set for ml-resource control.

Signed-off-by: Jaeyun Jung <jy1210.jung@samsung.com>
15 months ago[Test] predefined dbus name
Jaeyun Jung [Fri, 28 Jul 2023 04:50:52 +0000 (13:50 +0900)]
[Test] predefined dbus name

Code clean, use predefined dbus name in dbus-interface.

Signed-off-by: Jaeyun Jung <jy1210.jung@samsung.com>
15 months ago[Service] ml-agent interface for resource
Jaeyun Jung [Mon, 24 Jul 2023 07:36:45 +0000 (16:36 +0900)]
[Service] ml-agent interface for resource

Implement ml-agent interface for ml-resource.

Signed-off-by: Jaeyun Jung <jy1210.jung@samsung.com>
15 months ago[Service] add resource table accepted/tizen/unified/20230727.173056
Jaeyun Jung [Mon, 24 Jul 2023 06:03:35 +0000 (15:03 +0900)]
[Service] add resource table

Add new table for ml-resource, and add functions for ml-agent.

Signed-off-by: Jaeyun Jung <jy1210.jung@samsung.com>
15 months ago[Service/CodeClean] reduce duplicated code
Jaeyun Jung [Tue, 18 Jul 2023 11:36:31 +0000 (20:36 +0900)]
[Service/CodeClean] reduce duplicated code

Code clean,
1. Add methods in service-db to reduce duplicated code.
2. Add key prefix for each table.

Signed-off-by: Jaeyun Jung <jy1210.jung@samsung.com>
15 months ago[test] Add TCs for Pipeline API with 32 in/out model
Yongjoo Ahn [Wed, 21 Jun 2023 08:34:19 +0000 (17:34 +0900)]
[test] Add TCs for Pipeline API with 32 in/out model

- Test NNStreamer pipeline for tflite model with 32 input / 32 output tensors
- one using videotestsrc / and the other using appsrc

Signed-off-by: Yongjoo Ahn <yongjoo1.ahn@samsung.com>
15 months ago[test] Add TC for singleshot with 32 input/output tflite model
Yongjoo Ahn [Wed, 21 Jun 2023 08:32:27 +0000 (17:32 +0900)]
[test] Add TC for singleshot with 32 input/output tflite model

- Test Single for tflite model with 32 input / 32 output tensors.

Signed-off-by: Yongjoo Ahn <yongjoo1.ahn@samsung.com>
15 months ago[test] Add test for common util
Yongjoo Ahn [Mon, 10 Jul 2023 06:38:01 +0000 (15:38 +0900)]
[test] Add test for common util

- Add TCs for tensors_info handling ML_TENSOR_SIZE_LIMIT infos.
- Add negative TCs for newly added internal utils.

Signed-off-by: Yongjoo Ahn <yongjoo1.ahn@samsung.com>
15 months ago[test] Change datatype_consistency test
Yongjoo Ahn [Wed, 21 Jun 2023 08:31:16 +0000 (17:31 +0900)]
[test] Change datatype_consistency test

- Remove tests with value `NNS_TENSOR_SIZE_LIMIT`
- Revert later when the value is changed.

Signed-off-by: Yongjoo Ahn <yongjoo1.ahn@samsung.com>
15 months ago[Pipeline] Let pipeline handle increased number of tensors
Yongjoo Ahn [Wed, 21 Jun 2023 08:29:28 +0000 (17:29 +0900)]
[Pipeline] Let pipeline handle increased number of tensors

- Let sink and src element deal with tensors not memory using util function from nnstreamer
- Remove size check in `cb_sink_event` that is no longer valid.

Signed-off-by: Yongjoo Ahn <yongjoo1.ahn@samsung.com>
15 months ago[common] Add utils for extra tensor_info
Yongjoo Ahn [Wed, 21 Jun 2023 08:22:48 +0000 (17:22 +0900)]
[common] Add utils for extra tensor_info

- Add util functions for extra `ml_tensor_info_s`.
- Replace index based access of tensor_info with newly added util
  `gst_tensors_info_get_nth_info` and `ml_tensors_info_get_nth_info`

Signed-off-by: Yongjoo Ahn <yongjoo1.ahn@samsung.com>
15 months ago[common] Increase ML_TENSOR_SIZE_LIMIT 16 -> 256
Yongjoo Ahn [Wed, 21 Jun 2023 08:18:11 +0000 (17:18 +0900)]
[common] Increase ML_TENSOR_SIZE_LIMIT 16 -> 256

- Increase `ML_TENSOR_SIZE_LIMIT` to 256
- Define `ML_TENSOR_SIZE_LIMIT_STATIC` and
  `ML_TENSOR_SIZE_EXTRA_LIMIT` to handle extra tensors

Signed-off-by: Yongjoo Ahn <yongjoo1.ahn@samsung.com>
15 months ago[Service] util to init gdbus module
Jaeyun Jung [Mon, 17 Jul 2023 08:26:13 +0000 (17:26 +0900)]
[Service] util to init gdbus module

Fix log message, and add common function to initialize gdbus module.

Signed-off-by: Jaeyun Jung <jy1210.jung@samsung.com>
15 months ago[common] Refactor ml_option APIs to use internal ml_info
Yongjoo Ahn [Thu, 13 Jul 2023 07:26:12 +0000 (16:26 +0900)]
[common] Refactor ml_option APIs to use internal ml_info

- Declare ml_info and related enum and structures. Add internal
  functions for create, destroy, set, get.
- Replace ml_option_s with the new internal structure in ml_option API.

Signed-off-by: Yongjoo Ahn <yongjoo1.ahn@samsung.com>
15 months ago[opton] Use ml_option_get to get value from ml_option_h
Yongjoo Ahn [Thu, 13 Jul 2023 05:32:15 +0000 (14:32 +0900)]
[opton] Use ml_option_get to get value from ml_option_h

- Use the API rather than accessing internal structure.

Signed-off-by: Yongjoo Ahn <yongjoo1.ahn@samsung.com>
15 months ago[Service] set dbus-complete function
Jaeyun Jung [Mon, 17 Jul 2023 08:21:27 +0000 (17:21 +0900)]
[Service] set dbus-complete function

Set exact complete function in dbus callback.

Signed-off-by: Jaeyun Jung <jy1210.jung@samsung.com>
15 months ago[C-Api] util to check file path
Jaeyun Jung [Tue, 11 Jul 2023 11:24:21 +0000 (20:24 +0900)]
[C-Api] util to check file path

Code clean, add internal function to check the path of model or resource.
This will be used resource-add function later.

Signed-off-by: Jaeyun Jung <jy1210.jung@samsung.com>
16 months ago[API] function to get version
Jaeyun Jung [Fri, 7 Jul 2023 09:09:05 +0000 (18:09 +0900)]
[API] function to get version

Add util function to get version of ML-API.

Signed-off-by: Jaeyun Jung <jy1210.jung@samsung.com>
16 months ago[C-Api] log string
Jaeyun Jung [Mon, 10 Jul 2023 06:54:41 +0000 (15:54 +0900)]
[C-Api] log string

Trivial, update log string before adding new API set.

Signed-off-by: Jaeyun Jung <jy1210.jung@samsung.com>
16 months ago[Service] Remove deprecated header file accepted/tizen/unified/20230710.013138
gichan2-jang [Tue, 4 Jul 2023 09:13:49 +0000 (18:13 +0900)]
[Service] Remove deprecated header file

Since ml-api-service-internal.h is deprecated, remove the file.

Signed-off-by: gichan2-jang <gichan2.jang@samsung.com>
16 months agoDaemon/Model: Add missing gst initialization
Wook Song [Tue, 27 Jun 2023 07:00:28 +0000 (16:00 +0900)]
Daemon/Model: Add missing gst initialization

This patch adds GStreamer initialization procedure into
init_model_module. Without the initialization, D-Bus interfaces for
the models inproperly work.

Signed-off-by: Wook Song <wook16.song@samsung.com>
16 months agoDist/Tizen: Include ml-agentd.pc in the ml-agnet-devel package accepted/tizen/unified/20230628.023700
Wook Song [Mon, 19 Jun 2023 07:59:30 +0000 (16:59 +0900)]
Dist/Tizen: Include ml-agentd.pc in the ml-agnet-devel package

This patch updates the Tizen RPM spec file to add the ml-agentd.pc file
to the libmachine-learning-agent-devel package.

Signed-off-by: Wook Song <wook16.song@samsung.com>
16 months agoDaemon/Meson: Add a pkg-config file for ml-agentd
Wook Song [Mon, 19 Jun 2023 07:52:17 +0000 (16:52 +0900)]
Daemon/Meson: Add a pkg-config file for ml-agentd

This patch adds a pkg-config file that provides details for using the
Machine Machine Learning Agent service interfaces.

Signed-off-by: Wook Song <wook16.song@samsung.com>
16 months ago[single] Fix macro value for rank
Yongjoo Ahn [Wed, 21 Jun 2023 08:15:26 +0000 (17:15 +0900)]
[single] Fix macro value for rank

- Change size_limit to rank_limit in rank related methods

Signed-off-by: Yongjoo Ahn <yongjoo1.ahn@samsung.com>
16 months agoUpdate Android-nnstreamer.mk
Harsh Jain [Thu, 15 Jun 2023 09:07:10 +0000 (14:37 +0530)]
Update Android-nnstreamer.mk

Updated Android-nnstreamer.mk for tensor_decoder::tensor_region sub-plugin in regard to https://github.com/nnstreamer/nnstreamer/pull/4115#discussion_r1230632289

Signed-off-by: HarshJ20 <hjain24in@gmail.com>
16 months ago[fix] Fix mem leak in Single API
Yongjoo Ahn [Thu, 15 Jun 2023 04:11:04 +0000 (13:11 +0900)]
[fix] Fix mem leak in Single API

- Destroy ml_tensors_info_h in ml_single_close
- Call gst_tensors_info_free

Signed-off-by: Yongjoo Ahn <yongjoo1.ahn@samsung.com>
16 months ago[fix] Fix memi leak in pipeline API
Yongjoo Ahn [Tue, 13 Jun 2023 12:35:46 +0000 (21:35 +0900)]
[fix] Fix memi leak in pipeline API

- Free GstTensorsConfig using gst_tensors_config_free
- Initialize ml_tensors_info_s before set a new one

Signed-off-by: Yongjoo Ahn <yongjoo1.ahn@samsung.com>
16 months agofix svace issue.
SuYeon [Wed, 14 Jun 2023 02:22:18 +0000 (11:22 +0900)]
fix svace issue.

error param should be paased to 'json_parser_load_from_data' since error_report acess to error message.

Signed-off-by: SuYeon <suyeon5.kim@samsung.com>
16 months ago[Tizen] Update coverage auto measurement script accepted/tizen/unified/20230615.060045
gichan2-jang [Tue, 13 Jun 2023 02:41:24 +0000 (11:41 +0900)]
[Tizen] Update coverage auto measurement script

 - Exclude 'ml-api-common-tizen-feature-check.c' and
'ml-api-inference-tizen-privilege-check.c' from the coverage report.
 - Change test directory before running the tests.

Error:
[DEBUG]:[ RUN      ] [mMLAgentTest.call_method
Error : GDBus.Error:org.freedesktop.DBus.Error.ServiceUnknown: The name org.tizen.machinelearning.service was not provided by any .service files
[DEBUG]:../tests/daemon/unittest_ml_agent.cc:87: Failure

Signed-off-by: gichan2-jang <gichan2.jang@samsung.com>
16 months agoAPI/Client: Revise JSON cstring conversion code
Wook Song [Tue, 13 Jun 2023 01:21:48 +0000 (10:21 +0900)]
API/Client: Revise JSON cstring conversion code

This patch revises the mechanism that creates ml_option_h typed data
from a JSON cstring.

Signed-off-by: Wook Song <wook16.song@samsung.com>
16 months ago[ml-service] Add 'app_common_internal.h' to support Tizen v7.0 accepted/tizen/unified/20230613.170826
Sangjung Woo [Mon, 12 Jun 2023 08:31:41 +0000 (17:31 +0900)]
[ml-service] Add 'app_common_internal.h' to support Tizen v7.0

In case of Tizen 7.0, app_get_res_control_global_resource_path() is
defined in app_common_internal.h. So this patch includes
app_common_internal.h to support both of Tizen 7.0 and latest Tizen.

Signed-off-by: Sangjung Woo <sangjung.woo@samsung.com>
17 months ago[Test] feature for tf-lite accepted/tizen/unified/20230609.163741
Jaeyun Jung [Thu, 1 Jun 2023 05:53:49 +0000 (14:53 +0900)]
[Test] feature for tf-lite

Enable testcase if tensorflow-lite ver2.x is available.

Signed-off-by: Jaeyun Jung <jy1210.jung@samsung.com>
17 months ago[Service] common log-util
Jaeyun Jung [Thu, 1 Jun 2023 05:58:35 +0000 (14:58 +0900)]
[Service] common log-util

Code clean, use common log-util in ml-agent code.

Signed-off-by: Jaeyun Jung <jy1210.jung@samsung.com>
17 months agoAPI/Client: Use nested scope for JSON handling
Wook Song [Mon, 22 May 2023 08:06:17 +0000 (17:06 +0900)]
API/Client: Use nested scope for JSON handling

This is a trivial patch for code cleaning. Toward better readability,
nested scope and g_auto* are used for JSON handling.

Signed-off-by: Wook Song <wook16.song@samsung.com>
17 months agoDaemon/DBus: Replace NULL with "" for the DBus out parameters
Wook Song [Wed, 24 May 2023 10:15:09 +0000 (19:15 +0900)]
Daemon/DBus: Replace NULL with "" for the DBus out parameters

When the out parameter type is set to "s" (which means a string type
value), it should not be a NULL value. This patch fixes such a case
in the DBus callback implementation for the pipeline.

Signed-off-by: Wook Song <wook16.song@samsung.com>
17 months agoAPI/Client: Replace g_new0 with g_try_new0
Wook Song [Mon, 22 May 2023 07:32:52 +0000 (16:32 +0900)]
API/Client: Replace g_new0 with g_try_new0

g_new0 would not work as the author intended. This patch replaces g_new0
macros with g_try_new0 macros so that memory allocation failure is
checked at runtime.

Signed-off-by: Wook Song <wook16.song@samsung.com>
17 months agoAPI/Client: Revise null-checks for output parameters
Wook Song [Mon, 22 May 2023 06:50:32 +0000 (15:50 +0900)]
API/Client: Revise null-checks for output parameters

This patch revises null-checks for the output parameters, which
require memory allocation at the callee side, to return an error when
the argument is NULL and to warn the leak possibility when the
dereference is not NULL.

Signed-off-by: Wook Song <wook16.song@samsung.com>
17 months agoDaemon: Change the directory including header file to 'include'
Wook Song [Mon, 22 May 2023 02:46:30 +0000 (11:46 +0900)]
Daemon: Change the directory including header file to 'include'

To keep consistency with the C-Level API's header file directory, this
patch changes the directory including ML Agent Service's header files to
'include' from 'includes'.

Signed-off-by: Wook Song <wook16.song@samsung.com>
17 months ago[Service] deleting activated model
Jaeyun Jung [Wed, 3 May 2023 11:49:06 +0000 (20:49 +0900)]
[Service] deleting activated model

Add util functions in service-db,
1. prevent deleting activated model,
2. add util function to check model registration.

Signed-off-by: Jaeyun Jung <jy1210.jung@samsung.com>
17 months ago[Service] Fix the wrong requires section of pkgconfig file
Sangjung Woo [Thu, 18 May 2023 04:56:46 +0000 (13:56 +0900)]
[Service] Fix the wrong requires section of pkgconfig file

This patch fixes the wrong requires section of ML Service package config file.

Signed-off-by: Sangjung Woo <sangjung.woo@samsung.com>
17 months agoTests: Revise the unittests package
Wook Song [Thu, 18 May 2023 04:32:23 +0000 (13:32 +0900)]
Tests: Revise the unittests package

This patch revised the meson build script and Tizen's rpm spec file to
include files which are required by the test daemon,
machine-learning-agent-test.

Signed-off-by: Wook Song <wook16.song@samsung.com>
17 months ago[Release] Change the name tizen 7.5 into tizen 8.0
Yongjoo Ahn [Mon, 15 May 2023 05:00:30 +0000 (14:00 +0900)]
[Release] Change the name tizen 7.5 into tizen 8.0

- Tizen X.5 is not going to be used. Change tizen 7.5 to tizen 8.0

Signed-off-by: Yongjoo Ahn <yongjoo1.ahn@samsung.com>
17 months ago[Tizen] Fix script for converage auto measurement
gichan2-jang [Thu, 11 May 2023 10:11:14 +0000 (19:11 +0900)]
[Tizen] Fix script for converage auto measurement

Fix script for coverage auto measuremnt
 - Set MLAPI PATH

Signed-off-by: gichan2-jang <gichan2.jang@samsung.com>
18 months ago[Service] functions for transaction
Jaeyun Jung [Thu, 4 May 2023 07:06:12 +0000 (16:06 +0900)]
[Service] functions for transaction

Code clean, add internal util function for DB transaction.

Signed-off-by: Jaeyun Jung <jy1210.jung@samsung.com>
18 months ago[Service] logutil in service-db
Jaeyun Jung [Thu, 4 May 2023 04:40:09 +0000 (13:40 +0900)]
[Service] logutil in service-db

Code clean, use common logutil in service-db.

Signed-off-by: Jaeyun Jung <jy1210.jung@samsung.com>
18 months ago[Build/Service] fix indent
Jaeyun Jung [Thu, 4 May 2023 05:16:33 +0000 (14:16 +0900)]
[Build/Service] fix indent

Fix build error, clang-format of service-db.

Signed-off-by: Jaeyun Jung <jy1210.jung@samsung.com>
18 months ago[Service/Log] printing internal value
Jaeyun Jung [Wed, 3 May 2023 06:24:28 +0000 (15:24 +0900)]
[Service/Log] printing internal value

The ID from pipeline hashtable in daemon is internal value.
This PR hides this internal ID value.

Signed-off-by: Jaeyun Jung <jy1210.jung@samsung.com>
18 months ago[C-Api/CodeClean] remove unnecessary code
Jaeyun Jung [Tue, 2 May 2023 07:28:53 +0000 (16:28 +0900)]
[C-Api/CodeClean] remove unnecessary code

Code clean,
1. fix indent and remove unnecessary lines.
2. replace function to compare pkg type (case-insensitive).

Signed-off-by: Jaeyun Jung <jy1210.jung@samsung.com>
18 months ago[clang-format] line-comment length
Jaeyun Jung [Wed, 3 May 2023 07:29:16 +0000 (16:29 +0900)]
[clang-format] line-comment length

clang-format, ignore line-comment length.

Signed-off-by: Jaeyun Jung <jy1210.jung@samsung.com>
18 months ago[Service] handle invalid version
Jaeyun Jung [Tue, 2 May 2023 04:32:56 +0000 (13:32 +0900)]
[Service] handle invalid version

Raise exception when given version number is 0.

Signed-off-by: Jaeyun Jung <jy1210.jung@samsung.com>
18 months agoFormatting/CC: Apply .clang-format to the C++ source files
Wook Song [Tue, 2 May 2023 05:43:29 +0000 (14:43 +0900)]
Formatting/CC: Apply .clang-format to the C++ source files

This patch applies .clang-format to all of the .cc files, which are
source files written in C++.

find . -name "*.cc" -exec clang-format-15 --style=file:.clang-format {} \;

Signed-off-by: Wook Song <wook16.song@samsung.com>
18 months ago[C-Api] Tizen API guide
Jaeyun Jung [Tue, 2 May 2023 07:13:26 +0000 (16:13 +0900)]
[C-Api] Tizen API guide

Update API description, fix design guide.

Signed-off-by: Jaeyun Jung <jy1210.jung@samsung.com>
18 months agoAPI/C: Add the missing header to the pipeline-internal header file
Wook Song [Tue, 2 May 2023 05:54:42 +0000 (14:54 +0900)]
API/C: Add the missing header to the pipeline-internal header file

This patch adds a missing internal header, 'nnstreamer.h', which defines
data structures and types required by the
'ml-api-inference-pipeline-internal.h' file.

Signed-off-by: Wook Song <wook16.song@samsung.com>
18 months agoTests: Add test cases for gdbus-util
Wook Song [Tue, 2 May 2023 04:17:32 +0000 (13:17 +0900)]
Tests: Add test cases for gdbus-util

This patch adds unit test cases for the helper functions in the
gdbus-util.c file.

Signed-off-by: Wook Song <wook16.song@samsung.com>
18 months ago[test] Add a negative testcase for ml_service_launch_pipeline
Yongjoo Ahn [Tue, 2 May 2023 04:06:00 +0000 (13:06 +0900)]
[test] Add a negative testcase for ml_service_launch_pipeline

- Add an erroneous pipeline launch case with invalid tensor_filter

Signed-off-by: Yongjoo Ahn <yongjoo1.ahn@samsung.com>
18 months ago[Service] invalid table schema
Jaeyun Jung [Tue, 2 May 2023 03:33:45 +0000 (12:33 +0900)]
[Service] invalid table schema

Fix invalid table schema and cleanup service-db test.

Signed-off-by: Jaeyun Jung <jy1210.jung@samsung.com>
18 months ago[C-Api/CodeClean] remove duplicated code
Jaeyun Jung [Tue, 2 May 2023 03:27:16 +0000 (12:27 +0900)]
[C-Api/CodeClean] remove duplicated code

Code clean, remove duplicated code.

Signed-off-by: Jaeyun Jung <jy1210.jung@samsung.com>
18 months ago[CodeClean] Change variable name accepted/tizen/unified/20230503.024142
Yongjoo Ahn [Fri, 28 Apr 2023 02:26:39 +0000 (11:26 +0900)]
[CodeClean] Change variable name

- Change variable name not to hide the parameter of cb

Signed-off-by: Yongjoo Ahn <yongjoo1.ahn@samsung.com>
18 months ago[CodeClean] Fix memleak of pkg_info
Yongjoo Ahn [Fri, 28 Apr 2023 02:25:47 +0000 (11:25 +0900)]
[CodeClean] Fix memleak of pkg_info

- Free pkg_info handle when the callback is returned

Signed-off-by: Yongjoo Ahn <yongjoo1.ahn@samsung.com>
18 months ago[TEST] Set `is-updatable` prop of single test
gichan [Thu, 27 Apr 2023 05:51:43 +0000 (14:51 +0900)]
[TEST] Set `is-updatable` prop of single test

Set `is-updatable` prop of single test
 *line coverage: 80.1%

Signed-off-by: gichan <gichan2.jang@samsung.com>
18 months ago[build] Add missing errno.h in ml-agent-dbus-interface.c
Yongjoo Ahn [Thu, 27 Apr 2023 04:42:10 +0000 (13:42 +0900)]
[build] Add missing errno.h in ml-agent-dbus-interface.c

- Add missing header <errno.h> to the source file.

Signed-off-by: Yongjoo Ahn <yongjoo1.ahn@samsung.com>
18 months agoMeson/LCOV: Apply a workaround to increase lcov of 'service-db.cc'
Wook Song [Tue, 25 Apr 2023 12:25:08 +0000 (21:25 +0900)]
Meson/LCOV: Apply a workaround to increase lcov of 'service-db.cc'

This patch applies a simple workaround to increase the line coverage of
the 'service-db.cc' file.

Signed-off-by: Wook Song <wook16.song@samsung.com>
18 months agoMLAgent: Introduce libml-agentd
Wook Song [Fri, 14 Apr 2023 06:57:08 +0000 (15:57 +0900)]
MLAgent: Introduce libml-agentd

This patch defines APIs of the ML Agent Daemon whose backend is GDBus
and exports them to the outer space of the daemon so that the tightly
coupled dependency between the libcapi-ml-service and daemon is
eliminated.

Signed-off-by: Wook Song <wook16.song@samsung.com>
18 months ago[Test] remove unnecessary test
Jaeyun Jung [Tue, 25 Apr 2023 03:48:45 +0000 (12:48 +0900)]
[Test] remove unnecessary test

Code clean, remove empty testcase.

Signed-off-by: Jaeyun Jung <jy1210.jung@samsung.com>
18 months ago[Test/Meson] common dependency
Jaeyun Jung [Tue, 25 Apr 2023 03:41:00 +0000 (12:41 +0900)]
[Test/Meson] common dependency

Use predefined dependencies in meson script.

Signed-off-by: Jaeyun Jung <jy1210.jung@samsung.com>
18 months ago[Meson] dependency to tizen pkgs
Jaeyun Jung [Mon, 24 Apr 2023 10:54:19 +0000 (19:54 +0900)]
[Meson] dependency to tizen pkgs

Code clean, define dependencies to tizen packages.

Signed-off-by: Jaeyun Jung <jy1210.jung@samsung.com>
18 months ago[Build] error ml-svc on ubuntu
Jaeyun Jung [Mon, 24 Apr 2023 08:35:49 +0000 (17:35 +0900)]
[Build] error ml-svc on ubuntu

Fix error when building ml-svc on ubuntu.

Signed-off-by: Jaeyun Jung <jy1210.jung@samsung.com>
18 months agoTizen] Exclude test files for SAM
gichan [Mon, 24 Apr 2023 05:51:25 +0000 (14:51 +0900)]
Tizen] Exclude test files for SAM

Exclude test files for SAM

Signed-off-by: gichan <gichan2.jang@samsung.com>
18 months ago[C-API] revert fill dimension 1 accepted/tizen/unified/20230424.185349 accepted/tizen/unified/20230428.155128
Yelin Jeong [Fri, 21 Apr 2023 02:00:17 +0000 (11:00 +0900)]
[C-API] revert fill dimension 1

This patch reverts fill dimension to default value 1.
In C# API, interop function ml_tensors_info_get_tensor_dimension
is used with length 4 dimension array instead of 16.

Signed-off-by: Yelin Jeong <yelini.jeong@samsung.com>
18 months agoDaemon/PkgMrg: Eliminate duplicate code blocks
Wook Song [Thu, 20 Apr 2023 05:43:24 +0000 (14:43 +0900)]
Daemon/PkgMrg: Eliminate duplicate code blocks

This is a trivial patch for the elimination of the duplicate code
blocks.

Signed-off-by: Wook Song <wook16.song@samsung.com>
18 months agoTests/PkgMgr: Add functions for emulation of Tizen's Pkg Manager APIs
Wook Song [Thu, 20 Apr 2023 04:56:17 +0000 (13:56 +0900)]
Tests/PkgMgr: Add functions for emulation of Tizen's Pkg Manager APIs

This patch adds helper functions for the emulation of Tizen's Package
Manager APIs and utilities for unit test cases of ML Agent Service APIs.

Signed-off-by: Wook Song <wook16.song@samsung.com>
18 months ago[CodeClean] Fix memleak in pkgmgr
Yongjoo Ahn [Fri, 21 Apr 2023 01:32:52 +0000 (10:32 +0900)]
[CodeClean] Fix memleak in pkgmgr

- Use g_autofree gchar to prevent memleak;

Signed-off-by: Yongjoo Ahn <yongjoo1.ahn@samsung.com>
18 months ago[build] Add empty build dep for tizen appfw for local build/test
Yongjoo Ahn [Thu, 20 Apr 2023 03:11:03 +0000 (12:11 +0900)]
[build] Add empty build dep for tizen appfw for local build/test

- Add an empty build dep for tizen appfw, used by servce API

Signed-off-by: Yongjoo Ahn <yongjoo1.ahn@samsung.com>
18 months ago[pkgmgr] Parse rpk's "model_description.json" to fill app_info and register
Yongjoo Ahn [Mon, 17 Apr 2023 06:39:28 +0000 (15:39 +0900)]
[pkgmgr] Parse rpk's "model_description.json" to fill app_info and register

- When rpk is installed, parse the provided model_description.json file
  and register models described in the json.

TODO: Handle when the rpk package is removed or updated.

Signed-off-by: Yongjoo Ahn <yongjoo1.ahn@samsung.com>
18 months ago[service] Check and parse app_info of tizen application (the caller)
Yongjoo Ahn [Mon, 17 Apr 2023 06:13:23 +0000 (15:13 +0900)]
[service] Check and parse app_info of tizen application (the caller)

In a Tizen application context,
`ml_service_model_register` fill app_info column. RPK cannot call this
API, so the value of key `is_rpk` is always false.

`ml_service_model_get*` APIs should parse the app_info and update the
path in case of models from 'RPK'.

Signed-off-by: Yongjoo Ahn <yongjoo1.ahn@samsung.com>
18 months agoTests/Dbus: Move DBus-related files to the tests/dbus directory
Wook Song [Wed, 19 Apr 2023 02:47:55 +0000 (11:47 +0900)]
Tests/Dbus: Move DBus-related files to the tests/dbus directory

This patch relocates the dbus interface for the unit tests to the tests
directory. According to the changes, the meson build files are alse
updated as well.

Signed-off-by: Wook Song <wook16.song@samsung.com>
18 months ago[service] Add "app_info" column to the model DB
Yongjoo Ahn [Mon, 17 Apr 2023 06:05:17 +0000 (15:05 +0900)]
[service] Add "app_info" column to the model DB

- Add a new column "app_info" to the service DB's tblModel table.
- This app_info is a json string consists of tizen application
  information which owns model.

Signed-off-by: Yongjoo Ahn <yongjoo1.ahn@samsung.com>
18 months agoTests/Meson: Revise meson build scripts in tests
Wook Song [Wed, 19 Apr 2023 04:16:09 +0000 (13:16 +0900)]
Tests/Meson: Revise meson build scripts in tests

This patch revises the meson build scripts related to the test
sub-directory.

Signed-off-by: Wook Song <wook16.song@samsung.com>
18 months ago[C-API] Fix set tensor dimension order
Yelin Jeong [Tue, 11 Apr 2023 10:46:43 +0000 (19:46 +0900)]
[C-API] Fix set tensor dimension order

This patch fixes the order of ml_tensors_info_set_tensor_dimension.
If tensors_info is not extended, user may regard dimension array's length to 4.

Signed-off-by: Yelin Jeong <yelini.jeong@samsung.com>
18 months ago[agent] Change tizen log functions of ml-agent
Yongjoo Ahn [Mon, 17 Apr 2023 06:46:19 +0000 (15:46 +0900)]
[agent] Change tizen log functions of ml-agent

- Let ml-agent logs be more verbose in Tizen.

Signed-off-by: Yongjoo Ahn <yongjoo1.ahn@samsung.com>
18 months ago[C-Api] Revert fill dim (default 1) commit accepted/tizen/unified/20230413.123715
Sangjung Woo [Thu, 13 Apr 2023 00:15:22 +0000 (09:15 +0900)]
[C-Api] Revert fill dim (default 1) commit

Because of native TC failure, this patch reverts the fill dim (default
1) commit.

Signed-off-by: Sangjung Woo <sangjung.woo@samsung.com>
19 months ago[C-Api] fill dim (default 1)
Jaeyun Jung [Fri, 7 Apr 2023 07:50:33 +0000 (16:50 +0900)]
[C-Api] fill dim (default 1)

When calling get-dimension(), fill remained dim - default dim is 1.

Signed-off-by: Jaeyun Jung <jy1210.jung@samsung.com>
19 months ago[Test] add tests to increase ML_TENSOR_RANK_LIMIT
Yelin Jeong [Thu, 23 Mar 2023 04:56:33 +0000 (13:56 +0900)]
[Test] add tests to increase ML_TENSOR_RANK_LIMIT

This patch adds some TCs for increased ML_TENSOR_RANK_LIMIT.

Signed-off-by: Yelin Jeong <yelini.jeong@samsung.com>
19 months ago[C-API] Increase ML_TENSOR_RANK_LIMIT
Yelin Jeong [Thu, 23 Mar 2023 04:55:19 +0000 (13:55 +0900)]
[C-API] Increase ML_TENSOR_RANK_LIMIT

This patch increases ML_TENSOR_RANK_LIMIT from 4 to 16.

Signed-off-by: Yelin Jeong <yelini.jeong@samsung.com>
19 months ago[CodeClean] fix indent
Jaeyun Jung [Tue, 4 Apr 2023 10:22:30 +0000 (19:22 +0900)]
[CodeClean] fix indent

Trivial, fix indent and init null to global val.

Signed-off-by: Jaeyun Jung <jy1210.jung@samsung.com>
19 months ago[Single] Add input and output ranks
Yelin Jeong [Fri, 31 Mar 2023 08:14:19 +0000 (17:14 +0900)]
[Single] Add input and output ranks

This patch adds input and output ranks to ml_single.
Input and output ranks are used when user explicitly sets rank property.

Signed-off-by: Yelin Jeong <yelini.jeong@samsung.com>
19 months ago[Service] init handle id
Jaeyun Jung [Mon, 3 Apr 2023 02:35:15 +0000 (11:35 +0900)]
[Service] init handle id

Init-zero to connect the signals of model-dbus.

Signed-off-by: Jaeyun Jung <jy1210.jung@samsung.com>
19 months ago[Service] common log util
Jaeyun Jung [Mon, 3 Apr 2023 02:37:43 +0000 (11:37 +0900)]
[Service] common log util

Use common log util in model-dbus impl.

Signed-off-by: Jaeyun Jung <jy1210.jung@samsung.com>
19 months agoMeson/LCOV: Fix wrong code coverage ratio for ml-agent sources
Wook Song [Thu, 30 Mar 2023 05:05:20 +0000 (14:05 +0900)]
Meson/LCOV: Fix wrong code coverage ratio for ml-agent sources

The changes in 2b1df86 make two sets of object files for the
'machine-learning-agent' and 'machine-learning-agent-test' executables,
which leads to the wrong code coverage ratio for the ml-agent daemon
source files. This patch fixes it.

Signed-off-by: Wook Song <wook16.song@samsung.com>
19 months ago[CodeClean] Remove unnecessary code in service api test
Yongjoo Ahn [Wed, 29 Mar 2023 08:50:54 +0000 (17:50 +0900)]
[CodeClean] Remove unnecessary code in service api test

- Remove some unused code.

Signed-off-by: Yongjoo Ahn <yongjoo1.ahn@samsung.com>
19 months ago[agent] Remove unused exceptions
Yongjoo Ahn [Wed, 29 Mar 2023 08:39:52 +0000 (17:39 +0900)]
[agent] Remove unused exceptions

- Let std::exception catch those runtime errors.

Signed-off-by: Yongjoo Ahn <yongjoo1.ahn@samsung.com>
19 months ago[CodeClean] Remove pipeline module related code from gdbus-util
Yongjoo Ahn [Wed, 29 Mar 2023 08:37:42 +0000 (17:37 +0900)]
[CodeClean] Remove pipeline module related code from gdbus-util

- Move pipeline related code in gdbus-util to proper src.
- Adjust function names to the model-impl.

Signed-off-by: Yongjoo Ahn <yongjoo1.ahn@samsung.com>
19 months ago[test] Add some negative test for ml-agent
Yongjoo Ahn [Wed, 29 Mar 2023 08:52:27 +0000 (17:52 +0900)]
[test] Add some negative test for ml-agent

- Add some negative test for ml-agent.

Signed-off-by: Yongjoo Ahn <yongjoo1.ahn@samsung.com>
19 months agoMeson: Add a missing build dependency, 'nnstreamer-internal'
Wook Song [Wed, 29 Mar 2023 02:47:00 +0000 (11:47 +0900)]
Meson: Add a missing build dependency, 'nnstreamer-internal'

This patch fixes build errors because of a missing header file,
'nnstreamer_internal.h', which should be included in the build
dependencies by meson.

Signed-off-by: Wook Song <wook16.song@samsung.com>
19 months ago[test] Add unittest for service DB
Yongjoo Ahn [Tue, 21 Mar 2023 06:59:58 +0000 (15:59 +0900)]
[test] Add unittest for service DB

- Add negative testcases for service DB.

Signed-off-by: Yongjoo Ahn <yongjoo1.ahn@samsung.com>
19 months ago[agent/DB] Prevent sql injection by using `sqlite3_bind_text`
Yongjoo Ahn [Wed, 22 Mar 2023 08:14:04 +0000 (17:14 +0900)]
[agent/DB] Prevent sql injection by using `sqlite3_bind_text`

- Use `sqlite3_bind_text` instead of formatted string to prevent sql
  injection attack.

Signed-off-by: Yongjoo Ahn <yongjoo1.ahn@samsung.com>
19 months ago[Build/Test] daemon for unittest
Jaeyun Jung [Mon, 27 Mar 2023 09:33:49 +0000 (18:33 +0900)]
[Build/Test] daemon for unittest

Cleanup build script, move test-daemon into 'tests' dir and fix file names.

Signed-off-by: Jaeyun Jung <jy1210.jung@samsung.com>
19 months ago[Service] do not free handle in error case
Jaeyun Jung [Fri, 24 Mar 2023 07:42:08 +0000 (16:42 +0900)]
[Service] do not free handle in error case

If called service-destroy function, do not free allocated handle if an error from dbus or database is raised.

Signed-off-by: Jaeyun Jung <jy1210.jung@samsung.com>
19 months ago[Build/Android] temporal block flatbuffer
Jaeyun Jung [Mon, 27 Mar 2023 05:58:15 +0000 (14:58 +0900)]
[Build/Android] temporal block flatbuffer

Fix error, temporal block flatbuffer when building android library.

Signed-off-by: Jaeyun Jung <jy1210.jung@samsung.com>
19 months ago[test] Add negative tests for service APIs
Yongjoo Ahn [Fri, 24 Mar 2023 02:01:42 +0000 (11:01 +0900)]
[test] Add negative tests for service APIs

- Add negative TC with DBUS unconnected.

Signed-off-by: Yongjoo Ahn <yongjoo1.ahn@samsung.com>