Inki Dae [Mon, 3 Feb 2025 02:19:11 +0000 (11:19 +0900)]
backens/mediavision: code cleanup to _output_data
Change-Id: Id119834c77ce5ecee89e73cd9778ff48e3c82d78
Signed-off-by: Inki Dae <inki.dae@samsung.com>
Inki Dae [Thu, 23 Jan 2025 08:12:15 +0000 (17:12 +0900)]
serices: add test suite app for testing task api
Change-Id: I1f33dd53fc7315fd50db365dcc40225ffaa6faea
Signed-off-by: Inki Dae <inki.dae@samsung.com>
Inki Dae [Thu, 2 Jan 2025 02:04:42 +0000 (11:04 +0900)]
inference: drop mv_facial_landmark_set_model call
Drop mv_facial_landmark_set_model call.
mv_facial_landmark_set_model API is a private one for internal developers.
As for custom model support, we will introduce a new interface to support
custom model later.
Change-Id: Ie118aaf33b79fef49c9bfccaa556807b75457940
Signed-off-by: Inki Dae <inki.dae@samsung.com>
Inki Dae [Wed, 1 Jan 2025 23:47:48 +0000 (08:47 +0900)]
capi: add extern "C" prefix to header file
Add extern "C" prefix to header file for other users want to use singleo
framework library file.
Change-Id: I5520ef0dc34413efb233794491bc19732ca7365e
Signed-off-by: Inki Dae <inki.dae@samsung.com>
Inki Dae [Tue, 23 Jul 2024 05:25:00 +0000 (14:25 +0900)]
service: add Air Gesture service API support
Add Air Gesture service API support to control mouse input
with gaze and hand gesture.
The task pipeline of this WIP is as follows,
face detection --- bridge --- face landmark --- bridge --- gaze tracking ---- endpoint
|
hand detection ------------------------------------------------------------
In default, TinyTrackerS model is used for gaze estimation.
This pipeline behavior is as follows(pipeline is changed in runtime),
1. Perform face landmark and gaze tracking only if gaze estimation is
gotten correctly after face detection.
2. Change gaze position with the position from hand detection if hand is
detected.
Change-Id: Ib328e25d90a228eb59f642badf5a6ff871949348
Signed-off-by: Inki Dae <inki.dae@samsung.com>
Tae-Young Chung [Mon, 16 Dec 2024 06:21:54 +0000 (06:21 +0000)]
Merge "Change test path" into tizen_devel
Tae-Young Chung [Wed, 11 Dec 2024 04:10:49 +0000 (13:10 +0900)]
Change test path
Sync with mv_test_res.
It is verified with capi-media-vision with version 1.0.13 and tizen
branch.
Change-Id: I4ed6e0007c5f4d9f1a2fbb5a97d0fe3c500811c3
Signed-off-by: Tae-Young Chung <ty83.chung@samsung.com>
Inki Dae [Fri, 13 Dec 2024 09:11:46 +0000 (18:11 +0900)]
test: fix a build error
Change-Id: I69cf2895e851afb2fb7b8ce17e802fcca6c24db0
Signed-off-by: Inki Dae <inki.dae@samsung.com>
Tae-Young Chung [Wed, 11 Dec 2024 01:08:14 +0000 (10:08 +0900)]
Fix typos
Change-Id: I151f3e0b8432e78a46261aa2b63c97cb3aafed71
Signed-off-by: Tae-Young Chung <ty83.chung@samsung.com>
Tae-Young Chung [Mon, 2 Dec 2024 03:29:52 +0000 (12:29 +0900)]
Support 3rdparty libfacedetection as an inference backend and update
test_focusfinder's answer values.
- libfacedetection
https://github.sec.samsung.net/eXtendedReality/libfacedetection
To use it, do local build after cloning the repo.
Then, set 'use_3rdparty_facedetection' to '1' on Singleo's spec file.
MediaVision's facedetection is applied if use_3rdparyt_facedetection is
0.
Change of a face detection causes results. So, change ASSERT_EQ to
ASSERT_GE and ASSERT_LE with error margins.
Change-Id: I2227427c8ed8d2d008dd59bbeca66f8a0692c561
Signed-off-by: Tae-Young Chung <ty83.chung@samsung.com>
Tae-Young Chung [Tue, 10 Dec 2024 04:39:20 +0000 (04:39 +0000)]
Merge "Integrate gaze model to estimate gaze vector" into tizen_devel
Inki Dae [Fri, 6 Dec 2024 01:19:45 +0000 (10:19 +0900)]
test: drop unnecessary color space conversion
Change-Id: I76770c0654f68ba413c030277e64b4d9602bcf1f
Signed-off-by: Inki Dae <inki.dae@samsung.com>
Tae-Young Chung [Mon, 7 Oct 2024 08:25:33 +0000 (17:25 +0900)]
Integrate gaze model to estimate gaze vector
A gaze model from https://github.sec.samsung.net/tizen-vault/open_model_zoo/pull/12
and mediavision's gaze task api is applied.
https://review.tizen.org/gerrit/#/c/platform/core/api/mediavision/+/320983/
test_focusfinder must be tested with an image where
"/usr/share/capi-media-vision/res/inference/images/headpose_sample00.jpg" is on a target.
The image can be downloaded from https://github.sec.samsung.net/k-son/mv_test_res/pull/16
Change-Id: I5a7fc6da1031ff875b0efd38e7ebb3dedd442265
Signed-off-by: Tae-Young Chung <ty83.chung@samsung.com>
Inki Dae [Wed, 4 Dec 2024 06:43:07 +0000 (15:43 +0900)]
test: check an exception correctly
Change-Id: I377aebea9bf84f6359ffacba4a465fc66a52eedc
Signed-off-by: Inki Dae <inki.dae@samsung.com>
Inki Dae [Mon, 2 Dec 2024 02:13:59 +0000 (11:13 +0900)]
task_manager: reintroduce topologicalSorting()
Reintroduce topologicalSorting(). We have separated verifyGraph()
and topologicalSorting() from run() so no overhead and even we can
drop unnecessary interation for finding a last node in output function.
The reason I introduce topologicalSorting function are,
- to show actual pipeline path to user in runtime for debugging
- to add multiple pipelines later
(as of now, only one _nodes exists but _nodes will be created by
user request)
Change-Id: Idc389493a8b73d67a9b17ac26516014704501ed2
Signed-off-by: Inki Dae <inki.dae@samsung.com>
Inki Dae [Fri, 29 Nov 2024 07:44:50 +0000 (16:44 +0900)]
task_manager: verify graph just once
Verify graph just once. Now every time run function is called,
graph is verified but it's enough just once before calling run().
Change-Id: I91169cd9b1140cb49ae4776fef864278510e587e
Signed-off-by: Inki Dae <inki.dae@samsung.com>
Inki Dae [Fri, 29 Nov 2024 07:34:42 +0000 (16:34 +0900)]
task_manager: fix output function of task manager
Fix output function of task manager. Without topological sorting,
endpoint node couldn't be positioned as last node of pipeline,
and it results in losting result value from inference node because
node.back() couldn't be endpoint node. So find endpoint node from
the pipeline(_nodes) and get the result from the endpoint node.
Change-Id: I697732527b6fb44afec873c329cc0f441b3e6ee3
Signed-off-by: Inki Dae <inki.dae@samsung.com>
Inki Dae [Fri, 29 Nov 2024 02:02:40 +0000 (11:02 +0900)]
backends/camera_api: set preview resolution with given fps
Set preview resoultion with given fps.
Preview resolution has supported fps so find a proper resolution
which supports the user-given fps and set it.
In addition, this patch adds YUYV pixel format support.
Change-Id: Ie45053c099441463061976fbf6faf1830ee676d9
Signed-off-by: Inki Dae <inki.dae@samsung.com>
Vibhav Aggarwal [Mon, 2 Dec 2024 05:59:07 +0000 (14:59 +0900)]
test: add cyclic graph test case
Change-Id: Idf2869250763bb2f4d5f6e1745feb676979dd14a
Signed-off-by: Vibhav Aggarwal <v.aggarwal@samsung.com>
Inki Dae [Thu, 14 Nov 2024 04:27:17 +0000 (13:27 +0900)]
test: use runtime pipeline configuration feature
Change-Id: I76d313d1b809ad909f7c8eb29ac3d7fb827c095c
Signed-off-by: Inki Dae <inki.dae@samsung.com>
Inki Dae [Thu, 14 Nov 2024 04:26:46 +0000 (13:26 +0900)]
auto_zoom: use runtime pipeline configuration feature
Change-Id: I6c6930ba4f17eb68d6ea4fff505b5a7aee2c51fe
Signed-off-by: Inki Dae <inki.dae@samsung.com>
Inki Dae [Thu, 31 Oct 2024 07:20:25 +0000 (16:20 +0900)]
task_manager: add runtime pipeline configuration support
Add runtime pipeline configuration support.
With this patch, we can change inference pipeline in runtime according to
use case, and also bypass a particular node/s in runtime.
The runtime pipeline configuration feature is accomplished by adding
resetPipeline and addEdge member functions to TaskManager, and this
configuration is performed by below three steps.
1. Create node to be used for service scenario by calling requestNewNode()
2. reset current pipeline by calling resetPipeline()
3. Connect nodes with a edge by calling addEdge("node a", "node b")
it means,
next node of "node_a" is "node_b"
"node_b" has "node_a" dependency
After that, we can run the pipeline which is configured with our desired
graph.
As for the the node bypass, it is needed to bypass a particular node/s
in runtime according to use case.
For example, there is service api which uses below a pipeline,
face detection -- bridge -- face landmark -- bridge -- gaze tracker -- endpoint
(latency 1s) (latency 100ms) (latency 30ms)
In this pipeline, performing all nodes of this pipeline needs big latency
because three deep learning models should be performed every time a new
inference is requested. So it will take 1s 130ms for each input.
What is the best if face detection is required only one time?
In this case, the pipeline can be performed within 130ms if we can bypass
face detection node in runtime.
This patch provides a task manager interface to bypass a given node
in runtime, and this allows us to seamlessly integrate these modifications
into the existing workflow without disrupting the overall architecture of
the pipeline and service API implementation.
Change-Id: Ic8540d414560b1cda24cd0f1aee8841d62efb67b
Signed-off-by: Inki Dae <inki.dae@samsung.com>
Tae-Young Chung [Wed, 23 Oct 2024 00:54:56 +0000 (00:54 +0000)]
Merge "Change a spec file to install specific files" into tizen_devel
kwang son [Tue, 22 Oct 2024 22:19:33 +0000 (22:19 +0000)]
Merge "Fix typo" into tizen_devel
Tae-Young Chung [Thu, 3 Oct 2024 03:18:15 +0000 (12:18 +0900)]
Change a spec file to install specific files
Change-Id: I97e11a0c636b9b8656c3b7498743cb15379c01c9
Signed-off-by: Tae-Young Chung <ty83.chung@samsung.com>
Kwanghoon Son [Tue, 22 Oct 2024 04:03:53 +0000 (13:03 +0900)]
Fix typo
Change-Id: Iaa96223ad48dfe2acc6366b184b22784396a6ddf
Signed-off-by: Kwanghoon Son <kwangson@yahoo.com>
Tae-Young Chung [Thu, 3 Oct 2024 03:04:01 +0000 (12:04 +0900)]
Add asychronous operation of HeadPoseEstimator while calculating the pose axes and its testcase with visualization
GazeEstimator returns axes of a head pose.
The origin of the axes is the nose tip of the detected face.
Then, XYZ axes from the origin are given and the direction of the axes
indicate the head pose.
The test_focusfinder_on_screen testcase is added and it work when
enable_visualizer 1 in the spec file.
Note that this patch uses FLD_U2NET model for face landmark with mediavision which
provides 68 landmarks. With others it may return unexpected results.
Change-Id: If22c1434031b8b2577a0fe405e79d37de8626c11
Signed-off-by: Tae-Young Chung <ty83.chung@samsung.com>
Tae-Young Chung [Wed, 25 Sep 2024 15:25:13 +0000 (00:25 +0900)]
Use shared_ptr<IFaceTaskManager> instead of shared_ptr<FaceTaskManager>
Change-Id: I400d0548dac1c70398d7a2ab59aa198e01242da1
Signed-off-by: Tae-Young Chung <ty83.chung@samsung.com>
Tae-Young Chung [Thu, 19 Sep 2024 08:43:09 +0000 (17:43 +0900)]
Add HeadPoseEstimator which estimates the pose from face landmark
HeadPoseEstimator consists of FaceShapeModelManager and
CameraParameterManager.
FaceShapeModelManager loads face shape from a file and estimates
actual pose by projecting the face landmarks results on the face shape.
CameraParameterManager loads camera parameters from a file.
Face shape file (pdm.txt) and dummpy camera parameter file are added to
res directory. They are installed when single rpm is installed.
Currently, only the first face's pose is estimated and an image is
tested. Commit working with a camera will be patched.
Note: pdm.txt is from https://github.com/TadasBaltrusaitis/OpenFace/blob/master/lib/local/LandmarkDetector/model/pdms/In-the-wild_aligned_PDM_68.txt. It consists of 68 landmarks in 3D coordinate. The xyz order is xxxxx....yyyyy...zzzz... .
Change-Id: I0b2157d335e13dfbe8914e22e71535f0b368636e
Signed-off-by: Tae-Young Chung <ty83.chung@samsung.com>
Inki Dae [Fri, 27 Sep 2024 01:49:16 +0000 (10:49 +0900)]
backends/mediavision: catch an exception at dtor
Catch an exception at dtor of MvHandLandmark class.
Change-Id: I4added64efde8d1ab793ce9a388a218ffd15be2f
Signed-off-by: Inki Dae <inki.dae@samsung.com>
Inki Dae [Fri, 27 Sep 2024 01:10:16 +0000 (10:10 +0900)]
auto_zoom: fix coverity issues
Fix coverity issues -
1789460,
1789472 and
1789481.
Change-Id: I7680db3de79574404f39faed79f9baf6b8342e42
Signed-off-by: Inki Dae <inki.dae@samsung.com>
Tae-Young Chung [Wed, 25 Sep 2024 04:32:50 +0000 (04:32 +0000)]
Merge "Add GazeEstimator" into tizen_devel
Tae-Young Chung [Thu, 12 Sep 2024 00:42:22 +0000 (09:42 +0900)]
Add GazeEstimator
GazeEstimator estimates a gaze with a head pose and a gaze model.
To get head pose, face and the landmark are prerequisite.
So FaceTaskManger is addded.
Note that FaceTaskManager is own implemented without TaskManger.
Even TaskManager is a common and an option.
So i wanna change FaceTask without TaskManger dependency.
Change-Id: I308a6fbe7c5766c0de693095747e9e7efe46180f
Signed-off-by: Tae-Young Chung <ty83.chung@samsung.com>
Inki Dae [Mon, 23 Sep 2024 02:58:49 +0000 (11:58 +0900)]
backends/mediavision: do not throw at dtor
Change-Id: I25ea8eb5dc9859914ac5e93aa6b0f0d022d51a8f
Signed-off-by: Inki Dae <inki.dae@samsung.com>
Inki Dae [Tue, 23 Jul 2024 05:07:57 +0000 (14:07 +0900)]
backends/mediavision: add hand landmark API support
Change-Id: I9ad37221cdbc9b39192e9e24d1879ec3a342d680
Signed-off-by: Inki Dae <inki.dae@samsung.com>
Inki Dae [Tue, 23 Jul 2024 04:59:41 +0000 (13:59 +0900)]
backends/mediavision: add hand detection API support
Change-Id: I17eed22c9f50a43baac0290cb31e018f9b8e12dd
Signed-off-by: Inki Dae <inki.dae@samsung.com>
Inki Dae [Wed, 11 Sep 2024 02:10:51 +0000 (11:10 +0900)]
task_manger: fix coverity issue
Fix coverity issue - CID
1789482 - Data race condition by making sure locking
before pusing a new thread to _threads.
Change-Id: I94d142822972e057ba7ba9681c1c582589d9a503
Signed-off-by: Inki Dae <inki.dae@samsung.com>
Inki Dae [Wed, 11 Sep 2024 02:06:29 +0000 (11:06 +0900)]
common: fix coverity issue
Fix coverity issue - CID
1789473 - Using invalid iterator by dropping
invalid iterator access.
Change-Id: Ia7d251e13222b423e5718fe18f75666a7836be7b
Signed-off-by: Inki Dae <inki.dae@samsung.com>
Inki Dae [Wed, 11 Sep 2024 01:56:47 +0000 (10:56 +0900)]
input/camera_api: fix coverity issue
Fix coverity issue - CID
1789471 - Waiting while holding the lock by unlocking
just after the completion of _capture_event.wait_for().
Change-Id: Ia2cb4f9878f57c030273a62d2aadaf30d38e70fe
Signed-off-by: Inki Dae <inki.dae@samsung.com>
Inki Dae [Wed, 11 Sep 2024 01:42:21 +0000 (10:42 +0900)]
input/camera_api: fix coverity issue
Fix coverity issue - CID
1789468 - Data race condition by making sure locking
before accessing to context->_isCaptured.
Change-Id: I61f1cfa77c65101c810b4cfd5e2fb32a51b9210d
Signed-off-by: Inki Dae <inki.dae@samsung.com>
Inki Dae [Wed, 11 Sep 2024 01:34:00 +0000 (10:34 +0900)]
auto_zoom: fix coverity issue
Fix coverity issue - CID
1789466 - Data race condition by making sure locking
_inputQ.size() access.
Change-Id: I89c18dba3abafc69ca242e3b8fa7774b1956b2e1
Signed-off-by: Inki Dae <inki.dae@samsung.com>
Inki Dae [Wed, 11 Sep 2024 01:30:13 +0000 (10:30 +0900)]
task_manger: fix coverity issue
Fix coverity issue - CID
1789443 - Data race condition by adding
missing lock.
Change-Id: I369e603c95a6a908df760f4cc5e5ddeb9c60b576
Signed-off-by: Inki Dae <inki.dae@samsung.com>
Inki Dae [Wed, 11 Sep 2024 01:16:11 +0000 (10:16 +0900)]
inference: fix coverity issue
Fix coverity issue - CID
1790310/314/317/329/335 - Uncaught exception.
Change-Id: I91779a6047edaed9005621c00b4a21ae7ca6a965
Signed-off-by: Inki Dae <inki.dae@samsung.com>
Inki Dae [Wed, 11 Sep 2024 00:25:22 +0000 (09:25 +0900)]
backends: fix svace issue
Fix svace issue - WGID 245662 and 245663 - UNINIT.CTOR.
Change-Id: If2295d9ec8b70e3b5fa3ed68582877893b1a8db5
Signed-off-by: Inki Dae <inki.dae@samsung.com>
Inki Dae [Wed, 11 Sep 2024 00:10:16 +0000 (09:10 +0900)]
task_manager: fix svace issue
Fix svace issue - WGID 245644, 245645 and 245646 - DEREF_OF_NULL_DYN_CAST.
Any dependency from getDependencies() could be NULL so if the dependency
is NULL then skip it.
Change-Id: I9c3fe1f4d488b3b9c538d7b505987bb2b2f157aa
Signed-off-by: Inki Dae <inki.dae@samsung.com>
Inki Dae [Tue, 10 Sep 2024 23:59:00 +0000 (08:59 +0900)]
auto_zoom: fix svace issue
Fix svace issue, WGID 245634, DEREF_OF_NULL.DYN_CAST.
node could be null so make sure to check if node is null or not.
Change-Id: I3cc83ea19aafc80b1fdd4ea82d2a8fe96d9156f9
Signed-off-by: Inki Dae <inki.dae@samsung.com>
Inki Dae [Mon, 9 Sep 2024 06:26:26 +0000 (15:26 +0900)]
test: do not build visualizer
Do not build visualizer and relevant test binaries.
The visualizer is used only for test so this patch disables
visualizer module and relevant test binaries in default.
If we want to enable visualizer then just set below flag to 1 in spec file,
%define enable_visualizer 0
Change-Id: I1a86bf215ed553c9d4e5bd342597bf2ce6c552ae
Signed-off-by: Inki Dae <inki.dae@samsung.com>
Tae-Young Chung [Mon, 9 Sep 2024 06:14:30 +0000 (15:14 +0900)]
Add FocusFinder class as dummy
As the first commit for FocusFinder,
FocusFinder class is added to Service and
FocusFinderTest for Create and Destroy is added as gtest.
Details implementation codes will be added with next patches.
Change-Id: I981612aee1ef9767af6f1cb4f497abaaf1058d6d
Signed-off-by: Tae-Young Chung <ty83.chung@samsung.com>
Inki Dae [Mon, 9 Sep 2024 04:12:51 +0000 (13:12 +0900)]
use DLOG for Tizen
Use DLOG for Tizen platform.
Singleo framework will be installed in Tizen platform image soon
so change the log backend to DLOG.
With this patch, we can check singleo logs by typing like below
Change-Id: I79314f967369dfec8cc82d7ccbbf3c0157821326
Signed-off-by: Inki Dae <inki.dae@samsung.com>
Inki Dae [Wed, 4 Sep 2024 07:56:49 +0000 (16:56 +0900)]
services: introduce filter for preprocessor
Introduce image filter for preprocessor.
The camera is highly affected by lighting, and the contrast ratio
varies depending on the brightness of the captured image.
If the contrast ratio is not good, it has a negative impact on
the inference results. Therefore, to improve the contrast ratio
for the captured images, this patch adds a filter - ClaheFilter - in the
preprocessing module. As of now, only one filter - ClashFilter - is supported.
This feature is implemented with Stategy pattern for maintainability
so that other filter can be added easily and also other clients such as
postprocessing module can use it.
In addition, this patch changes API of preprocessing and postprocessing
modules to be consistent.
Change-Id: Iff7fe64c1be562c80da859e0b26b9fa0acac8138
Signed-off-by: Inki Dae <inki.dae@samsung.com>
Inki Dae [Wed, 4 Sep 2024 02:45:21 +0000 (11:45 +0900)]
auto_zoom: consider for synchronous API
Issue type : bug fix
Consider for synchronous API when adding Autozoom result to post processor.
Change-Id: Iedac1f171f1f7f138ab4093b83b4fff19dcff5aa
Signed-off-by: Inki Dae <inki.dae@samsung.com>
Inki Dae [Wed, 4 Sep 2024 00:05:30 +0000 (09:05 +0900)]
visualizer: fix an build error on Tizen-Unified-X
Issue type : bug fix
Fix an build error on Tizen-Unified-X which is sync version of
Tizen-Unified but uses GCC 14.
The build error[1] happended because singleo_util_winsys.h uses uint32_t type
but never include <cstdint> so include this header.
[1]
[ 93s] In file included from /home/abuild/rpmbuild/BUILD/singleo-0.0.1/visualizer/src/singleo_util_winsys.cpp:18:
[ 93s] /home/abuild/rpmbuild/BUILD/singleo-0.0.1/visualizer/include/singleo_util_winsys.h:27:9: error: 'uint32_t' does not name a type
[ 93s] 27 | uint32_t serial;
[ 93s] | ^~~~~~~~
[ 93s] /home/abuild/rpmbuild/BUILD/singleo-0.0.1/visualizer/include/singleo_util_winsys.h:1:1: note: 'uint32_t' is defined in header '<cstdint>'; this is probably fixable by adding '#include <cstdint>'
[ 93s] +++ |+#include <cstdint>
[ 93s] 1 | /**
[ 93s] make[2]: *** [visualizer/CMakeFiles/singleo_visualizer.dir/build.make:163: visualizer/CMakeFiles/singleo_visualizer.dir/src/singleo_util_winsys.cpp.o] Error 1
Change-Id: I08153159a623ed1f3ebc2243907c3dadf5033c9d
Signed-off-by: Inki Dae <inki.dae@samsung.com>
Inki Dae [Wed, 24 Jul 2024 23:33:10 +0000 (08:33 +0900)]
task_manager: do not call result() two times
Do not call result() two times.
We can use a reference instead of calling result() again.
Change-Id: I0378f9a533cbacd146b57168aa60e17d5947cfca
Signed-off-by: Inki Dae <inki.dae@samsung.com>
Inki Dae [Wed, 24 Jul 2024 23:18:40 +0000 (08:18 +0900)]
task_manager: fix a bug that node is waked up regardless of dependency
Fix a bug that node is waked up regardless of its node dependency.
This bug can be reproduced like below,
[example graph pipeline]
input --- face detection --- bridge --- face landmark --- endpoint
| |
----------------------------------------
endpoint node will be waked up regardless of its node dependency after
previous iteration of above graph pipeline is completed because
_completed of face landmark node is true after previous iteration so
wait() just returns like below,
void TaskNode::wait()
{
unique_lock<mutex> lock(_mutex);
// If already completed then just return.
if (_completed) // <- here
return;
_event.wait(lock, [this] { return this->_completed; });
}
Therefore, make sure to set _completed as false in clear()
Change-Id: I6595e7199e2dc9aa3ecbcaa0fedcddcbc74e7166
Signed-off-by: Inki Dae <inki.dae@samsung.com>
Inki Dae [Thu, 11 Jul 2024 02:25:36 +0000 (11:25 +0900)]
task_manager: fix memory leak issue
Fix memory leak issue to SharedBuffer objects when task manager is performed.
The memory leak happended in two cases,
1. ref_count of SharedBuffer class wasn't discounted correctly because
'std::atomic<int> ref_count' isn't initialized.[1] So clear it correctly.
2. missed to release input buffer. As for this, it moved the release call
from each node class into threadCb of TaskManager class so that making
sure to miss releasing the input buffer. With this, each node class
is free to care about the buffer release.
Regarding the memory leak, this patch introduces buffer tracker which
manages to check if each buffer is released or not.
In addition, use call by reference as a parameter of setOutputBuffer function.
[1] https://saco-evaluator.org.za/docs/cppreference/en/cpp/atomic/atomic/atomic.html
Change-Id: I3b20a7b9962e086a6d95bc04d996f527efc545eb
Signed-off-by: Inki Dae <inki.dae@samsung.com>
Inki Dae [Wed, 10 Jul 2024 03:55:12 +0000 (12:55 +0900)]
test: do not clone on input buffer
Do not clone on input buffer in case of BranchNode.
Branch node just selects valid next nodes so never modify
the given input buffer.
Change-Id: I75d34ed5c1eb881e9b966809c329c52bf6f622b0
Signed-off-by: Inki Dae <inki.dae@samsung.com>
Inki Dae [Wed, 10 Jul 2024 01:05:42 +0000 (10:05 +0900)]
input/opencv: list up valid fps and use it
List up valid fps through OpenCV and use user-given config value
instead of fixed one. OpenCV cannot list up valid fps itself
So this patch uses a local fps table - which includes only well-known fps
values - to check if each fps in the table is valid or not, and to update
only valid fps.
Change-Id: If6fc2ebf2f9c79e5b99126dd4000b1bbcb700b9b
Signed-off-by: Inki Dae <inki.dae@samsung.com>
Inki Dae [Tue, 9 Jul 2024 05:19:00 +0000 (14:19 +0900)]
auto_zoom: optimize auto zoom service
Optimize auto zoom service by
- making RGB image data to be used for GL texture and then dropping
color space conversion work.
- skipping postprocessing if the zoom-in/out isn't needed.
Change-Id: I624380bdeea7d6dea626a31c85bec249b219603e
Signed-off-by: Inki Dae <inki.dae@samsung.com>
Inki Dae [Tue, 9 Jul 2024 03:36:07 +0000 (12:36 +0900)]
input/camera_api: list up valid fps and use it
List up valid fps through Camara API and use user-given config value
instead of fixed one.
Change-Id: Ied13ed85ad8482fb0e8c3927fd1c68fdee90e928
Signed-off-by: Inki Dae <inki.dae@samsung.com>
Seungbae Shin [Mon, 1 Jul 2024 09:04:03 +0000 (18:04 +0900)]
test: refactor task manager test case
Change-Id: I06f1a57e6f22c4ba31f8b024ed16fa300879311a
Signed-off-by: Seungbae Shin <seungbae.shin@samsung.com>
Fixed conflict and modified member order of Rect structure properly
to be suitable for answer value order.
Signed-off-by: Inki Dae <inki.dae@samsung.com>
Inki Dae [Fri, 5 Jul 2024 05:55:09 +0000 (14:55 +0900)]
task_manger: fix AutoZoom not working issue
Fix an bug that AutoZoom service doesn't work since the patch,
"task_manager: introduce _status member in each node"
The problem happened when AutoZoom service is performed. AutoZoom service
can zoom in or output according to detected results. However, the patch
made zoom-in to work even no detected result.
As for this, this patch fixes the problem by clearing _results of each
node class at top of invoke() function.
Change-Id: I4509e6c17bddc84ef377283111e6f0ea02909d65
Signed-off-by: Inki Dae <inki.dae@samsung.com>
Inki Dae [Thu, 4 Jul 2024 05:18:34 +0000 (14:18 +0900)]
task_manager: use raw pointer instead of shared_ptr
Use unique_ptr and raw_pointer instead of shared_ptr.
With shared_ptr, we have to manage the pointers carefully
because memory leak can happen due to the cyclic dependency issue[1]
So use raw pointer instead.
[1] https://stackoverflow.com/questions/
22185896/what-is-the-cyclic-dependency-issue-with-shared-ptr
Change-Id: I86b02537d9e8db0f970ad36def395a165a992a36
Signed-off-by: Inki Dae <inki.dae@samsung.com>
Vibhav Aggarwal [Fri, 5 Jul 2024 05:44:54 +0000 (14:44 +0900)]
fix roi bug
The roi was sometimes out of bounds which caused runtime_error.
Change-Id: Ic54472dbfd4f5c24554c4ac4747753644bb860c0
Signed-off-by: Vibhav Aggarwal <v.aggarwal@samsung.com>
Vibhav Aggarwal [Tue, 11 Jun 2024 09:57:11 +0000 (18:57 +0900)]
task_manager: add support for BRANCH node
[Issue type] new feature
Add BRANCH node support which can decide data path in
the task manager during execution.
Change-Id: I83ac8d6f6a3204635b79f1e2b2a848e82688e36b
Signed-off-by: Vibhav Aggarwal <v.aggarwal@samsung.com>
Vibhav Aggarwal [Mon, 1 Jul 2024 11:40:50 +0000 (20:40 +0900)]
CameraApiBackend: set camera device according to config
[Issue type] bug fix
The camera device was being set in the constructor and
had no effect from the config. This patch fixes this behaviour.
Change-Id: Ic44b09b4cb60cccd413a728cd11b3444b39036a9
Signed-off-by: Vibhav Aggarwal <v.aggarwal@samsung.com>
Vibhav Aggarwal [Mon, 1 Jul 2024 06:04:38 +0000 (15:04 +0900)]
async_manager: minor bug fix
pop() function of std::queue destroys the front object
so it needs to be moved before returning.
Change-Id: I08036b48ec9c6989ea59003ce94c785f721ed378
Signed-off-by: Vibhav Aggarwal <v.aggarwal@samsung.com>
Inki Dae [Mon, 1 Jul 2024 05:58:30 +0000 (14:58 +0900)]
services: fix seg. fault issue
Fix seg. fault issue.
The issue happened because invokeThread() callback of AsyncManager class
was called after camera service had been terminated, which in turn,
the callback of branch node tried to access invalid buffer.
So this patch makes sure to wait for the completion of AsyncManager's thread
after the camera service is off.
Change-Id: Ic64f2fd88f880b2eab9ec26b58cc7252bfb16930
Signed-off-by: Inki Dae <inki.dae@samsung.com>
Vibhav Aggarwal [Fri, 28 Jun 2024 01:12:26 +0000 (10:12 +0900)]
task_manager: add new test case
This testcase checks whether the nodes after bridge node
are run if bridge node dependencies fail.
The graph looks as follows:
input -----> OD ----- bridge -----> IC -----bridge -----> IC -----> endpoint ----> output
| |
------------------------------------------------------------
The input is a blank image so that object detection fails.
The intended behaviour is that endpoint node should not
be invoked.
Change-Id: I8cceb0710c6aed206d718c1ed10f18f3f952439a
Signed-off-by: Vibhav Aggarwal <v.aggarwal@samsung.com>
Vibhav Aggarwal [Fri, 28 Jun 2024 10:53:00 +0000 (19:53 +0900)]
task_manager: introduce _status member in each node
[Issue type] bug fix
The _status of a node can be NONE, VALID or INVALID.
If all dependencies of a node become INVALID, then current node
will also become INVALID and will not be invoked.
This patch also introduces _is_empty member in the BaseResultType
struct. If some task fails, this member is set to true so that
the corresponding task node can be set to INVALID.
Change-Id: I95a0068ae2ce4ca8e2f2fbf69696b7fe6683863d
Signed-off-by: Vibhav Aggarwal <v.aggarwal@samsung.com>
Inki Dae [Thu, 27 Jun 2024 23:45:32 +0000 (08:45 +0900)]
Revert "task_manager: add RunQueueManager support"
This reverts commit
45564ae69a0dbc36ee9ee55e352e859fe83d653c.
RunQueueManager made the BFS behavior for visiting all nodes in the graph
to be broken. So critical problem happended. Revert it.
To hide node actions into node classes, we have to find another idea.
Change-Id: If65b5cc8cedef483a89d40198975a77322ccfe29
Vibhav Aggarwal [Mon, 24 Jun 2024 11:11:36 +0000 (20:11 +0900)]
Documentation fixes and code refactoring
Change-Id: Ic98bf07ccc825ee48ea08f605bc8d8c4d8c20b42
Signed-off-by: Vibhav Aggarwal <v.aggarwal@samsung.com>
Vibhav Aggarwal [Fri, 14 Jun 2024 07:47:50 +0000 (16:47 +0900)]
CameraApiBackend: set active camera
[Issue type] bug fix
Change-Id: I0208af34eca47f174c5c54bf27370ef0a3dca222
Signed-off-by: Vibhav Aggarwal <v.aggarwal@samsung.com>
Inki Dae [Wed, 19 Jun 2024 07:43:18 +0000 (16:43 +0900)]
services: use const std::string &key
Just code cleanup by using const std::string &key intead of just std::string
key as an paramter of setXXX function in ServiceConfigParser class.
Change-Id: I02bf6a9ff60673f0621ea683870c983ab37a5c0f
Signed-off-by: Inki Dae <inki.dae@samsung.com>
Inki Dae [Tue, 18 Jun 2024 01:40:45 +0000 (10:40 +0900)]
add external service support as a plugin
Add external service support as a plugin which can be built as separate git
repository for product teams.
As for this, this patch exposes common header files so that the external
git repository can refer to the header files to develop a new service.
Ps. task manager is allowed only for built-in service so we don't expose
task manager relevant header files yet.
With self-registeration factory pattern, we can *add* a new service and *use*
it in runtime without recompling SingleO framework.
What you have to for adding your own external service are,
- build your own git repository and create a so library file.
- install the so library file to user target device.
Now we are ready for the use of the new external service. Just change
the service name like below,
singleo_service_create("service=user-service-name, ...);
Change-Id: I2e04c53820c6bc5602f7b8259d32f17b0411315a
Signed-off-by: Inki Dae <inki.dae@samsung.com>
Inki Dae [Mon, 17 Jun 2024 09:14:14 +0000 (18:14 +0900)]
log: do built-in log
Just do built-in log. This patch makes log directory to be built-in
instead of building an library file.
Change-Id: I2d374309041b85fe6ded8171d8c3a2bd74c31a36
Signed-off-by: Inki Dae <inki.dae@samsung.com>
Inki Dae [Mon, 17 Jun 2024 06:38:24 +0000 (15:38 +0900)]
fix a memory leak bug
Just fix a memory leak bug by releasing singleo service context
when the service is destroyed.
Change-Id: I8b7856e34d8ff3d171656960d8aa6e6d7c9dac68
Signed-off-by: Inki Dae <inki.dae@samsung.com>
Inki Dae [Mon, 17 Jun 2024 06:16:47 +0000 (15:16 +0900)]
service: code refactoring to ServiceFactory class
Do code refactoring to ServiceFactory class by changing the use
of macro - REGISTER_BACKDEND() - to the use of template.
Change-Id: Idecb462c67150cfdbb0794b14e93124033fa9693
Signed-off-by: Inki Dae <inki.dae@samsung.com>
Inki Dae [Fri, 14 Jun 2024 03:11:28 +0000 (12:11 +0900)]
task_manager: add RunQueueManager support
Add RunQueueManager class which schedules nodes of graph in runtime.
With this patch, we can drop some node dependency from task manager
by making each concrete node to update next nodes which will be
scheduled by task manager.
Change-Id: I7c448aa5ae579b2f61ec2e5b765789f2e82966ad
Signed-off-by: Inki Dae <inki.dae@samsung.com>
Inki Dae [Mon, 17 Jun 2024 03:32:25 +0000 (12:32 +0900)]
fix build error due to Mediavision ACR
Fix build error due to Mediavision ACR.
Recently, Mediavision API has been changed so Mediavision backend
of SingleO framework should be updated.
Change-Id: Icba1b75f0bf0bc06440db38ea9c1d890836f4f8f
Signed-off-by: Inki Dae <inki.dae@samsung.com>
Vibhav Aggarwal [Thu, 13 Jun 2024 08:33:42 +0000 (17:33 +0900)]
task_manager: add rule for unique node name
[issue type] code refactoring
Add rule for unique node names in the task manager.
This will be useful in future for referring to nodes
in the branch node callback.
Change-Id: Ic08134dc225c6b5e6cd5cbafc699608447d346bf
Signed-off-by: Vibhav Aggarwal <v.aggarwal@samsung.com>
Inki Dae [Wed, 12 Jun 2024 07:24:15 +0000 (16:24 +0900)]
auto_zoom: add face recognition support
Add face recognition task node support to Autozoom service.
With this, this patch adds face recognition task for Mediavision
and then adds the face recognition task node in graph pipeline
of Autozoom service.
And also it supports runtime behavior change of the graph pipeline.
I.e., graph pipeline of Autozoom service is as follows,
input --- face detection --- bridge --- face recognition --- endpoint
| |
-------------------------------------------
In this case, we have to consider for two cases,
- if face detection node failed then bridge node should stop to invoke
face recognition node.
- if face detection node worked then bridge node should invoke the
face recognition node.
This means that bridge node has to decide whether next sub graph pipeline
should be invoked or not in runtime. This patch makes this behavior to be
possible.
Ps. face recognition needs pre-trained model so install the model file
after training the model using face recognition training API.
Otherwise, face recognition result will always be 'none'.
Change-Id: I0adfd553285b2e22f551e38fc95a406a0fd9acd5
Signed-off-by: Inki Dae <inki.dae@samsung.com>
Vibhav Aggarwal [Tue, 11 Jun 2024 09:56:06 +0000 (18:56 +0900)]
inference: add support for image classification task
[Issue type] new feature
Change-Id: I30209de4a5fd2b8f45ef15a79caa6b30ea6ddc1a
Signed-off-by: Vibhav Aggarwal <v.aggarwal@samsung.com>
Vibhav Aggarwal [Fri, 7 Jun 2024 03:43:12 +0000 (12:43 +0900)]
task_manager: spawn threads in BFS manner
[Issue type] code optimization
After this change, threads for each node will be spawned
only when any of its dependency nodes has finished processing.
This change greatly reduces the number of sleeping threads in
a large graph.
Change-Id: I4ce9c8bfcf3d6395f3a5cfabc5c160242faea26a
Signed-off-by: Vibhav Aggarwal <v.aggarwal@samsung.com>
Inki Dae [Wed, 5 Jun 2024 06:44:17 +0000 (15:44 +0900)]
task_manager: wait for dependency in threadCb
Wait for dependency in threadCb of each node.
By doing this, it will show more performance than before
because each node is performed in each thread context at the same time.
Change-Id: Ibbd1aafafa110957a0b75a39db78baf6f703b761
Signed-off-by: Inki Dae <inki.dae@samsung.com>
Inki Dae [Tue, 4 Jun 2024 04:13:07 +0000 (13:13 +0900)]
task_manager: update graph verification
Update graph verification by adding _nexts member to check the type of
next node.
Change-Id: Id7fbac1a89d7123c9c008a781c0c3a49a29997e5
Signed-off-by: Inki Dae <inki.dae@samsung.com>
Inki Dae [Tue, 4 Jun 2024 01:51:24 +0000 (10:51 +0900)]
task_manager: check duplicated node
Check duplicated node by introduing isNodeDuplicated function.
Change-Id: Id7eadd1daaa8d8c87ba91df5003c2cd004f09c60
Signed-off-by: Inki Dae <inki.dae@samsung.com>
Inki Dae [Fri, 31 May 2024 08:56:42 +0000 (17:56 +0900)]
introduce SharedBuffer class
Introduce SharedBuffer class which can be commonly used by singleo
sub modules. The purpose of SharedBuffer is to share buffer objects
- such as ImageDataType and RawDataType - between sub modules to avoid
from memory copy.
In this patch, SharedBuffer is used to share the input data objects
between nodes. The shared buffer objects will be released if no nodes
who use the objects.
I.e., with the test case, GraphD
-----> face_landmark_detection --------
... ---> bridge --| |----> ...
-----> face_detection -----------------
Bridge node creates a SharedBuffer object with a new ImageDataType buffer,
and shares the SharedBuffer object with two nodes - one for
face_landmark_detection and other for face_detection without memory copy.
And then the ImageDataType buffer will be released by release() function
of ImageDataType structure after the face_landmark_detection and
face_detection nodes are completed.
In addition, this patch fixes a critial behavior issue that it does deep-copy
even type-casting, which leads unexpected memory leak.
Therefore, this patch moves deep-copy code into clone() of ImageDataType
structure because keeping the deep-copy code in ctor of ImageDataType
structure has two behaviors - one is deep-copy and other is just type-casting.
In general, type-casting never intend deep-copy so it's a wrong behavior.
Change-Id: I29e9ffb2ab8c2bdc9f4fbb67ec5b1591596bb291
Signed-off-by: Inki Dae <inki.dae@samsung.com>
Inki Dae [Thu, 30 May 2024 06:16:52 +0000 (15:16 +0900)]
drop SingleoInputManager
Drop SingleoInputManager and use internal queue of AutoZoom instead.
As for SingleoInputManager, I will introduce a reference counting based
generic buffer manager later, which can be used commonly by other sub modules.
As for now, the use of SingleoInputManager in AutoZoom is over-engineering.
Change-Id: I1c281e5dcbd97d5714b19f74906a0222b9c0b002
Signed-off-by: Inki Dae <inki.dae@samsung.com>
Inki Dae [Thu, 30 May 2024 04:50:30 +0000 (13:50 +0900)]
task_manager: drop unnecessary type casting
Change-Id: I4024fa59419fbd1f7bd234b03fe70e9a1bc4007d
Signed-off-by: Inki Dae <inki.dae@samsung.com>
Inki Dae [Thu, 30 May 2024 02:36:56 +0000 (11:36 +0900)]
auto_zoom: code cleanup with clone() interface
Just code cleanup by adding clone() interface to BaseDataType.
With this interface, we can drop unnecessary casting.
Change-Id: Ia0056e744ff4330e33b6a2e53e3ee4e000d5109e
Signed-off-by: Inki Dae <inki.dae@samsung.com>
Inki Dae [Thu, 30 May 2024 00:51:40 +0000 (09:51 +0900)]
auto_zoom: drop unnecessary code
Just cleanup by dropping unnecessary code.
Change-Id: Ia28d32d57119ce796235d15ae63b84bcec96791f
Signed-off-by: Inki Dae <inki.dae@samsung.com>
Inki Dae [Tue, 28 May 2024 06:32:24 +0000 (15:32 +0900)]
task_manager: delegate collecting the results to each node
Delegate collecting the results to each node. With this, we can use
only generic interface.
Change-Id: I5afd506bbc763fdcd86c18ac3980d295fd894c67
Signed-off-by: Inki Dae <inki.dae@samsung.com>
Inki Dae [Mon, 27 May 2024 02:39:43 +0000 (11:39 +0900)]
clean up with copy-constructor
Clean up with copy-constructor. With this patch,
Manual copy to ImageDataType can be dropped.
Change-Id: I1669ac0fe1706561b903bd59933a9f217f560fce
Signed-off-by: Inki Dae <inki.dae@samsung.com>
Inki Dae [Thu, 23 May 2024 01:49:17 +0000 (10:49 +0900)]
task_manager: drop getters from nodes
Drop getters from nodes by delegating what the getters do to
specific nodes.
Change-Id: Id191f62a2153820a136c500fd29271eecd4f7603
Signed-off-by: Inki Dae <inki.dae@samsung.com>
Inki Dae [Wed, 22 May 2024 06:05:48 +0000 (15:05 +0900)]
task_manager: verify if _nodes is valid graph or not
Verify if _nodes is valid graph or not by checking
- DAG(Direct Acyclic Graph)
- Start node should be a task node such as InferenceNode and TrainingNode.
- Last node should be a EndpointNode.
- BridgeNode should be located bewteen two task nodes such as InferenceNode
and TrainingNode.
- BridgeNode should have a valid callback.
As for DAG verification, this patch uses BFS(Breadth-first search) algorithm.
Change-Id: I33edf100fa81a335ab094b6cfff512c1d2cd749e
Signed-off-by: Inki Dae <inki.dae@samsung.com>
Inki Dae [Tue, 21 May 2024 08:56:20 +0000 (17:56 +0900)]
test: clean up test_task_manager.cpp
Clean up test_task_manager.cpp by dropping printing out messages
and verifying actual results instead.
Change-Id: I931ae19d85af584c276b3848f60616110a19ce1d
Signed-off-by: Inki Dae <inki.dae@samsung.com>
Inki Dae [Mon, 20 May 2024 06:05:00 +0000 (15:05 +0900)]
task_manager: introduce new node types and dropping code smell
Introduce new node types and dropping implicit use of CallbackNode.
Until now, CallbackNode had been used for two purposes implicitly
- one is for bridge and other is endpoint.
So this patch separates CallbackNode into two nodes - BridgeNode and
EndpointNode - so that CallbackNode can be used explicitly, and also
separates InferenceNode into two nodes - InferenceNode and TrainingNode
- by making these two classes to be derived from TaskNode.
As summary,
- InferenceNode and TrainingNode are derived from TaskNode which is able
to perform inference or training through machine learning framework.
- BridgeNode and EndpointNode are derived from CallbackNode which is able
to call an callback registered by user.
With this patch, graph rule of task manager is as follows,
1. Start node should be task node such as InferenceNode and TrainingNode.
2. Last node should be EndpointNode.
3. BridgeNode should be placed bewteen two task nodes such as InferenceNode
and TrainingNode.
4. BridgeNode should have a valid callback but it's optional for other types
of callback nodes.
5. Multiple endpoint nodes can exist.
Change-Id: I4d2917d15cededc3fd11a93afd2db4b6fe5cbe5c
Signed-off-by: Inki Dae <inki.dae@samsung.com>
Inki Dae [Fri, 17 May 2024 07:54:51 +0000 (16:54 +0900)]
task_manager: cleanup to NodeCb
CLeanup to NodeCb by modifying its arguments - dropping all parameters and
add new one instead, shared_ptr<INode> &node.
user_data isn't required anymore because task manager already knows whether
current node is CallbackNode or Not.
Change-Id: I1df5d89149379ed16ed1029536a08036178c0b0b
Signed-off-by: Inki Dae <inki.dae@samsung.com>
Inki Dae [Fri, 17 May 2024 04:00:12 +0000 (13:00 +0900)]
task_manager: drop arguments from callback for CallbackNode
Drop unnecessary arguments from callback for CallbackNode.
Now CallbackNode can act like normal node such as InferenceNode
so drop the unnecessary arguments and get them(input and result)
from CallbackNode itself.
This patch is a step for separating CallbackNode into two nodes
- BridgeNode and EndpointNode - as I shared already, which will drop
the code smell that CallbackNode has two kinds of behaviors.
Change-Id: I25bbc87a1f1d9a82e5c7340b39b8d789599db933
Signed-off-by: Inki Dae <inki.dae@samsung.com>
Inki Dae [Fri, 17 May 2024 00:02:56 +0000 (09:02 +0900)]
task_manager: get results when needed
Change-Id: Ifad7a833c8451435552a5ffb5f240ac6879ee02d
Signed-off-by: Inki Dae <inki.dae@samsung.com>