platform/core/api/machine-learning.git
8 months ago[Common/CodeClean] struct for tensor memories
Jaeyun Jung [Mon, 20 Nov 2023 12:59:27 +0000 (21:59 +0900)]
[Common/CodeClean] struct for tensor memories

Code clean, use GstTensorMemory struct defined in nnstreamer.

Signed-off-by: Jaeyun Jung <jy1210.jung@samsung.com>
8 months ago[C-Api/Single] create in/out handle in single-shot
Jaeyun Jung [Thu, 16 Nov 2023 11:30:38 +0000 (20:30 +0900)]
[C-Api/Single] create in/out handle in single-shot

Use gst-info and create handle inside of single-shot instance.
Referencing struct does not initialize lock and other variables.

Signed-off-by: Jaeyun Jung <jy1210.jung@samsung.com>
8 months ago[C-Api/Pipeline] create handle before calling sink callback
Jaeyun Jung [Tue, 14 Nov 2023 08:00:53 +0000 (17:00 +0900)]
[C-Api/Pipeline] create handle before calling sink callback

1. Create tensors-info handle before calling sink callback.
2. We do not need to use ml-info in pipeline elem struct. Use gst-info instead.

Signed-off-by: Jaeyun Jung <jy1210.jung@samsung.com>
8 months ago[C-Api/Pipeline] remove total size
Jaeyun Jung [Wed, 15 Nov 2023 07:45:40 +0000 (16:45 +0900)]
[C-Api/Pipeline] remove total size

We do not use total size of tensors.
Remove unnecessary variable for total data size.

Signed-off-by: Jaeyun Jung <jy1210.jung@samsung.com>
8 months ago[CodeClean] fix indent
Jaeyun Jung [Fri, 17 Nov 2023 09:57:16 +0000 (18:57 +0900)]
[CodeClean] fix indent

Code clean, fix indent and remove unnecessary space.

Signed-off-by: Jaeyun Jung <jy1210.jung@samsung.com>
8 months ago[Service] parse json for database update
Jaeyun Jung [Thu, 9 Nov 2023 06:48:47 +0000 (15:48 +0900)]
[Service] parse json for database update

Parse json file and update model/pipeline/resource data when installing res-pkg.

Signed-off-by: Jaeyun Jung <jy1210.jung@samsung.com>
8 months ago[Util] extended dim of 0-initialized
Jaeyun Jung [Thu, 16 Nov 2023 12:27:41 +0000 (21:27 +0900)]
[Util] extended dim of 0-initialized

We implemented 0-init dimension in nnstreamer.
If dim value at index of old rank limit (4) is not 0, it is extended.

Signed-off-by: Jaeyun Jung <jy1210.jung@samsung.com>
8 months ago[ml-remote-service] Add service event cb
gichan2-jang [Fri, 13 Oct 2023 08:31:54 +0000 (17:31 +0900)]
[ml-remote-service] Add service event cb

Add remote service event callback

Signed-off-by: gichan2-jang <gichan2.jang@samsung.com>
8 months ago[C-Api/Single] remove rank list
Jaeyun Jung [Wed, 15 Nov 2023 06:34:45 +0000 (15:34 +0900)]
[C-Api/Single] remove rank list

We implemented 0-initialized dimension in nnstreamer.
Remove unnecessary rank list from single handle.

Signed-off-by: Jaeyun Jung <jy1210.jung@samsung.com>
8 months ago[CodeClean] fix indent
Jaeyun Jung [Wed, 15 Nov 2023 05:55:24 +0000 (14:55 +0900)]
[CodeClean] fix indent

Code clean, fix typo and indent.

Signed-off-by: Jaeyun Jung <jy1210.jung@samsung.com>
8 months ago[Service] active flag from json accepted/tizen/unified/20231110.172149
Jaeyun Jung [Fri, 27 Oct 2023 04:38:51 +0000 (13:38 +0900)]
[Service] active flag from json

1. Update 'activate' flag from json when registering new model info from res-pkg.
2. Allow null description in json, description string is not mandatory field.
3. Fix log message, hide app info string.

Signed-off-by: Jaeyun Jung <jy1210.jung@samsung.com>
9 months ago[ml-service] Set transaction
gichan2-jang [Fri, 13 Oct 2023 07:45:39 +0000 (16:45 +0900)]
[ml-service] Set transaction

There is some timing issue to save the changes in DB,
set trasnsation for INSERT/UPDATE command.

Signed-off-by: gichan2-jang <gichan2.jang@samsung.com>
9 months agoMLAgent: Change the name of ML-Agent
Wook Song [Thu, 12 Oct 2023 04:12:45 +0000 (13:12 +0900)]
MLAgent: Change the name of ML-Agent

This patch changes the name of ML-Agent from ml-agentd to ml-agent.

Signed-off-by: Wook Song <wook16.song@samsung.com>
9 months agoTests/CAPI: Fix trivial sign-compare warnings
Wook Song [Thu, 12 Oct 2023 03:20:45 +0000 (12:20 +0900)]
Tests/CAPI: Fix trivial sign-compare warnings

This is a trivial fix to silence sign-compare warnings in a unit test
case for inference C-APIs

/usr/src/googletest/googletest/include/gtest/gtest.h:1545:11: error: comparison of integer expressions of different signedness: ‘const unsigned int’ and ‘const int’ [-Werror=sign-compare]
1545 |   if (lhs == rhs) {                                                                               |       ~~~~^~~~~~                                                                            cc1plus: all warnings being treated as errors

Signed-off-by: Wook Song <wook16.song@samsung.com>
9 months ago[CodeClean] internal function to release svc handle
Jaeyun Jung [Wed, 4 Oct 2023 09:53:56 +0000 (18:53 +0900)]
[CodeClean] internal function to release svc handle

Prevent error case if nns-edge dependency does not exists.
Add internal function to release ml-svc handle.

Signed-off-by: Jaeyun Jung <jy1210.jung@samsung.com>
9 months ago[C-Api] option to get framework
Jaeyun Jung [Thu, 5 Oct 2023 03:39:25 +0000 (12:39 +0900)]
[C-Api] option to get framework

Add key to get the neural network name from ml-option.

Signed-off-by: Jaeyun Jung <jy1210.jung@samsung.com>
9 months ago[CodeClean] function name
Jaeyun Jung [Wed, 4 Oct 2023 09:18:13 +0000 (18:18 +0900)]
[CodeClean] function name

1. Update ml-remote function name, prefix 'ml_service'.
2. Hide internal enum and struct.

Signed-off-by: Jaeyun Jung <jy1210.jung@samsung.com>
9 months ago[C-Api/Query] use caps property
Jaeyun Jung [Wed, 4 Oct 2023 09:38:46 +0000 (18:38 +0900)]
[C-Api/Query] use caps property

Use 'caps' property in appsrc, not caps-filter.

Signed-off-by: Jaeyun Jung <jy1210.jung@samsung.com>
9 months ago[Doc] add const tag
Jaeyun Jung [Wed, 4 Oct 2023 05:08:48 +0000 (14:08 +0900)]
[Doc] add const tag

Code consistency, add tag in return val field.

Signed-off-by: Jaeyun Jung <jy1210.jung@samsung.com>
10 months ago[Spec] Remove armcl dependency
gichan2-jang [Fri, 22 Sep 2023 01:17:22 +0000 (10:17 +0900)]
[Spec] Remove armcl dependency

Remove armcl dependency when nnfw is enabled.

Signed-off-by: gichan2-jang <gichan2.jang@samsung.com>
10 months ago[test] Add missing deps for service unittests
Yongjoo Ahn [Thu, 21 Sep 2023 06:52:43 +0000 (15:52 +0900)]
[test] Add missing deps for service unittests

- Add service_dep dependency to service related unittests.

Signed-off-by: Yongjoo Ahn <yongjoo1.ahn@samsung.com>
10 months ago[Release] start impl for next release
Jaeyun Jung [Fri, 15 Sep 2023 09:38:29 +0000 (18:38 +0900)]
[Release] start impl for next release

Update version, start implementation for next release.

Signed-off-by: Jaeyun Jung <jy1210.jung@samsung.com>
10 months ago[Coverity] Fix resource leak accepted/tizen/8.0/unified/20231005.092719 accepted/tizen/unified/20230915.160555 tizen_8.0_m2_release
gichan2-jang [Fri, 15 Sep 2023 01:40:12 +0000 (10:40 +0900)]
[Coverity] Fix resource leak

Fix resource leak reported by coverity

Signed-off-by: gichan2-jang <gichan2.jang@samsung.com>
10 months ago[Service] Check return value
gichan2-jang [Tue, 12 Sep 2023 07:38:04 +0000 (16:38 +0900)]
[Service] Check return value

 - Fix unchecked return value.

Signed-off-by: gichan2-jang <gichan2.jang@samsung.com>
10 months ago[Release] update version accepted/tizen/unified/20230912.171644
Jaeyun Jung [Tue, 12 Sep 2023 03:46:16 +0000 (12:46 +0900)]
[Release] update version

Update version to 1.8.4, Tizen 8.0 M2 release.

Signed-off-by: Jaeyun Jung <jy1210.jung@samsung.com>
10 months ago[Build] dependencies to nns-edge and curl
Jaeyun Jung [Tue, 12 Sep 2023 04:52:58 +0000 (13:52 +0900)]
[Build] dependencies to nns-edge and curl

Add feature and enable remote-service when curl and nnstreamer-edge is available.

Signed-off-by: Jaeyun Jung <jy1210.jung@samsung.com>
10 months ago[ml-service] Move remote api to tizen-internal.
gichan2-jang [Thu, 7 Sep 2023 09:22:56 +0000 (18:22 +0900)]
[ml-service] Move remote api to tizen-internal.

Move ml-remote-service api to tizen-internal.
They are expreimental API.

Signed-off-by: gichan2-jang <gichan2.jang@samsung.com>
10 months ago[Services] Remote model register
gichan2-jang [Fri, 30 Jun 2023 08:04:22 +0000 (17:04 +0900)]
[Services] Remote model register

 - Impelent registering model relotely
 - Add unit test

Signed-off-by: gichan2-jang <gichan2.jang@samsung.com>
10 months ago[Coverity] Use snprintf instead of sprintf
gichan2-jang [Mon, 11 Sep 2023 07:54:19 +0000 (16:54 +0900)]
[Coverity] Use snprintf instead of sprintf

Let's use safer form of the sprintf() function.

Signed-off-by: gichan2-jang <gichan2.jang@samsung.com>
10 months ago[Tizen] disable nns-edge on TV profile.
gichan2-jang [Fri, 8 Sep 2023 07:28:52 +0000 (16:28 +0900)]
[Tizen] disable nns-edge on TV profile.

Disable nnstreamer-edge on TV profile.

Signed-off-by: gichan2-jang <gichan2.jang@samsung.com>
10 months ago[Test] cleanup testcases
Jaeyun Jung [Fri, 8 Sep 2023 02:44:10 +0000 (11:44 +0900)]
[Test] cleanup testcases

Code clean and fix error case, now rank limit of nnstreamer is changed to 16.

Signed-off-by: Jaeyun Jung <jy1210.jung@samsung.com>
10 months ago[Service] Register pipeline description accepted/tizen/unified/20230907.175337
gichan2-jang [Thu, 25 May 2023 06:43:31 +0000 (15:43 +0900)]
[Service] Register pipeline description

 - Register pipeline description
 - Add unittest to register pipeline

Signed-off-by: gichan2-jang <gichan2.jang@samsung.com>
10 months ago[Service] Add remote service register function
gichan [Wed, 3 May 2023 07:50:30 +0000 (16:50 +0900)]
[Service] Add remote service register function

Add the function that registers remote service such as NN models,
pipeline description and etc.

Signed-off-by: gichan <gichan2.jang@samsung.com>
Signed-off-by: gichan2-jang <gichan2.jang@samsung.com>
10 months ago[Build] name of manifest file
Jaeyun Jung [Mon, 4 Sep 2023 05:08:27 +0000 (14:08 +0900)]
[Build] name of manifest file

Change manifest file name, common machine-learning api.

Signed-off-by: Jaeyun Jung <jy1210.jung@samsung.com>
10 months ago[GCOV] Fix test failure of ml-agent test on RPI
gichan2-jang [Wed, 30 Aug 2023 06:31:29 +0000 (15:31 +0900)]
[GCOV] Fix test failure of ml-agent test on RPI

 - Let's use system bus when we run installed tests on the tizen device.
 - If gcov is activated, pass the tests from gbs.

Signed-off-by: gichan2-jang <gichan2.jang@samsung.com>
10 months ago[C-API] Bugfix for ml_pipeline_element_get_handle accepted/tizen/unified/20230830.170550
hyunil park [Mon, 28 Aug 2023 03:06:46 +0000 (12:06 +0900)]
[C-API] Bugfix for ml_pipeline_element_get_handle

Need to ref element obtained by iterate_element() and unref it in cleanup_node() for common_elem

- common_elem by ml_pipeline_element_get_handle() need to unref in cleaunup_node() because g_hash_table_lookup assign new memory.
  but normal operation, unref is not necessary, so add ref in iterate_element()
- Now, the element's finalize function is called after ml_pipeline_element_get_handle()

Signed-off-by: hyunil park <hyunil46.park@samsung.com>
11 months ago[Coverity] Fix coverity issue
hyunil park [Fri, 25 Aug 2023 05:42:57 +0000 (14:42 +0900)]
[Coverity] Fix coverity issue

Resource leak occurs after ml_tensor_get_count() failure
- need to free ml_tensors_data_h
- change function call order to fix leak

Signed-off-by: hyunil park <hyunil46.park@samsung.com>
11 months ago[C-Api] type of ml-information handle
Jaeyun Jung [Tue, 8 Aug 2023 02:15:35 +0000 (11:15 +0900)]
[C-Api] type of ml-information handle

Prevent invalid function call.
Add type of ml-information handle and macro to check the handle.

Signed-off-by: Jaeyun Jung <jy1210.jung@samsung.com>
11 months ago[Github Action] Add gbs build for ml-api and nntrainer
gichan2-jang [Thu, 10 Aug 2023 02:26:07 +0000 (11:26 +0900)]
[Github Action] Add gbs build for ml-api and nntrainer

Add gbs build github action for ml-api and nntrainer

Signed-off-by: gichan2-jang <gichan2.jang@samsung.com>
11 months ago[Tests] Update testcases to support 0-init dimension accepted/tizen/unified/20230818.183543
Yelin Jeong [Tue, 13 Jun 2023 09:34:08 +0000 (18:34 +0900)]
[Tests] Update testcases to support 0-init dimension

This patch updates testcases to support dimension,
filled 0 by default.

Signed-off-by: Yelin Jeong <yelini.jeong@samsung.com>
11 months ago[C-API] remove padded value of dimensions (0-init)
Yelin Jeong [Fri, 9 Jun 2023 07:45:29 +0000 (16:45 +0900)]
[C-API] remove padded value of dimensions (0-init)

This patch removes padded value of dimensions.
Dimension in ml_tensor_info_s is 0 by default.

Signed-off-by: Yelin Jeong <yelini.jeong@samsung.com>
11 months ago[CodeClean/Service] parse json in rpk
Jaeyun Jung [Tue, 8 Aug 2023 11:57:06 +0000 (20:57 +0900)]
[CodeClean/Service] parse json in rpk

Code clean, define function to parse json file in rpk, including resource and pipeline update.

Signed-off-by: Jaeyun Jung <jy1210.jung@samsung.com>
11 months ago[C-Api] function to get nth gst-info
Jaeyun Jung [Tue, 8 Aug 2023 12:51:34 +0000 (21:51 +0900)]
[C-Api] function to get nth gst-info

Code clean, update code to get nth gst-info.

Signed-off-by: Jaeyun Jung <jy1210.jung@samsung.com>
11 months ago[C-Api] check index in tensors-info handle
Jaeyun Jung [Tue, 8 Aug 2023 04:34:49 +0000 (13:34 +0900)]
[C-Api] check index in tensors-info handle

Code clean, check index in tensors-info handle and update log message.

Signed-off-by: Jaeyun Jung <jy1210.jung@samsung.com>
11 months ago[Service] update ml-agent interface
Jaeyun Jung [Tue, 8 Aug 2023 06:17:46 +0000 (15:17 +0900)]
[Service] update ml-agent interface

Code refactoring, update the name of ml-agent interface.

Signed-off-by: Jaeyun Jung <jy1210.jung@samsung.com>
11 months ago[Svace] fix svace issue accepted/tizen/unified/20230808.074019
Jaeyun Jung [Fri, 4 Aug 2023 03:10:09 +0000 (12:10 +0900)]
[Svace] fix svace issue

Check null case when getting nth info of ml and gst tensor-info.

Signed-off-by: Jaeyun Jung <jy1210.jung@samsung.com>
11 months ago[CodeClean] delete unnecessary log
Jaeyun Jung [Thu, 3 Aug 2023 12:42:34 +0000 (21:42 +0900)]
[CodeClean] delete unnecessary log

Code clean, fix svace issue. Remove unnecessary log - data type.

Signed-off-by: Jaeyun Jung <jy1210.jung@samsung.com>
11 months ago[Pipeline] element name for tizen media src
Jaeyun Jung [Wed, 2 Aug 2023 05:16:43 +0000 (14:16 +0900)]
[Pipeline] element name for tizen media src

Code clean, get the element name from tizen media config and replace it.

TODO: handle properties for each element.

Signed-off-by: Jaeyun Jung <jy1210.jung@samsung.com>
11 months ago[CodeClean/Service] util to get app-info
Jaeyun Jung [Thu, 3 Aug 2023 09:20:01 +0000 (18:20 +0900)]
[CodeClean/Service] util to get app-info

Code clean, add util to get app-info string and reduce duplicated code.

Signed-off-by: Jaeyun Jung <jy1210.jung@samsung.com>
11 months ago[Service] util to parse app-info
Jaeyun Jung [Tue, 1 Aug 2023 09:21:18 +0000 (18:21 +0900)]
[Service] util to parse app-info

Use common function to parse app-info and update ml-information handle.

Signed-off-by: Jaeyun Jung <jy1210.jung@samsung.com>
11 months ago[Service/Test] valid ml-information handle
Jaeyun Jung [Tue, 1 Aug 2023 06:55:48 +0000 (15:55 +0900)]
[Service/Test] valid ml-information handle

Set valid handle name in testcase - ml-information handle for model and resource API.

Signed-off-by: Jaeyun Jung <jy1210.jung@samsung.com>
11 months ago[CodeClean] missed tag
Jaeyun Jung [Tue, 1 Aug 2023 07:09:17 +0000 (16:09 +0900)]
[CodeClean] missed tag

Code clean, condition to release mem-block and add missed tag.

Signed-off-by: Jaeyun Jung <jy1210.jung@samsung.com>
11 months ago[Service] handle app-info for ml-resource
Jaeyun Jung [Fri, 28 Jul 2023 09:36:34 +0000 (18:36 +0900)]
[Service] handle app-info for ml-resource

Add new field app_info for tizen RPK install case, to manage app-information like model API.

Signed-off-by: Jaeyun Jung <jy1210.jung@samsung.com>
11 months ago[Service/Test] add test about ml-resource
Jaeyun Jung [Mon, 31 Jul 2023 07:11:58 +0000 (16:11 +0900)]
[Service/Test] add test about ml-resource

Update testcase to use ml-resource API.

Signed-off-by: Jaeyun Jung <jy1210.jung@samsung.com>
11 months ago[Service] util to get app info
Jaeyun Jung [Mon, 31 Jul 2023 05:16:49 +0000 (14:16 +0900)]
[Service] util to get app info

Define internal common function to get app info.

TODO:
New field for app info for ml-resource and the funtion adding ml-resource will be udpated.

Signed-off-by: Jaeyun Jung <jy1210.jung@samsung.com>
11 months ago[Common] util to create info-list handle
Jaeyun Jung [Fri, 28 Jul 2023 13:05:32 +0000 (22:05 +0900)]
[Common] util to create info-list handle

Add internal util function to create ml-information-list handle.

TODO:
I will update another PR to cleanup info-list handle in ml-agent.

Signed-off-by: Jaeyun Jung <jy1210.jung@samsung.com>
11 months ago[Service] data from ml-service
Jaeyun Jung [Fri, 28 Jul 2023 04:33:06 +0000 (13:33 +0900)]
[Service] data from ml-service

1. Get resource info with insertion order.
2. We do not neet to export key from service-db.
   Add common json info to get the data from db and hide key from json info.

Signed-off-by: Jaeyun Jung <jy1210.jung@samsung.com>
11 months ago[Service] return val to parse app info
Jaeyun Jung [Mon, 31 Jul 2023 04:52:41 +0000 (13:52 +0900)]
[Service] return val to parse app info

Code clean, return val if failed to parse app-info from json string.

Signed-off-by: Jaeyun Jung <jy1210.jung@samsung.com>
12 months ago[test] Use ml_information for ml_service_model APIs
Yongjoo Ahn [Thu, 13 Jul 2023 09:19:25 +0000 (18:19 +0900)]
[test] Use ml_information for ml_service_model APIs

- Since the signature of the API is changed, fix related test code.
- Add a negative TC for ml_information_list_h

Signed-off-by: Yongjoo Ahn <yongjoo1.ahn@samsung.com>
12 months ago[Service/model] Replace ml_option with ml_information in service/model APIs
Yongjoo Ahn [Thu, 13 Jul 2023 09:16:34 +0000 (18:16 +0900)]
[Service/model] Replace ml_option with ml_information in service/model APIs

- Change service/model APIs to use newly added handle ml_information_h
  and ml_information_list_h

Signed-off-by: Yongjoo Ahn <yongjoo1.ahn@samsung.com>
12 months ago[common] Add ml_information, which is not ml_option
Yongjoo Ahn [Thu, 13 Jul 2023 08:07:57 +0000 (17:07 +0900)]
[common] Add ml_information, which is not ml_option

- Define ml_information_h and ml_information_list_h.
- Add related APIs
ml_information_
 - destroy
 - get
ml_information_list_
 - destroy
 - length
 - get

Signed-off-by: Yongjoo Ahn <yongjoo1.ahn@samsung.com>
12 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>
12 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>
12 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>
12 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>
12 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>
12 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>
12 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>
12 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>
12 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>
12 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>
12 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>
12 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>
12 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>
12 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>
12 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>
12 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>
12 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>
12 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>
12 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>
12 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>
13 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>
13 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>
13 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>
13 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>
13 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>
13 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>
13 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>
13 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>
13 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>
13 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>
13 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>
13 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>
13 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>
13 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>
13 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>
13 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>
13 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>
14 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>
14 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>