platform/core/api/mediavision.git
2 months ago Fix parameter check 93/305793/4 accepted/tizen/unified/20240213.171947 accepted/tizen/unified/x/20240219.013930
Kwanghoon Son [Thu, 8 Feb 2024 01:48:52 +0000 (01:48 +0000)]
 Fix parameter check

[Issue type] Fix

TCT need INVALID_PATH instead of INVALID_PARAMETER

Fixed: 7c71a2aa35c62247032f9ea0f7771badcf1d23a9
Signed-off-by: Kwanghoon Son <k.son@samsung.com>
Change-Id: Ia727988cdabc09092239b5d806905e28662061f8

2 months agoFix parameter check 50/305750/2
Kwanghoon Son [Wed, 7 Feb 2024 07:02:07 +0000 (07:02 +0000)]
Fix parameter check

[Issue type] Fix

TCT need INVALID_DATA instead of INVALID_PARAMETER

Fixed: 7c71a2aa35c62247032f9ea0f7771badcf1d23a9
Change-Id: I5a7155513e51d183ea2f221822262d3e1a65064b
Signed-off-by: Kwanghoon Son <k.son@samsung.com>
2 months agoMerge branch 'tizen_devel' into tizen
Kwanghoon Son [Wed, 7 Feb 2024 04:16:14 +0000 (13:16 +0900)]
Merge branch 'tizen_devel' into tizen

[Version] 0.34.0

Inki Dae (11):
  mv_machine_learning: change Tizen version of task API
  mv_machine_learning: introduce get_result_count API for object
    detection group
  mv_machine_learning: change API version of object detection task group
  test: fix test case for object detection task group
  mv_machine_learning: introduce get_result_count API for image
    classification
  mv_machine_learning: introduce get_result_count API for landmark
    detection
  mv_machine_learning: fix typo of test case name
  mv_machine_learning: introduce get_result_count API for object
    detection 3d
  mv_machine_learning: move frame_number to get_result_count API
  mv_machine_learning: use explicit API name and code cleanup
  deprecate legacy API

Kwanghoon Son (6):
  Fix clang-format
  Skip test when feature key not supported
  mv_barcode: Clean duplicate parameter checker
  mv_barcode: Fix enum name conflict
  Fix NULL check
  mv_barcode: Export zint symbol

Seungbae Shin (3):
  fixup! Fix NULL check
  [draft] mv_inference: refactoring
  mv_machine_learning: fix typo

Vibhav Aggarwal (9):
  mv_machine_learning: rename .c to .cpp
  mv_machine_learning: memory optimization in loading dataset
  mv_machine_learning: merge mv_inference.cpp and mv_inference_open.cpp
  mv_machine_learning: small optimization in FaceRecognition
  mv_machine_learning: fix memory leak in test
  mv_machine_learning: optimize preprocess for ImageClassification
  mv_machine_learning: optimize preprocess for other task groups
  mv_machine_learning: modify ImageClassificationResult
  mv_machine_learning: minor bug fixes

Change-Id: Id1e417b04763922de6895238bfc2bacf12372256

3 months agodeprecate legacy API 77/305477/6
Inki Dae [Fri, 2 Feb 2024 05:20:15 +0000 (14:20 +0900)]
deprecate legacy API

[Issue type] : code deprecate

Deprecate legacy API - non-deep learning based mv_image, mv_face and
mv_surveillance, and deep learning based mv_inference modules.
These API will be replaced with new ones.

Ps. this patch needs ACR(API Change Request)

Changelog v1:
- deprecated defgroup in mediavision_doc.h (from SE team)

Change-Id: Ib124c25ea905d74fe9fc3798c1ba33d0fa98979f
Signed-off-by: Inki Dae <inki.dae@samsung.com>
3 months agomv_machine_learning: use explicit API name and code cleanup 97/305397/8
Inki Dae [Thu, 1 Feb 2024 06:08:33 +0000 (15:08 +0900)]
mv_machine_learning: use explicit API name and code cleanup

[Issue type] : code cleanup

Use explicit result API name for task group API to make it easier for users
to understand what kind of information they will receive from the Task Group
API. In addition, this patch cleans up test code for each task group by
dropping console output and unnecessary parameters from task group API and
its test case code.

Change-Id: I3194c50e3b712640034ccd7437c408fb5a6679ab
Signed-off-by: Inki Dae <inki.dae@samsung.com>
3 months agomv_machine_learning: fix typo 67/305467/2
Seungbae Shin [Fri, 2 Feb 2024 04:19:37 +0000 (13:19 +0900)]
mv_machine_learning: fix typo

Change-Id: I4861a85fcf43385969c86619f79de1b2fb07d1f9

3 months agomv_machine_learning: minor bug fixes 24/305424/3
Vibhav Aggarwal [Thu, 1 Feb 2024 10:36:31 +0000 (19:36 +0900)]
mv_machine_learning: minor bug fixes

[Issue type] bug fix

Use default model name in case no model name is provided.
Also, fix a typo in PostprocessParser.h.

Change-Id: I82abf52e6c3ca582721a69ffabd1745e8b2e8462
Signed-off-by: Vibhav Aggarwal <v.aggarwal@samsung.com>
3 months ago[draft] mv_inference: refactoring 81/304781/10
Seungbae Shin [Mon, 22 Jan 2024 10:50:47 +0000 (19:50 +0900)]
[draft] mv_inference: refactoring

Change-Id: I6a564fc04fd7181853025bd089c58d8e8ec1f369

3 months agomv_machine_learning: modify ImageClassificationResult 96/305296/2
Vibhav Aggarwal [Wed, 31 Jan 2024 04:52:01 +0000 (13:52 +0900)]
mv_machine_learning: modify ImageClassificationResult

[Issue type] code improvement

This patch modifies the ImageClassificationResult struct
to include multiple labels, along with indices and
confidences of each label. This will be useful to
reimplement the legacy APIs using ITask.

Change-Id: Ic57fd77f10f762997b26553843bb43acefb2f114
Signed-off-by: Vibhav Aggarwal <v.aggarwal@samsung.com>
3 months agomv_machine_learning: move frame_number to get_result_count API 23/305223/3
Inki Dae [Tue, 30 Jan 2024 06:38:04 +0000 (15:38 +0900)]
mv_machine_learning: move frame_number to get_result_count API

[Issue type] : parameter change

Move frame_number parameter to get_result_count API because frame_number
depends on input data. The frame_number will be used to check if current
result coresponds to which input data. And minor typo fixup.

Change-Id: I0774c0d18b8fde459dda60f7a42763ab4c672651
Signed-off-by: Inki Dae <inki.dae@samsung.com>
3 months agomv_machine_learning: introduce get_result_count API for object detection 3d 49/305149/6
Inki Dae [Mon, 29 Jan 2024 09:24:41 +0000 (18:24 +0900)]
mv_machine_learning: introduce get_result_count API for object detection 3d

[Issue type] : new feature

Introduce get_result_count API for object detection 3d task group.

In user perspective, this API provides information on how many results exist
so that user can request each result corresponding to a user-given index.
And also, in framework perspective, it provides consistent API behavior -
get_result_count API call updates _current_result of task group by calling
getOutput function of ITask, and other API call returns _current_result
value by calling getOutputCache function of ITask.

get_result_count : return a number of results to detected 3d objectes.
get_point_count : return a number of points to a given 3d object index.
get_points : return x and y positions to a given position index.

And we are enough with these API so so drop existing API.

In addition, this patch cleans up ObjectDetection3d and ObjectDetection3dAdapter
classes by dropping unnecessary code, and getOutput and getOutputCache functions
to Adapter class which was already introduced by other task groups.

Change-Id: I8370bb71fc94cf6109f1fb3e25a9bbee7d39a2bb
Signed-off-by: Inki Dae <inki.dae@samsung.com>
3 months agofixup! Fix NULL check 36/305236/2
Seungbae Shin [Tue, 30 Jan 2024 08:08:04 +0000 (17:08 +0900)]
fixup! Fix NULL check

Fix the following,

warning: suggest explicit braces to avoid ambiguous 'else' [-Wdangling-else]

Change-Id: Ib681859dc0173f35595dbea67848a7d3f817e0e1

3 months agomv_barcode: Export zint symbol 93/304793/7
Kwanghoon Son [Thu, 18 Jan 2024 07:38:36 +0000 (16:38 +0900)]
mv_barcode: Export zint symbol

barcode_generate_{source,image} had a common code but was separated
into completely different codes generateBarcode{ToImage, Mat}.
Also zint symbol copied to mv_source or opencv mat multiple time,
it wasted performance. So just export one symbol and use it

Diagram is,
zint_symbol -> mv_source = mv_barcode_gen_source
            \> opencv mat -> post processing = mv_barcode_gen_image

Needs to merge BarcodeGenerator.h and mv_barcode_generate_open.h later

Change-Id: Ie77a3befd01324ecbc6890f0cda3d33845360678
Signed-off-by: Kwanghoon Son <k.son@samsung.com>
3 months agoFix NULL check 89/305089/1
Kwanghoon Son [Fri, 26 Jan 2024 09:26:54 +0000 (18:26 +0900)]
Fix NULL check

Detect callback message could be null.

WID:62132701 After having been assigned to a NULL value at
mv_barcode_detect_open.cpp:240, pointer '0' is passed as 4th parameter
in call to function 'barcode_detected_cb' at
mv_barcode_detect_open.cpp:240, where it is dereferenced at
test_barcode.cpp:25.

Change-Id: I1f0938300bd39caaadd998ebac9ebc2b5ab39a04
Signed-off-by: Kwanghoon Son <k.son@samsung.com>
3 months agomv_machine_learning: fix typo of test case name 84/305084/1
Inki Dae [Fri, 26 Jan 2024 08:44:12 +0000 (17:44 +0900)]
mv_machine_learning: fix typo of test case name

[Issue type] : bug fix

Change-Id: Ifaa0cf14faea685ab0a4ab6dba604ef435c3164a
Signed-off-by: Inki Dae <inki.dae@samsung.com>
3 months agomv_machine_learning: introduce get_result_count API for landmark detection 83/305083/1
Inki Dae [Fri, 26 Jan 2024 08:42:01 +0000 (17:42 +0900)]
mv_machine_learning: introduce get_result_count API for landmark detection

[Issue type] : new feature

Introduce get_result_count API for landmark detection task group.

In user perspective, this API provides information on how many results exist
so that user can request each result corresponding to a user-given index.
And also, in framework perspective, it provides consistent API behavior -
get_result_count API call updates _current_result of task group by calling
getOutput function of ITask, and get_result API call returns _current_result
value by calling getOutputCache function of ITask.

And we are enough with get_result_count and get_result API so drop existing
get_pos and get_positions API.

Change-Id: Ifabe8e2c50db58e95ae67bf1a5fd54586e8facc1
Signed-off-by: Inki Dae <inki.dae@samsung.com>
3 months agomv_machine_learning: optimize preprocess for other task groups 63/305063/1
Vibhav Aggarwal [Fri, 26 Jan 2024 04:23:21 +0000 (13:23 +0900)]
mv_machine_learning: optimize preprocess for other task groups

[Issue type] code optimization

This patch optimizes the preprocess performance for tasks
other than ImageClassification. This is in continuation
with this patch[1].

[1] https://review.tizen.org/gerrit/c/platform/core/api/mediavision/+/305058

Change-Id: Ibefd5e4e53bc5d91e3b86358d493dd13841a77b8
Signed-off-by: Vibhav Aggarwal <v.aggarwal@samsung.com>
3 months agomv_machine_learning: optimize preprocess for ImageClassification 58/305058/2
Vibhav Aggarwal [Thu, 25 Jan 2024 10:57:27 +0000 (19:57 +0900)]
mv_machine_learning: optimize preprocess for ImageClassification

[Issue type] code optimization

The config information for ImageClassification::_preprocess was
being set on every call to ImageClassification::perform().
However, the config remains same and needs to be set only once.
This patch makes this optimization by introducing
configurePreprocess() function. If this patch gets approved,
all other task groups will be changed similarly.

Change-Id: Ibdae75766d4a68c45737cc424f7ee4b021f3b5bf
Signed-off-by: Vibhav Aggarwal <v.aggarwal@samsung.com>
3 months agomv_machine_learning: introduce get_result_count API for image classification 11/304911/4
Inki Dae [Thu, 25 Jan 2024 08:13:15 +0000 (17:13 +0900)]
mv_machine_learning: introduce get_result_count API for image classification

[Issue type] : new feature

Introduce get_result_count API for image classification task group.

In user perspective, this API provides information on how many results exist
so that user can request each result corresponding to a user-given index.
And also, in framework perspective, it provides consistent API behavior -
get_result_count API call updates _current_result of task group by calling
getOutput function of ITask, and get_result API call returns _current_result
value by calling getOutputCache function of ITask.

And we are enough with get_result_count and get_result API so drop existing
get_label API.

Change-Id: I9c1cb9e855494474af1510bbaf94febbdc57f05e
Signed-off-by: Inki Dae <inki.dae@samsung.com>
3 months agomv_machine_learning: fix memory leak in test 77/304677/7
Vibhav Aggarwal [Tue, 23 Jan 2024 04:47:06 +0000 (13:47 +0900)]
mv_machine_learning: fix memory leak in test

[Issue type] bug fix

Change-Id: I3143991150406be61a2674c1c0c5ecfede14b39e
Signed-off-by: Vibhav Aggarwal <v.aggarwal@samsung.com>
3 months agomv_machine_learning: small optimization in FaceRecognition 76/304676/6
Vibhav Aggarwal [Tue, 23 Jan 2024 04:13:18 +0000 (13:13 +0900)]
mv_machine_learning: small optimization in FaceRecognition

[Issue type] code optimization

Change-Id: I1f2967ddf6137c4eef62fa71ed48ba895b89d90e
Signed-off-by: Vibhav Aggarwal <v.aggarwal@samsung.com>
3 months agotest: fix test case for object detection task group 85/304885/1
Inki Dae [Thu, 25 Jan 2024 06:29:10 +0000 (15:29 +0900)]
test: fix test case for object detection task group

[issue type] : bug fix

Fix test case for object detection task group. In case of using
async API, destroy API can be called prior to exiting from waitforOutputQueue
function of AsyncManager class, and it can return a invalid operation exception.
Therefore, make sure to check the invalid operation exception so that
test case can be existed from user thread loop correctly.

Change-Id: I654a7123d6c88f40e6a17e55c2e374ff6c685017
Signed-off-by: Inki Dae <inki.dae@samsung.com>
3 months agomv_machine_learning: change API version of object detection task group 50/304850/3
Inki Dae [Wed, 24 Jan 2024 09:05:50 +0000 (18:05 +0900)]
mv_machine_learning: change API version of object detection task group

[Issue type] : version change

Object detection task groups are targeted to Tizen 9.0

Change-Id: I1e8a5b2977dc9d55dde6c95b8164c458b29db6ac
Signed-off-by: Inki Dae <inki.dae@samsung.com>
3 months agomv_machine_learning: introduce get_result_count API for object detection group 07/304807/7
Inki Dae [Tue, 23 Jan 2024 09:30:35 +0000 (18:30 +0900)]
mv_machine_learning: introduce get_result_count API for object detection group

[Issue type] : new feature

Introduce get_result_cnt API for object detection task group.

In user perspective, this API provides information on how many results exist
so that user can request each result corresponding to a user-given index.
And also, in framework perspective, it provides consistent API behavior -
get_result_count API call updates _current_result of task group by calling
getOutput function of ITask, and get_result API call returns _current_result
value by calling getOutputCache function of ITask.

And we are enough with get_result_count and get_result API so drop existing
get_label API.

Change-Id: I9e5d593d9a1926c504d1ea51272e404b045a6d6b
Signed-off-by: Inki Dae <inki.dae@samsung.com>
3 months agomv_barcode: Fix enum name conflict 06/304806/3
Kwanghoon Son [Wed, 24 Jan 2024 02:12:06 +0000 (11:12 +0900)]
mv_barcode: Fix enum name conflict

BarcodeType has same name BARCODE_UPCA member which is defined in zint.h
This conflict compile error when include zint.h.
This originally for mapping zint ABI, so changed to it.

Change-Id: If7e808a0b769eb1853494066807d79f78aa8e592
Link: https://github.com/zint/zint/blob/master/backend/zint.h
Signed-off-by: Kwanghoon Son <k.son@samsung.com>
3 months agomv_barcode: Clean duplicate parameter checker 74/304474/9
Kwanghoon Son [Thu, 18 Jan 2024 02:04:04 +0000 (11:04 +0900)]
mv_barcode: Clean duplicate parameter checker

Move check position and rename MEDIA_VISION_CHECK_ERR

Change-Id: I1b911b4ad341bc348ceea01f281209f54bb7ed20
Signed-off-by: Kwanghoon Son <k.son@samsung.com>
3 months agomv_machine_learning: merge mv_inference.cpp and mv_inference_open.cpp 46/304546/3
Vibhav Aggarwal [Fri, 19 Jan 2024 07:20:12 +0000 (16:20 +0900)]
mv_machine_learning: merge mv_inference.cpp and mv_inference_open.cpp

[Issue type] code cleanup

Change-Id: Icda88605c20ab7f764588c14a197a6cc5ed5e67e
Signed-off-by: Vibhav Aggarwal <v.aggarwal@samsung.com>
3 months agoSkip test when feature key not supported
Kwanghoon Son [Fri, 12 Jan 2024 09:09:53 +0000 (18:09 +0900)]
Skip test when feature key not supported

Change-Id: I577788343140913473405b7511620ab2914dac3f
Signed-off-by: Kwanghoon Son <k.son@samsung.com>
3 months agomv_machine_learning: memory optimization in loading dataset
Vibhav Aggarwal [Tue, 9 Jan 2024 12:06:47 +0000 (21:06 +0900)]
mv_machine_learning: memory optimization in loading dataset

[Issue type] code optimization

This patch alters the FaceRecognitionDSM::loadDataSet()
function to minimize memory copy. A small optimization
is also made in addDataSet() function.

Change-Id: I9ac18e38ba3201ff0c122b831904229f524eb4c3
Signed-off-by: Vibhav Aggarwal <v.aggarwal@samsung.com>
3 months agomv_machine_learning: rename .c to .cpp 13/304513/2
Vibhav Aggarwal [Thu, 18 Jan 2024 08:10:53 +0000 (17:10 +0900)]
mv_machine_learning: rename .c to .cpp

[Issue type] code cleanup

Change-Id: Ibb8aa92efc7e598ab29acec870354454c80ca707
Signed-off-by: Vibhav Aggarwal <v.aggarwal@samsung.com>
3 months agomv_machine_learning: change Tizen version of task API 78/304478/1
Inki Dae [Wed, 17 Jan 2024 05:55:19 +0000 (14:55 +0900)]
mv_machine_learning: change Tizen version of task API

[Issue type] : code cleanup

Change Tizen version of task API. New Task API support is targeted to
Tizen 9.0 so update the version information on header files.

Change-Id: I1d3147d41db47d99a52a6fedfe4559e67e9474d0
Signed-off-by: Inki Dae <inki.dae@samsung.com>
3 months agoFix clang-format 10/304410/2
Kwanghoon Son [Wed, 17 Jan 2024 04:26:07 +0000 (13:26 +0900)]
Fix clang-format

Change-Id: If210c34343b4da5080fea5360ae752705dda635e
Signed-off-by: Kwanghoon Son <k.son@samsung.com>
3 months agoMerge branch 'tizen_devel' into tizen accepted/tizen_unified_riscv accepted/tizen/unified/20240117.163249 accepted/tizen/unified/riscv/20240118.054558
Inki Dae [Wed, 17 Jan 2024 04:16:21 +0000 (13:16 +0900)]
Merge branch 'tizen_devel' into tizen

[Version] 0.33.0

Kwanghoon Son (4):
  barcode: Rename c files to cpp
  mv_barcode_gen: Change buffer type to cv::Mat
  Skip test when feature key not supported

Vibhav Aggarwal (2):
  mv_machine_learning: optimize FaceRecognition taskgroup
  mv_machine_learning: make testing more robust

Inki Dae (1):
  mv_machine_learning: rename file names

Change-Id: Id444995d0d733e4bd5c21f8bfa334eb6d4adc4ab
Signed-off-by: Inki Dae <inki.dae@samsung.com>
3 months agomv_machine_learning: rename file names
Inki Dae [Wed, 10 Jan 2024 06:36:35 +0000 (15:36 +0900)]
mv_machine_learning: rename file names

[Issue type] code clean

Rename file names of mv_machine_learning according to Tizen coding style
document.[1]

Below are rules used in this patch,
  - Class module refered by external modules uses "NanespaceClassname.*"
  - Class module used internally uses "Classname.*"
    . If "Classname" is duplicated with other task group then sub directory
  name can be added as a prefix.
  - Non class file referred by external modules uses "namespace_filename.*"
  - Non class file used internally uses "filename.*"
    . If "filename" is duplicated with other task group then sub directory
  name can be added as a prefix.

[1] https://wiki.tizen.org/Native_Platform_Coding_Idiom_and_Style_Guide

Change-Id: I0fe3a95a1b5b88b294e2d00ad1fe489143d6cd7d
Signed-off-by: Inki Dae <inki.dae@samsung.com>
3 months agoSkip test when feature key not supported
Kwanghoon Son [Fri, 12 Jan 2024 09:09:53 +0000 (18:09 +0900)]
Skip test when feature key not supported

Change-Id: I577788343140913473405b7511620ab2914dac3f
Signed-off-by: Kwanghoon Son <k.son@samsung.com>
3 months agomv_barcode_gen: Change buffer type to cv::Mat
Kwanghoon Son [Thu, 4 Jan 2024 06:21:55 +0000 (15:21 +0900)]
mv_barcode_gen: Change buffer type to cv::Mat

[Issue type] refactoring

opencv mat is a type for accurately indicating a buffer.
Also other small refactoring that remove Anonymous namespace
and un-used variable

Change-Id: I28cf707f44080cbfcb9c8b4e55609a59011f5d23
Signed-off-by: Kwanghoon Son <k.son@samsung.com>
3 months agomv_machine_learning: make testing more robust
Vibhav Aggarwal [Mon, 8 Jan 2024 07:07:18 +0000 (16:07 +0900)]
mv_machine_learning: make testing more robust

[Issue type] code improvement

This patch makes the testing more robust by checking
the return value of some native APIs and also fixes
some minor bugs.

Change-Id: I352599b86467ce885e171b4b071a28eb396c2161
Signed-off-by: Vibhav Aggarwal <v.aggarwal@samsung.com>
3 months agobarcode: Rename c files to cpp
Kwanghoon Son [Thu, 4 Jan 2024 06:01:04 +0000 (15:01 +0900)]
barcode: Rename c files to cpp

feature_keys needs to change std::string and this patch is for.
Also barcode_{gen,detect}_open function will be refactoring.

Change-Id: I9eccaec0b117f165c7c02ea294a185b803c97b4b
Signed-off-by: Kwanghoon Son <k.son@samsung.com>
3 months agomv_machine_learning: optimize FaceRecognition taskgroup
Vibhav Aggarwal [Tue, 19 Dec 2023 04:07:18 +0000 (13:07 +0900)]
mv_machine_learning: optimize FaceRecognition taskgroup

[Issue type] code optimization

This patch optimizes the FaceRecognition task in the following way:

Avoiding reloading of model files: The model files after training
were loaded into the inference engine every time inference was
requested. This patch modifies this behaviour to make the
files load only if they were changed (i.e. model was retrained).

Change-Id: Ia7c588e22672b26329e513416f7f177bddbb1da6
Signed-off-by: Vibhav Aggarwal <v.aggarwal@samsung.com>
4 months agomv_machine_learning: fix coverity issues 50/303550/1 accepted/tizen/unified/20240109.155354 accepted/tizen/unified/riscv/20240110.014526
Inki Dae [Tue, 2 Jan 2024 05:40:56 +0000 (14:40 +0900)]
mv_machine_learning: fix coverity issues

[Version] : 0.32.2
[Issue type] : bug fix

Fix coverity issues(AUTO_CAUSES_COPY), CID-1744030, CID-1749945, CID-1750084,
and CID-1750098.

Change-Id: Ib13700a9cfd41957f4a080cd5ca7f35a4e8bc9f2
Signed-off-by: Inki Dae <inki.dae@samsung.com>
4 months agomv_common: fix coverity issues 46/303546/4
Inki Dae [Tue, 2 Jan 2024 05:14:59 +0000 (14:14 +0900)]
mv_common: fix coverity issues

[Version] : 0.32.1
[Issue type] : bug fix

Fix coverity issues(AUTO_CAUSES_COPY), CID-1741334 and CID-1743817.

Change-Id: I72277b828295b331d23f7e7f0d6cbfc9e72c1c4d
Signed-off-by: Inki Dae <inki.dae@samsung.com>
4 months agoMerge branch 'tizen_devel' into tizen
Kwanghoon Son [Wed, 27 Dec 2023 03:23:45 +0000 (12:23 +0900)]
Merge branch 'tizen_devel' into tizen

[Version] 0.32.0

Inki Dae (5):
  mv_machine_learning: drop the use of template type from itask
  mv_machine_learning: add multiple tasks support to
    MachineLearningNative module
  mv_machine_learning: use MachineLearningNative module for other task
    groups
  mv_machine_learning: change feature vector manager for face
    recognition
  mv_machine_learning: pack MachineLearningType.h header file

Kwanghoon Son (3):
  clean up unittest script
  Stop build assessment and testsuite
  gcov: Remove un-used code and exclude case

Vibhav Aggarwal (7):
  mv_machine_learning: drop setInput() function
  mv_machine_learning: fix FaceRecognition paths
  mv_machine_learning: enable FaceRecognition tests
  mv_machine_learning: replace char arrays by std::string
  mv_machine_learning: convert char* to string and change return types
  mv_machine_learning: add virtual destructor
  mv_machine_learning: give input type as template parameter

Change-Id: Ic6cb9576812bdf82573a079cfe5b9aedb831a6ac

4 months agomv_machine_learning: pack MachineLearningType.h header file
Inki Dae [Thu, 21 Dec 2023 04:52:07 +0000 (13:52 +0900)]
mv_machine_learning: pack MachineLearningType.h header file

[Issue type] : bug fix

Pack MachineLearningType.h header file. External plugin modules such as
object detection and image segmentation task groups refer to
the MachineLearningType.h header file.

Change-Id: I5a636ad6dba2df717121f85d19be25dddc85d449
Signed-off-by: Inki Dae <inki.dae@samsung.com>
4 months agomv_machine_learning: change feature vector manager for face recognition
Inki Dae [Mon, 18 Dec 2023 07:58:42 +0000 (16:58 +0900)]
mv_machine_learning: change feature vector manager for face recognition

[Issue type] : code enhancement

Change feature vector manager including some code cleanups for face recognition
task group.

With this patch, the header data of the feature vector is now stored at the
beginning of the feature vector file, while the feature vector data is stored
at the end of the file. This change makes it easier to manage feature vectors
without having to worry about moving the file pointer.
In the previous version, the header data was stored at the end of the file,
and the feature vector data was stored at the beginning of the file.

Additionally, this patch skips an unnecessary process in the deleteLabel
function and cleans up the existing code.

Change-Id: I9ef2c0f5603788ea1907002bacf25d9f4fba68ed
Signed-off-by: Inki Dae <inki.dae@samsung.com>
4 months agogcov: Remove un-used code and exclude case
Kwanghoon Son [Wed, 20 Dec 2023 04:19:09 +0000 (13:19 +0900)]
gcov: Remove un-used code and exclude case

Change-Id: Ica4496ab1e8102bd8b60e7d1b9cc468d586d427f
Signed-off-by: Kwanghoon Son <k.son@samsung.com>
4 months agoStop build assessment and testsuite
Kwanghoon Son [Tue, 19 Dec 2023 02:18:32 +0000 (11:18 +0900)]
Stop build assessment and testsuite

Assessment and testsuite tests before mv_test are rarely maintained because
they are not used well and not measured during coverage.
If want to run another case, must integrate it into mv_test.

Change-Id: Idf007f7d4b1c2ea53897e78daeef1eed0b764579
Signed-off-by: Kwanghoon Son <k.son@samsung.com>
4 months agomv_machine_learning: use MachineLearningNative module for other task groups
Inki Dae [Wed, 13 Dec 2023 07:52:23 +0000 (16:52 +0900)]
mv_machine_learning: use MachineLearningNative module for other task groups

[Issue type] : code cleanup

Use MachineLearningNative module for image segmentation and object detection
3d task groups to drop code duplication.

Change-Id: Ief662f216143a1463fd01a6a909e96799c07aff1
Signed-off-by: Inki Dae <inki.dae@samsung.com>
4 months agomv_machine_learning: add multiple tasks support to MachineLearningNative module
Inki Dae [Fri, 8 Dec 2023 07:18:03 +0000 (16:18 +0900)]
mv_machine_learning: add multiple tasks support to MachineLearningNative module

[Issue type] : new feature

Add multiple tasks support to MachineLearningNative module. In case of
face recognition task group, two tasks - facenet and face_recognition -
are needed. Therefore, this patch adds a new API,
machine_learning_native_add() which adds a given task object to
the given context, to MachineLearningNative module, changes return type of
machine_learning_native_create() to void * type for API consistency, and
updates other task groups to call this API.

In addition, this patch drops a redundant parameter, task_name, from
machine_learning_native_destroy().

Change-Id: I9c3ca2645dc876a3c7eb31bb9ce0aca56d376ad9
Signed-off-by: Inki Dae <inki.dae@samsung.com>
4 months agoclean up unittest script
Kwanghoon Son [Wed, 13 Dec 2023 04:29:55 +0000 (13:29 +0900)]
clean up unittest script

Change-Id: I46f310cadfe5dca36edaa3b010afc2df5b49a601
Signed-off-by: Kwanghoon Son <k.son@samsung.com>
4 months agomv_machine_learning: give input type as template parameter
Vibhav Aggarwal [Mon, 11 Dec 2023 08:15:07 +0000 (17:15 +0900)]
mv_machine_learning: give input type as template parameter

[Issue type] code refactoring

This patch adds the input type in the template declaration of the
AsyncManager class to drop template from the individual functions.

Change-Id: I37fe087d253383db87eff46e634a688ffba9a83c
Signed-off-by: Vibhav Aggarwal <v.aggarwal@samsung.com>
4 months agomv_machine_learning: add virtual destructor
Vibhav Aggarwal [Mon, 11 Dec 2023 03:55:34 +0000 (12:55 +0900)]
mv_machine_learning: add virtual destructor

[Issue type] code refactoring

This patch adds the virtual destructor in the InputBaseType
and OutputBaseType classes.

Change-Id: I24dac2b279cdf1c3d9c164020acf394755a6de84
Signed-off-by: Vibhav Aggarwal <v.aggarwal@samsung.com>
4 months agomv_machine_learning: convert char* to string and change return types
Vibhav Aggarwal [Mon, 11 Dec 2023 03:40:40 +0000 (12:40 +0900)]
mv_machine_learning: convert char* to string and change return types

[Issue type] code refactoring

This patch changes the char arrays to std::string and also
changes the return type of getXYZ() functions from void to
the type of data they return.

Change-Id: I2e6a1998b148721f4f868b23d144d24c7c09bf78
Signed-off-by: Vibhav Aggarwal <v.aggarwal@samsung.com>
4 months agomv_machine_learning: replace char arrays by std::string
Vibhav Aggarwal [Tue, 5 Dec 2023 06:25:26 +0000 (15:25 +0900)]
mv_machine_learning: replace char arrays by std::string

[Issue type] code refactoring

This patch is the first step in refactoring the
mv_machine_learning module to replace char* by std::string.
The refactoring will take place in a bottom-up fashion-
meaning that the individual task group classes will be refactored
first, and finally, the ITask class will be modified along with
all the adapter classes. This patch applies this change to the
ImageClassification task group.

Change-Id: If74f788758e2744bb9f1b27c6c607fbb41813512
Signed-off-by: Vibhav Aggarwal <v.aggarwal@samsung.com>
4 months agomv_machine_learning: enable FaceRecognition tests
Vibhav Aggarwal [Mon, 4 Dec 2023 05:11:54 +0000 (14:11 +0900)]
mv_machine_learning: enable FaceRecognition tests

[Issue type] code testing

This patch enables face recognition tests which were
disabled in [1] since the memory leak bug is now
believed to be resolved [2].

[1] https://review.tizen.org/gerrit/#/c/platform/core/api/mediavision/+/301888/
[2] https://review.tizen.org/gerrit/#/c/platform/core/api/mediavision/+/302117/

Change-Id: I3d3184dd71aa8a39b76fc44acd8c74373275b757
Signed-off-by: Vibhav Aggarwal <v.aggarwal@samsung.com>
4 months agomv_machine_learning: fix FaceRecognition paths
Vibhav Aggarwal [Thu, 30 Nov 2023 05:36:03 +0000 (14:36 +0900)]
mv_machine_learning: fix FaceRecognition paths

[Issue type] bug fix

Fix the resource paths used for training and testing FaceRecognition task group.

Change-Id: I660786521ff5dcc56a2c23782d7ee5924774e2eb
Signed-off-by: Vibhav Aggarwal <v.aggarwal@samsung.com>
4 months agomv_machine_learning: drop setInput() function
Vibhav Aggarwal [Thu, 7 Dec 2023 04:27:38 +0000 (13:27 +0900)]
mv_machine_learning: drop setInput() function

[Issue type] code refactoring

This patch drops the setInput() function of the ITask class
and passes the input directly in the perform() function.

Change-Id: I7ba5932f73e33006315fb7a51b581ecafbd50fdd
Signed-off-by: Vibhav Aggarwal <v.aggarwal@samsung.com>
4 months agomv_machine_learning: drop the use of template type from itask
Inki Dae [Tue, 5 Dec 2023 08:53:32 +0000 (17:53 +0900)]
mv_machine_learning: drop the use of template type from itask

[Issue type] : code cleanup

Drop the use of template type from itask and its child classes.
Finally, we have broken the template jail by introducing common
input and output structures, InputBaseType and OutputBaseType.

This patch also includes some updates to the task groups which don't use
MachineLearningNative module yet.

Change-Id: I96abdd94dc715e3f24717e14ad92533c9451f861
Signed-off-by: Inki Dae <inki.dae@samsung.com>
4 months agoUse common feature key checking function 10/302810/4
Vibhav Aggarwal [Thu, 14 Dec 2023 03:52:44 +0000 (12:52 +0900)]
Use common feature key checking function

[Issue type] code refactoring

This patch replaces all the individual feature key checking
functions by a common function mv_check_feature_key().

Change-Id: I7c63131af0d6b481c1ecfd8d859362328fa3657d
Signed-off-by: Vibhav Aggarwal <v.aggarwal@samsung.com>
4 months agomv_machine_learning: add a new feature key checking function 66/301966/4
Inki Dae [Mon, 27 Nov 2023 09:30:17 +0000 (18:30 +0900)]
mv_machine_learning: add a new feature key checking function

[Version] : 0.31.1
[Issue type] : bug fix

Add a new feature key checking function for machine learning based face
recognition API.

In the previous version of face recognition API, we used below key only.
http://tizen.org/feature/vision.inference.face

However, the key is used by face detection and other API - key checking
duplicated. So add a new feature key checking function so that the face
recognition API can check four keys,
- http://tizen.org/feature/vision.inference
- http://tizen.org/feature/vision.training
- http://tizen.org/feature/vision.inference.face_recognition
- http://tizen.org/feature/vision.training.face_recognition

Change-Id: I79ca9465bdec810029298323ea4c11e1ede36dee
Signed-off-by: Inki Dae <inki.dae@samsung.com>
4 months agoFix pthread_mutex_trylock usage 80/302680/4
Kwanghoon Son [Tue, 12 Dec 2023 04:33:24 +0000 (13:33 +0900)]
Fix pthread_mutex_trylock usage

[Issue type] svace

svace warn UNREACHABLE_CODE.EXECUTED_ONCE.
WID:60896000 Loop body cannot be executed more than once

Change-Id: I2ee503bdab93b285e99eca9d23c9548dfec46486
Signed-off-by: Kwanghoon Son <k.son@samsung.com>
4 months agoRemove profile check for supported platform version 01/302601/2
Kwanghoon Son [Mon, 11 Dec 2023 06:19:45 +0000 (15:19 +0900)]
Remove profile check for supported platform version

Change-Id: I1e8abc0037baa1996b31db299744fea61eee4011
Signed-off-by: Kwanghoon Son <k.son@samsung.com>
4 months agoDelete Unreachable code 03/302603/1
Kwanghoon Son [Mon, 11 Dec 2023 06:40:47 +0000 (15:40 +0900)]
Delete Unreachable code

[Issue type] SVACE

Model object already checked and can not be null.

Change-Id: Ie4ce60c6221a8639a1f000966c23f3282b05cad3
Signed-off-by: Kwanghoon Son <k.son@samsung.com>
5 months agoMerge branch 'tizen_devel' into tizen accepted/tizen/unified/20231206.103842 accepted/tizen/unified/20231206.151824 accepted/tizen/unified/riscv/20231211.234031
Kwanghoon Son [Wed, 6 Dec 2023 01:37:12 +0000 (10:37 +0900)]
Merge branch 'tizen_devel' into tizen

[Version] 0.31.0

Inki Dae (8):
  mv_machine_learning: drop input and output type dependency from image
    classification
  mv_machine_learning: introduce config file for external plugin
  mv_machine_learning: use plugin config file for object detection
  mv_machine_learning: introduce MachineLearningNative module
  mv_machine_learning: drop input and output type dependency from
    landmark detection
  mv_machine_learning: drop code duplication from landmark detection
  mv_machine_learning: drop input and output type dependency from object
    detection
  mv_machine_learning: drop code duplication from object detection

Kwanghoon Son (1):
  Drop ml_only flag build

Vibhav Aggarwal (12):
  mv_machine_learning: add template to Adapter::create() function
  mv_machine_learning: convert LandmarkDetection class into template
    class
  mv_machine_learning: convert ImageClassification class into template
    class
  mv_machine_learning: refactor ImageSegmentation task group
  mv_test: integrate machine learning testcases into mv_test
  mv_machine_learning: check value range in FaceRecognition testcase
  mv_machine_learning: bug fix for invalid memory access
  mv_machine_learning: disable tests
  mv_machine_learning: update image path
  mv_machine_learing: enable inference-based tests
  mv_machine_learning: bug fix for memory leak
  mv_machine_learning: add testcase to mv_test

sangho park (2):
  mv_machine_learning: add verifying result data
  mv_machine_learning: improve comparison of selfie-segmentation result

Change-Id: Ibd8f978e8aa874f58131b574a02d63e1cd4e5fc1

5 months agomv_machine_learning: improve comparison of selfie-segmentation result
sangho park [Tue, 5 Dec 2023 06:12:57 +0000 (15:12 +0900)]
mv_machine_learning: improve comparison of selfie-segmentation result

[Issue type] code improvement

Change the judgment criteria from simple binary comparison to ssim

Change-Id: Idef31272464de702a3339674b858d9fe43935150
Signed-off-by: sangho park <sangho.g.park@samsung.com>
5 months agomv_machine_learning: drop code duplication from object detection
Inki Dae [Fri, 1 Dec 2023 08:05:31 +0000 (17:05 +0900)]
mv_machine_learning: drop code duplication from object detection

[Issue type] : code cleanup

Drop code duplication from the object detection task group by making the
this task group use MachineLearningNative module instead of internal code
for context management. In addition, this patch fixes user given model issue
by passing the user given model to each task group correctly.

Change-Id: I15993c841ae9ec5b9b1900089f88295d77b0629c
Signed-off-by: Inki Dae <inki.dae@samsung.com>
5 months agomv_machine_learning: add testcase to mv_test
Vibhav Aggarwal [Thu, 30 Nov 2023 10:49:28 +0000 (19:49 +0900)]
mv_machine_learning: add testcase to mv_test

[Issue type] code improvement

Add the FaceRecognitionAccuracy testcase to mv_test.
It is disabled by default since its execution time is high.

Change-Id: I99e789e7ee8456a5fcc56d2e3d7edd6f4264529b
Signed-off-by: Vibhav Aggarwal <v.aggarwal@samsung.com>
5 months agomv_machine_learning: bug fix for memory leak
Vibhav Aggarwal [Thu, 30 Nov 2023 10:45:40 +0000 (19:45 +0900)]
mv_machine_learning: bug fix for memory leak

[Issue type] bug fix

In SimpleShot::configureModel() function, old model was not
being destroyed before creating the new model. This led to
memory leak detected by ASAN. This patch fixes the issue.

Change-Id: I6a8c3bf3df50c4b1eb39f2e7c94c777b39633323
Signed-off-by: Vibhav Aggarwal <v.aggarwal@samsung.com>
5 months agomv_machine_learning: drop input and output type dependency from object detection
Inki Dae [Thu, 30 Nov 2023 06:34:24 +0000 (15:34 +0900)]
mv_machine_learning: drop input and output type dependency from object detection

[Issue type] : code refactoring

Drop input and output type dependency from object detection task group
by making the input and output types specific to the object detection
task group to be inherited from the common types,
 and then by making adapter class of the object detection task group
to use the common type instead of specific one.

Change-Id: Ie1a397cd8fc05bd507497f04637d606815c5cccc
Signed-off-by: Inki Dae <inki.dae@samsung.com>
5 months agomv_machine_learning: drop code duplication from landmark detection
Inki Dae [Wed, 29 Nov 2023 07:46:28 +0000 (16:46 +0900)]
mv_machine_learning: drop code duplication from landmark detection

[Issue type] : code cleanup

Drop code duplucation from the landmark detection task group by making the
this task group use MachineLearningNative module instead of internal code
for context management.

Change-Id: I990edccfe92cde801e665f9fc43f9f566f33c124
Signed-off-by: Inki Dae <inki.dae@samsung.com>
5 months agomv_machine_learning: drop input and output type dependency from landmark detection
Inki Dae [Wed, 29 Nov 2023 06:19:45 +0000 (15:19 +0900)]
mv_machine_learning: drop input and output type dependency from landmark detection

[Issue type] : code refactoring

Drop input and output type dependency from landmark detection task group
by making the input and output types specific to the landmark detection
task group to be inherited from the common types,
and then by making adapter class of the landmark detection task group
to use the common type instead of specific one.

Change-Id: Ie366cab3919bdbbbf315263188f4ca4f6516cd33
Signed-off-by: Inki Dae <inki.dae@samsung.com>
5 months agoDrop ml_only flag build
Kwanghoon Son [Wed, 29 Nov 2023 06:17:35 +0000 (15:17 +0900)]
Drop ml_only flag build

It was added due to the yocto-based requirements, but it is no longer used.

Change-Id: Ie238e0dc4e8fed18b2a3e2c077c9b2c7ed1007ff
Signed-off-by: Kwanghoon Son <k.son@samsung.com>
5 months agomv_machine_learning: add verifying result data
sangho park [Wed, 22 Nov 2023 23:27:21 +0000 (08:27 +0900)]
mv_machine_learning: add verifying result data

[Issue type] code improvement

verifying result data of selfie-segmentation external plugin
by restoring result data to opencv Mat and storing image file

Change-Id: I13a6f18a9bf8ec45b78fd2ae57f7e33c54c185fc
Signed-off-by: sangho park <sangho.g.park@samsung.com>
5 months agomv_machine_learing: enable inference-based tests
Vibhav Aggarwal [Mon, 27 Nov 2023 09:43:59 +0000 (18:43 +0900)]
mv_machine_learing: enable inference-based tests

[Issue type] code improvement

This patch re-enables some of the testcases which were
disabled in [1]. Specifically, all the machine learning
testcases except Face Recognition and Image Segmentation
task groups have been enabled. For Face Recognition,
there are still some memory leaks related to NNTrainer
and further investigation is required. Image Segmentation
testcases are still under development [2].

[1] https://review.tizen.org/gerrit/#/c/platform/core/api/mediavision/+/301888/
[2] https://review.tizen.org/gerrit/#/c/platform/core/api/mediavision/+/301785/

Change-Id: If97012b42165f210b1f67aaaf4a28e169c16303f
Signed-off-by: Vibhav Aggarwal <v.aggarwal@samsung.com>
5 months agomv_machine_learning: update image path
Vibhav Aggarwal [Tue, 28 Nov 2023 05:11:26 +0000 (14:11 +0900)]
mv_machine_learning: update image path

[Issue type] bug fix

Update the path of sample images used for testing
in the Landmark Detection task group.

Change-Id: Ie0b4d6975a708fc77f2011504ed29a5e05984796
Signed-off-by: Vibhav Aggarwal <v.aggarwal@samsung.com>
5 months agomv_machine_learning: introduce MachineLearningNative module
Inki Dae [Mon, 27 Nov 2023 01:52:12 +0000 (10:52 +0900)]
mv_machine_learning: introduce MachineLearningNative module

[Issue type] : new feature

Introduce MachineLearningNative module which can be used commonly
for all task groups for context management.

This patch allows us to eliminate the duplicated code within each task's native
API implementation module, where the module name begin with the "mv_" prefix.
By consolidating all task management code into the common module
- MachineLearningNative.cpp - and utilizing this module instead of creating
separate implementations in each task's native API module, we can streamline
development and reduce redundancy.

As a starting point, this patch makes the image classification task group
utilize the common module rather than its own internal code.
The goal of this change is to determine whether or not we can offer a unified
interface for all task groups. If successful, this will allow us to apply
the same native module to other task groups as well.

If our initial tests prove successful, we can move forward with implementing
a task manager that utilizes a inference and training pipeline graph approach
to manage individual tasks.

Change-Id: I4cf4f2a06294acae7ac94d3f562958d2ad3d0770
Signed-off-by: Inki Dae <inki.dae@samsung.com>
5 months agomv_machine_learning: use plugin config file for object detection
Inki Dae [Thu, 23 Nov 2023 04:04:45 +0000 (13:04 +0900)]
mv_machine_learning: use plugin config file for object detection

[Issue type] : new feature

Use config files for object detection external plugin by adding
face_detection_plugin.json and object_detection_plugin.json files, parsing
plugin information from the config files, and use the information
according to user desired TASK api - face detection and object detection.

With this patch, external plugin relevant code has no dependency of
the config file for object detection task group. So this patch
checks if external plugin should be used or not based on the plugin flag
value which is loaded from each plugin config file.

In case object detection task group, each task API - face detection and
object detection - supports both model types - FD_TRIV2 and OD_TRIV2 - for
external plugin because the supported external plugin supports both of them
internally. Therefore, the behavior may be changed later according to use
case change.

Change-Id: I2a82000e5d7049bb91a661711dc2cdc3ef37c57c
Signed-off-by: Inki Dae <inki.dae@samsung.com>
5 months agomv_machine_learning: disable tests
Vibhav Aggarwal [Mon, 27 Nov 2023 03:58:06 +0000 (12:58 +0900)]
mv_machine_learning: disable tests

[Issue type] temporary fix

Some memory related bug in mv_machine_learning task
groups is causing the testcases to fail. This came to
notice after machine learning testcases were integrated
into mv_test[1] and the Tizen MMFW bot reported an error
after running the testcases with ASan enabled.

This patch temporarily disables those testcases until
the issue is resolved.

[1] https://review.tizen.org/gerrit/#/c/platform/core/api/mediavision/+/301594/

Change-Id: I4f69c6a2b2eded914a5422696d3af85f3ed0be00
Signed-off-by: Vibhav Aggarwal <v.aggarwal@samsung.com>
5 months agomv_machine_learning: bug fix for invalid memory access
Vibhav Aggarwal [Wed, 22 Nov 2023 03:47:35 +0000 (12:47 +0900)]
mv_machine_learning: bug fix for invalid memory access

[Issue type] bug fix

In the result() function of LandmarkDetection, ObjectDetection
and ObjectDetection3d task groups, the _result struct
was being cleared using memset to set all bytes to 0.
However, the structs include some vectors so this approach
of clearing the struct becomes invalid and resulted in
invalid memory access.

Change-Id: I98ed3e427e77b276145adbf461b3eaca44c752f6
Signed-off-by: Vibhav Aggarwal <v.aggarwal@samsung.com>
5 months agomv_machine_learning: check value range in FaceRecognition testcase
Vibhav Aggarwal [Tue, 21 Nov 2023 06:19:26 +0000 (15:19 +0900)]
mv_machine_learning: check value range in FaceRecognition testcase

[Issue type] code refactoring

In the FaceRecognition.RawResultAfterInferenceShouldBeOk testcase,
check if the output raw values lie inside an acceptable range,
instead of comparing them with the exact value. The exact value
may change based on many factors like the underlying engine version.

Change-Id: Id917bb94716c6dda369dbe8ba4de1bf6311d6e73
Signed-off-by: Vibhav Aggarwal <v.aggarwal@samsung.com>
5 months agomv_test: integrate machine learning testcases into mv_test
Vibhav Aggarwal [Mon, 20 Nov 2023 09:32:12 +0000 (18:32 +0900)]
mv_test: integrate machine learning testcases into mv_test

[Issue type] code refactoring

Change-Id: I881586381c9957d15cf97331c2a44ad52df75847
Signed-off-by: Vibhav Aggarwal <v.aggarwal@samsung.com>
5 months agomv_machine_learning: introduce config file for external plugin
Inki Dae [Tue, 21 Nov 2023 00:38:19 +0000 (09:38 +0900)]
mv_machine_learning: introduce config file for external plugin

[Issue type] : new feature

Introduce a config file for image segmentation external plugin by adding
selfie_segmentation_plugin.json file, parsing plugin information from
the config file, and use the information.

With this patch, external plugin relevant code has no dependency of
the config file for image segmentation task group. So this patch
checks if external plugin should be used or not based on the plugin flag
value which is read from the plugin config file after reading the plugin file
name from the plugin config file.

Change-Id: I126ca1706ce021257c187f76ff54615c3d0be743
Signed-off-by: Inki Dae <inki.dae@samsung.com>
5 months agomv_machine_learning: drop input and output type dependency from image classification
Inki Dae [Wed, 15 Nov 2023 10:31:30 +0000 (19:31 +0900)]
mv_machine_learning: drop input and output type dependency from image classification

[Issue type] : code refactoring

Drop input and output type dependency from image classification task group
by introducing new common input and output types, InputBaseType and
OutputBaseType, which is located in mv_machine_learning/common directory,
and by making the input and output types specific to the image
classification task group to be inherited from the common types,
and then by making adapter class of the image classification task group
to use the common type instead of specific one.

In MachineLearningType.h which is a new common header file,
struct InputBaseType {
...
};

struct OutputBaseType {
...
};

And in image_classification_type.h which is specific to image classification
task group,
struct ImageClassificationInput : public InputBaseType {
...
};

struct ImageClassificationOutput : public OutputBaseType {
...
};

With this, native API implementation - mv_image_classification.c - of the image
classification task group has no any dependency on the file so that we can
make all native implementation portions - the code in the module files starting
with 'mv_' prefix - to use common function in the mv_machine_learning/common
directory. The common function will be introduced soon.

This is a first step to drop the code duplication from the native API
implementation module of the each task group. And it's a time for second phase
since the completion of dropping the meta file dependency from the concrete
class of each task group.

Change-Id: I14764253aeafc36d4e0f39b204b35985b3ecc73a
Signed-off-by: Inki Dae <inki.dae@samsung.com>
5 months agomv_machine_learning: refactor ImageSegmentation task group
Vibhav Aggarwal [Wed, 15 Nov 2023 05:25:38 +0000 (14:25 +0900)]
mv_machine_learning: refactor ImageSegmentation task group

[Issue type] code refactoring

Lift parsing dependency from ImageSegmentation class to
ImageSegmentationAdapter and convert ImageSegmentation
into a template class.

Change-Id: I349ac7ba04f7d0193765e8cb72b6ca1a3fb7830d
Signed-off-by: Vibhav Aggarwal <v.aggarwal@samsung.com>
5 months agomv_machine_learning: convert ImageClassification class into template class
Vibhav Aggarwal [Tue, 14 Nov 2023 11:01:23 +0000 (20:01 +0900)]
mv_machine_learning: convert ImageClassification class into template class

[Issue type] code refactoring

Change-Id: I07a76684aece1773a3ef9dd2b3abbb430dad2394
Signed-off-by: Vibhav Aggarwal <v.aggarwal@samsung.com>
5 months agomv_machine_learning: convert LandmarkDetection class into template class
Vibhav Aggarwal [Tue, 14 Nov 2023 09:39:21 +0000 (18:39 +0900)]
mv_machine_learning: convert LandmarkDetection class into template class

[Issue type] code refactoring

Change-Id: Ib4a040c5a6b97fd19ab3696247e2b9df11ce9ea0
Signed-off-by: Vibhav Aggarwal <v.aggarwal@samsung.com>
5 months agomv_machine_learning: add template to Adapter::create() function
Vibhav Aggarwal [Tue, 14 Nov 2023 05:04:39 +0000 (14:04 +0900)]
mv_machine_learning: add template to Adapter::create() function

[Issue type] code refactoring

Convert the Adapter::create() function into a template function
to avoid nesting of switch cases for data type and task type.
This patch applies this change to ObjectDetection and
ObjectDetection3d task groups.

Change-Id: I1c65f844f8dd6bb646d3806fa898161db3c347e9
Signed-off-by: Vibhav Aggarwal <v.aggarwal@samsung.com>
5 months agoFix wrong input setting 31/302031/2
Kwanghoon Son [Thu, 30 Nov 2023 00:53:30 +0000 (09:53 +0900)]
Fix wrong input setting

[Issue type] bug fix

MobilenetV1 has ASAN bug which is caused from wrong input.

==1368962==AddressSanitizer CHECK failed: ../../../../libsanitizer/asan/asan_allocator.cpp:191 "((old)) == ((kAllocBegMagic))" (0x3f1f9fa03ecececf, 0xcc6e96b9cc6e96b9)
    #0 0x7f823855f4  (/lib64/libasan.so+0xca5f4)
    #1 0x7f823a2a80  (/lib64/libasan.so+0xe7a80)
    #2 0x7f822ecfe8  (/lib64/libasan.so+0x31fe8)
    #3 0x7f822ed8c8  (/lib64/libasan.so+0x328c8)
    #4 0x7f822ede1c  (/lib64/libasan.so+0x32e1c)
    #5 0x7f8237cb50 in __interceptor_free (/lib64/libasan.so+0xc1b50)
    #6 0x7f3698d0c8 in xnn_delete_operator (/lib64/libinference-engine-tflite.so+0x5350c8)
    #7 0x7f36961d48 in xnn_delete_runtime (/lib64/libinference-engine-tflite.so+0x509d48)
    #8 0x7f3690644c  (/lib64/libinference-engine-tflite.so+0x4ae44c)
    #9 0x7f368084a0 in tflite::Subgraph::CleanupNode(int) (/lib64/libinference-engine-tflite.so+0x3b04a0)

Change-Id: I029d2354f4a96e9b362703e18febc8e6d2b68c45
Signed-off-by: Kwanghoon Son <k.son@samsung.com>
5 months agoFix dlog format specifier 87/301887/1
Kwanghoon Son [Mon, 27 Nov 2023 03:56:02 +0000 (12:56 +0900)]
Fix dlog format specifier

Change-Id: I4dc0da1cee660822b9bd9c3ce19214d20c64bb9f
Signed-off-by: Kwanghoon Son <k.son@samsung.com>
5 months agoMerge branch 'tizen_devel' into tizen accepted/tizen/unified/20231115.024850
Kwanghoon Son [Tue, 14 Nov 2023 07:53:58 +0000 (16:53 +0900)]
Merge branch 'tizen_devel' into tizen

[Version] 0.30.0

Inki Dae (11):
  mv_machine_learning: add image segmentation task group support
  mv_machine_learning: use DEFAULT_MODEL_NAME for face detection task
  mv_machine_learning: use DEFAULT_MODEL_NAME for landmark detection
    task group
  mv_machine_learning: drop parsing dependency from landmark detection
  test: fix answer table values for landmark detection
  mv_machine_learning: drop unused code
  mv_machine_learning: drop parsing dependency from object detection 3d
  mv_machine_learning: introduce MachineLearningConfig class
  mv_machine_learning: drop setTaskType member function
  mv_machine_learning: use MachineLearningConfig class for other task
    groups
  mv_machine_learning: move meta directory into common one

Kwanghoon Son (2):
  Fix wrong log level
  Update cmake version to 3.13

Seungbae Shin (1):
  mv_machine_learning: initialize class/structure member properly

Vibhav Aggarwal (10):
  mv_machine_learning: bug fix in decision weight threshold
  mv_machine_learning: reallocate parser on changing meta file
  mv_machine_learning: drop parsing dependency from object detection
  mv_machine_learning: drop parsing dependency from image classification
  mv_machine_learning: drop template from MachineLearningConfig class
  mv_machine_learning: parse label file name in
    MachineLearningConfig::parseConfigFile()
  mv_machine_learning: replace ObjectDetectionConfig by
    MachineLearningConfig
  mv_machine_learning: load meta and label files in configure()
  mv_machine_learning: convert ObjectDetection3d into a template class
  mv_machine_learning: convert ObjectDetection class into template class

sangho park (1):
  Fix build break

Change-Id: Ica0db898b2d79febeb287e03ce83b323b4cbb7cc

5 months agoUpdate cmake version to 3.13
Kwanghoon Son [Mon, 13 Nov 2023 04:24:52 +0000 (13:24 +0900)]
Update cmake version to 3.13

Range version supported from 3.12 so just set minimum version to 3.13

Change-Id: Ied6872be4fff447318709e816d84ca08ee4219dd
Signed-off-by: Kwanghoon Son <k.son@samsung.com>
5 months agomv_machine_learning: convert ObjectDetection class into template class
Vibhav Aggarwal [Fri, 10 Nov 2023 11:27:23 +0000 (20:27 +0900)]
mv_machine_learning: convert ObjectDetection class into template class

[Issue type] code refactoring

Change-Id: Ib84f8211a919c82e389659bdce1b652f4419e2fb
Signed-off-by: Vibhav Aggarwal <v.aggarwal@samsung.com>
5 months agomv_machine_learning: move meta directory into common one
Inki Dae [Mon, 13 Nov 2023 05:29:15 +0000 (14:29 +0900)]
mv_machine_learning: move meta directory into common one

[Issue type] : code cleanup

Move meta directory into common one. The meta directory contains
common code to parse task own config and meta information from given files
including preprocessing and postprocessing.

However, current directory structure made it to build each task group
with the code in meta directory. It led building-duplication.

Therefore, this patch moves the meta directory into common one to combine
meta and common code. As a reault, common directory will provide one so
library - mv_ml_common.so - to each task group, and the each task group
will include only relevant header files in the common and meta directories.

Change-Id: Ib9172761ddaad0b9044f6ec02cfc71dfecb59890
Signed-off-by: Inki Dae <inki.dae@samsung.com>
5 months agomv_machine_learning: use MachineLearningConfig class for other task groups
Inki Dae [Fri, 10 Nov 2023 04:03:59 +0000 (13:03 +0900)]
mv_machine_learning: use MachineLearningConfig class for other task groups

[Issue type] : code refactoring

Use MachineLearningConfig class for other task groups instead of internal ones.

We have introduced a new common config class[1] and object detection and
object detection 3d task groups use already it. So this patch makes
other task groups - which not use the common config class - to use the
common class instead of internal ones, and drop the internal config class.

In addition, this patch applies confidence threshold config key for
landmark detection task group to MachineLearningConfig class.

[1] https://review.tizen.org/gerrit/#/c/platform/core/api/mediavision/+/301043/

Change-Id: I6e77ce33349bbdcb22f64102a7ec3f8808249b1c
Signed-off-by: Inki Dae <inki.dae@samsung.com>
5 months agomv_machine_learning: convert ObjectDetection3d into a template class
Vibhav Aggarwal [Fri, 10 Nov 2023 10:10:07 +0000 (19:10 +0900)]
mv_machine_learning: convert ObjectDetection3d into a template class

[Issue type] code refactoring

After the introduction of MachineLearningConfig, it is now possible
to convert each task group's object class into a template class.
This patch introduces this change to the object detection 3d task group.

Change-Id: Ib887846b4b1466f70d9131079f6f7ce62598fbb5
Signed-off-by: Vibhav Aggarwal <v.aggarwal@samsung.com>
5 months agomv_machine_learning: load meta and label files in configure()
Vibhav Aggarwal [Fri, 10 Nov 2023 06:37:54 +0000 (15:37 +0900)]
mv_machine_learning: load meta and label files in configure()

[Issue type] bug fix

Load the model meta and label files in configure() function
instead during the object construction.

Change-Id: I0e77fb27074ebe4d6402f66d671eee37bce855f6
Signed-off-by: Vibhav Aggarwal <v.aggarwal@samsung.com>
5 months agoFix wrong log level
Kwanghoon Son [Fri, 10 Nov 2023 07:38:20 +0000 (16:38 +0900)]
Fix wrong log level

[Issue type] Fix

Change-Id: Icdfc7f071f95be8b11b256c7ff8de3716466402a
Signed-off-by: Kwanghoon Son <k.son@samsung.com>
5 months agomv_machine_learning: replace ObjectDetectionConfig by MachineLearningConfig
Vibhav Aggarwal [Thu, 9 Nov 2023 05:03:52 +0000 (14:03 +0900)]
mv_machine_learning: replace ObjectDetectionConfig by MachineLearningConfig

[Issue type] code refactoring

This patch makes the ObjectDetection task group use
MachineLearningConfig class to reduce code duplication
across different task groups.

Change-Id: I07d8482ae761faa7918f4c66f5fc492ffe8debe5
Signed-off-by: Vibhav Aggarwal <v.aggarwal@samsung.com>
5 months agomv_machine_learning: parse label file name in MachineLearningConfig::parseConfigFile()
Vibhav Aggarwal [Fri, 10 Nov 2023 05:53:54 +0000 (14:53 +0900)]
mv_machine_learning: parse label file name in MachineLearningConfig::parseConfigFile()

[Issue type] code improvement

Get the label file name from config file during parsing
to support the task groups that rely on a label file.

Change-Id: Ice7c8108c09b10643dfcf8573b0c4a302e98ce97
Signed-off-by: Vibhav Aggarwal <v.aggarwal@samsung.com>
5 months agomv_machine_learning: drop template from MachineLearningConfig class
Vibhav Aggarwal [Fri, 10 Nov 2023 03:45:39 +0000 (12:45 +0900)]
mv_machine_learning: drop template from MachineLearningConfig class

[Issue type] code refactoring

MachineLearningConfig class introduced in [1] required the
ParserType template to initialize the _parser. This resulted in
the inclusion of parser header files of each task group in the
higher level MachineLearningConfig class which led to code smell.

This patch drops the use of template and as a first step,
modifies the object detection 3d task group to work with this
new version.

[1] https://review.tizen.org/gerrit/#/c/platform/core/api/mediavision/+/301043/

Change-Id: I90971294c89615d85ae61e789fa6200e53d367c9
Signed-off-by: Vibhav Aggarwal <v.aggarwal@samsung.com>
5 months agomv_machine_learning: drop setTaskType member function
Inki Dae [Wed, 8 Nov 2023 06:23:38 +0000 (15:23 +0900)]
mv_machine_learning: drop setTaskType member function

[Issue type] : code refactoring

Drop setTaskType member function from MetaParser and its child classes.

The setTaskType member function was used to give model specific parser object
to MetaParser class so that the MetaParser can parse model specific meta
information which describes how to parse the postprocess node of each model
specific meta file.

However, we can give the specific parser object when task group specific
parser class is created so drop the setTaskType member function and update
the object at constructor of task group specific parser class.

As of now, only object detection task group will set the specific task type
for various models support. For other task groups, 0 is used in default.

Change-Id: I7156660481f1e42daf89093f0fb1097943bbae05
Signed-off-by: Inki Dae <inki.dae@samsung.com>