platform/core/api/singleo.git
13 months agoinput/camera_api: add sync API support 92/309892/3
Inki Dae [Thu, 18 Apr 2024 01:21:38 +0000 (10:21 +0900)]
input/camera_api: add sync API support

Add sync API support by implementing capture method of CameraApiBackend class.

According to Camera-api document below,
https://docs.tizen.org/application/native/api/mobile/4.0/group__CAPI__MEDIA__CAMERA__MODULE.html
For capture, this patch follows the Camera API state diagram. However,
one tricky way is needed to make sure to wait for the "Captured" state
because completed callback since camera_start_capture call will be called
by main thread so sync API of singleo framework cannot use the callback.
Therefore, to make sure to wait for the state, we use a tricky way by
checking if current state is "Captured".

Change-Id: Ibe2ba23e0c1c9bb215976949a7d1a05cd1f98db6
Signed-off-by: Inki Dae <inki.dae@samsung.com>
13 months agopackaging: cleanup flags 32/309832/1
Inki Dae [Wed, 17 Apr 2024 05:52:47 +0000 (14:52 +0900)]
packaging: cleanup flags

Change-Id: Ic9a548d66097d3503962ce88e770ddc1f085004b
Signed-off-by: Inki Dae <inki.dae@samsung.com>
13 months agoinput/camera_api: activate user-desired camera device 95/309795/2
Inki Dae [Wed, 17 Apr 2024 02:41:24 +0000 (11:41 +0900)]
input/camera_api: activate user-desired camera device

Activate user-desired camera device by adding updateAvailableCameraDevices
and setActivateCameraDevice functions. With this patch, Camera API backend
collects valid camera device list and activates user-desired camera device
with config.device_id which is passed by user.

Change-Id: I8d44a2da1513957ee350497d328fd3c342284817
Signed-off-by: Inki Dae <inki.dae@samsung.com>
13 months agoinput: use InputServiceCallbackType type 94/309794/1
Inki Dae [Wed, 17 Apr 2024 02:08:21 +0000 (11:08 +0900)]
input: use InputServiceCallbackType type

Use predefined callback type - InputServiceCallbackType - for code cleanup.

Change-Id: I72d9ac29ea3081e53c95f5c4c4f38af7fa6d3721
Signed-off-by: Inki Dae <inki.dae@samsung.com>
13 months agoinput: add camera-api backend support 60/309760/4
Inki Dae [Tue, 16 Apr 2024 05:31:56 +0000 (14:31 +0900)]
input: add camera-api backend support

Add camera-api backend and change default input camera backend
from OpenCV to CAMERA-API.

Change-Id: Icc8aab35cbf491923045a2f7f4205ff2124af3a7
Signed-off-by: Inki Dae <inki.dae@samsung.com>
13 months agocode refactoring to Input service 71/309671/4
Inki Dae [Mon, 15 Apr 2024 07:26:51 +0000 (16:26 +0900)]
code refactoring to Input service

Code refactoring to Input service framework by doing,
 - introduce CameraBackendFactory class which creates Camara backend
   class corresponding to a given class name in runtime.
 - Integrate Input framework  with Service one. There is no reason to build
   separate library.
 - Drop redundant classes, CameraServiceDefault and CameraServiceExternal
   classes. Withoug Camera service classes, we can support vairous
   Input camera backends with CameraBackendFactory class.

Change-Id: I1f7090371efd2458834b14d1cbc05ce6326371af
Signed-off-by: Inki Dae <inki.dae@samsung.com>
14 months agoinput: use InputServiceCallbackType type for cleanup 42/309642/1
Inki Dae [Mon, 15 Apr 2024 02:18:39 +0000 (11:18 +0900)]
input: use InputServiceCallbackType type for cleanup

Use InputServiceCallbackType type instead of specific function call
definition.

Change-Id: Ida1786011baa3d6fdb918b1128d41190f19e5a4f
Signed-off-by: Inki Dae <inki.dae@samsung.com>
14 months agoMerge pull request #6 from inki-dae/main
대인기/Tizen Platform Lab(SR)/삼성전자 [Fri, 12 Apr 2024 05:22:34 +0000 (14:22 +0900)]
Merge pull request #6 from inki-dae/main

Update native capi

14 months agoupdate singleo_native_capi.h header file
Inki Dae [Fri, 12 Apr 2024 02:20:25 +0000 (11:20 +0900)]
update singleo_native_capi.h header file

Update singleo_native_capi.h header file by
- correct wrong descriptions
- update singleo_service_add_input_image_data and
  singleo_service_add_input_raw_data API by adding a option string which can
  describe speicific format type to user-given input data.

Signed-off-by: Inki Dae <inki.dae@samsung.com>
14 months agotest: clean up by dropping redundant code
Inki Dae [Fri, 12 Apr 2024 00:13:01 +0000 (09:13 +0900)]
test: clean up by dropping redundant code

Signed-off-by: Inki Dae <inki.dae@samsung.com>
14 months agoclean up README file (#5)
대인기/Tizen Platform Lab(SR)/삼성전자 [Thu, 11 Apr 2024 02:25:18 +0000 (11:25 +0900)]
clean up README file (#5)

* clean up README file

Signed-off-by: Inki Dae <inki.dae@samsung.com>
* Update README.md

Co-authored-by: 비브합 아가르왈/Tizen Platform Lab(SR)/삼성전자 <v.aggarwal@samsung.com>
---------

Signed-off-by: Inki Dae <inki.dae@samsung.com>
Co-authored-by: 비브합 아가르왈/Tizen Platform Lab(SR)/삼성전자 <v.aggarwal@samsung.com>
14 months agoMerge pull request #4 from inki-dae/main
대인기/Tizen Platform Lab(SR)/삼성전자 [Mon, 8 Apr 2024 23:43:41 +0000 (08:43 +0900)]
Merge pull request #4 from inki-dae/main

Implement autozoom service algorithm

14 months agoupdate README.md file
Inki Dae [Mon, 8 Apr 2024 06:08:40 +0000 (15:08 +0900)]
update README.md file

Signed-off-by: Inki Dae <inki.dae@samsung.com>
14 months agocleanup BaseResultType
Inki Dae [Mon, 8 Apr 2024 00:51:23 +0000 (09:51 +0900)]
cleanup BaseResultType

Clean up BaseResultType by moving common members from specific structure
to BaseResultType.

Signed-off-by: Inki Dae <inki.dae@samsung.com>
14 months agodrop SingleoOutputData class
Inki Dae [Fri, 5 Apr 2024 09:06:23 +0000 (18:06 +0900)]
drop SingleoOutputData class

Drop SingleoOuputData and its child classes, and use BaseResultType
and its child structures instead.

Signed-off-by: Inki Dae <inki.dae@samsung.com>
14 months agoimplement autozoom algorithm
Inki Dae [Fri, 5 Apr 2024 03:32:57 +0000 (12:32 +0900)]
implement autozoom algorithm

Implement autozoom algorithm. As for this, this patch introduces
a new interface class, IPostprocessor, and its concrete class,
Postprocessor for Autozoom service, which postprocesses a given
camera preview image by emulating pysical camera zoom-in/out
functions with zero latency.

Signed-off-by: Inki Dae <inki.dae@samsung.com>
14 months agorename API
Inki Dae [Tue, 26 Mar 2024 05:51:09 +0000 (14:51 +0900)]
rename API

Rename singleo_service_add_image_data to singleo_service_add_rgb_data.

Signed-off-by: Inki Dae <inki.dae@samsung.com>
14 months agoMerge pull request #3 from inki-dae/main
대인기/Tizen Platform Lab(SR)/삼성전자 [Tue, 26 Mar 2024 04:43:30 +0000 (13:43 +0900)]
Merge pull request #3 from inki-dae/main

visualizer support, chance service configuration schema and API refactoring

14 months agouse uppercase letters in CMakeLists.txt
Inki Dae [Tue, 26 Mar 2024 04:41:01 +0000 (13:41 +0900)]
use uppercase letters in CMakeLists.txt

Just cleanup.

Signed-off-by: Inki Dae <inki.dae@samsung.com>
14 months agodisplay camera preview image in application
Inki Dae [Tue, 26 Mar 2024 02:53:44 +0000 (11:53 +0900)]
display camera preview image in application

Display camera preview image mixed with bounding box for debug in application
instead of singleo service framework-internally.

Regarding this, this patch introduces Context structure so that
the test application can manage camera preview image and bounding box.

Signed-off-by: Inki Dae <inki.dae@samsung.com>
14 months agoadd singleo_service_add_input API series support
Inki Dae [Mon, 25 Mar 2024 07:13:16 +0000 (16:13 +0900)]
add singleo_service_add_input API series support

Add singleo_service_add_input_{image_file,rgb_data,raw_data} API support.

Singleo service API has to allow one more input data so add this API series
to add various types of data as input data. In addition, this patch
drops ISingleoCommon, SingleoImageData and SingleoRawData classes and,
introduces a new input manager, SingleoInputManager class which manages
input data queue.

Signed-off-by: Inki Dae <inki.dae@samsung.com>
14 months agochange service configuration schema
Inki Dae [Thu, 21 Mar 2024 07:01:03 +0000 (16:01 +0900)]
change service configuration schema

Change service configuration schema like below.

Before
"..., input=camera, camera_backend=opencv, ..."

After
"..., input_feed=camera, camera_id=n, ..."

Signed-off-by: Inki Dae <inki.dae@samsung.com>
14 months agoadd visualizer support for debug and test
Inki Dae [Fri, 15 Mar 2024 08:25:33 +0000 (17:25 +0900)]
add visualizer support for debug and test

Add visualizer support to display service result on the screen
through Native window system.

The visualizer will be used only for debug and test.

With this patch, test_autozoom_on_screen binary will be created,
And this binary will display the service result on the screen.

Signed-off-by: Inki Dae <inki.dae@samsung.com>
14 months agoMerge pull request #2 from inki-dae/main
대인기/Tizen Platform Lab(SR)/삼성전자 [Wed, 20 Mar 2024 02:16:23 +0000 (11:16 +0900)]
Merge pull request #2 from inki-dae/main

Bug fix,  specific exception class and face detection task support

14 months agofix seg. fault with no detection
Inki Dae [Fri, 15 Mar 2024 08:09:00 +0000 (17:09 +0900)]
fix seg. fault with no detection

Fix a seg. fault issue when detection failed by updating the result
only in case that object is detected.

Signed-off-by: Inki Dae <inki.dae@samsung.com>
14 months agochange ISingleoOutputData to SingleoOutputData
Inki Dae [Fri, 15 Mar 2024 01:06:31 +0000 (10:06 +0900)]
change ISingleoOutputData to SingleoOutputData

ISingleoOutputData class isn't interface class anymore.
So drop a prefix, 'I' from the class name.

Regarding this class, not clear to me and I'm pretty sure that
there is more better design for managing output data type and
to be able to generalize the various output data types.

Signed-off-by: Inki Dae <inki.dae@samsung.com>
14 months agoadd face detection support for Mediavision backend
Inki Dae [Thu, 14 Mar 2024 07:57:22 +0000 (16:57 +0900)]
add face detection support for Mediavision backend

Add face detection support for Mediavision backend.

With this patch, default task type for Autozoom service is changed
to face detection from object detection.

Signed-off-by: Inki Dae <inki.dae@samsung.com>
14 months agoadd specific exception support and error code
Inki Dae [Thu, 14 Mar 2024 02:33:22 +0000 (11:33 +0900)]
add specific exception support and error code

Add specific exception class support and error code for SingleO framework.

Signed-off-by: Inki Dae <inki.dae@samsung.com>
15 months agofix a memory leak to input feeding data
Inki Dae [Thu, 14 Mar 2024 01:30:01 +0000 (10:30 +0900)]
fix a memory leak to input feeding data

Fix a memory leak issue when pusing input feeding data to
incoming queue is skipped.

If the input feeding data was skipped then we have to release
the input feeding data which is a new buffer allocated and copied from
original data.

Signed-off-by: Inki Dae <inki.dae@samsung.com>
15 months agoMerge pull request #1 from inki-dae/main
대인기/Tizen Platform Lab(SR)/삼성전자 [Tue, 12 Mar 2024 04:25:39 +0000 (13:25 +0900)]
Merge pull request #1 from inki-dae/main

Add backbone version of SingleO AI service framework

15 months agoadd async manager for async API support
Inki Dae [Mon, 11 Mar 2024 08:05:35 +0000 (17:05 +0900)]
add async manager for async API support

Add async manager class for async API supprort.

Async manager is used to support async API support for each service API.

Behavior summary to async manager:
There are two queues which are performed in each thread context.
One is incoming queue which manages input data feeded from input device
such as camera, screen capture module, and other external modules
through input service framework. Simply saying, input service framework
will push input data feeded from input device.

And other is outgoing queue which manages output data after the completion
of invoke such as inference. Regarding outgoing queue, a thread context
is created by async manager, and this thead context pops input data
from incoming queue, request an invoke with the input data and then
push the result to outgoing queue.

As such, one thread puts input data obtained from an input device into
an incoming queue, and the other thread retrieves input data from
the incoming queue, performs invoke, and puts the result of the execution
into an outgoing queue in parallel to utilize HW resource in maximum.

Signed-off-by: Inki Dae <inki.dae@samsung.com>
15 months agoAdd backbone version of SingleO AI service framework
Inki Dae [Mon, 5 Feb 2024 08:04:56 +0000 (17:04 +0900)]
Add backbone version of SingleO AI service framework

Introduce backbone version of SingleO AI service framework as initial code
including test case for Auto Zoom API as example code.

SingleO AI service framework consists of like below,
- common directory
    . abstracted common data classes which is used to share data object
      between service framework and various backend services.
- services/common/singleo_native_capi.cpp
    . native CAPI implemention, which calls a user-desired service API.
- services/auto_zoom directory
    . AI service API implementation targeted to Camera auto zoom service,
  which uses service class for the use of various backend independent
  inference and training engines.
- services/common directory
    . context class
    . A unique object corresponding to user-desired service.
    . abstracted AI service
    . actual implementation to user-desired AI service using various
  generic services such as inference, training and remote computing
  services.
    . abstracted preprocess classes
    . preprocessing class for convert user-given input or internally-feeded
  input data to common data object which can be used for service
  perform framework internally.
    . abstracted input data types
    . Common data type for contarining various types of data given by user
  or internally-feeded such as camera, screen capture, image file
  and so on.
- log directory
    . message logging class which provides standard output in default and dlog
  for Tizen as a Tizen backend.
- input directory
    . abstracted input service classes which provide input feeded data through
  Camera and screen capture module in platform independent manner.
  Platform dependent camera or screen capture modules can be used as plugin
  module. In default, OpenCV based camera backend is used, which is a built
  in backend.
- inference directory
    . abstracted inference service classes which provides platform independent
  inference service.
    . inference/backends directory
    . Inference engine backend for the use of Mediavision framework.
  In default, mediavision backend is used but possible to use external
  framework through a plugin module.

Signed-off-by: Inki Dae <inki.dae@samsung.com>
16 months agoInitial commit
대인기/Tizen Platform Lab(SR)/삼성전자 [Mon, 5 Feb 2024 05:28:28 +0000 (14:28 +0900)]
Initial commit