clean up README file (#5)
author대인기/Tizen Platform Lab(SR)/삼성전자 <inki.dae@samsung.com>
Thu, 11 Apr 2024 02:25:18 +0000 (11:25 +0900)
committerGitHub Enterprise <noreply-CODE@samsung.com>
Thu, 11 Apr 2024 02:25:18 +0000 (11:25 +0900)
* 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>
README.md

index 31578f8cbedbadc7561204f53a03b5029a8d3e58..63fe76413cc9ee48c8591985b930a826738d5c70 100644 (file)
--- a/README.md
+++ b/README.md
@@ -2,33 +2,29 @@
 
 ## Introduction
 
-Existing machine learning frameworks running on the device have so far provided a managed API set that simply executes models and decodes results to deliver them to users. However, with the improvement of embedded hardware performance and development of AI technology, various AI models have been developed and released to meet more complex scenarios on device, and making it very complicated to implement applications to perform this. Therefore, multi-modality on device has become an essential requirement.
+As embedded hardware performance continues to improve and AI technology advances, the need for multi-modality on-device AI solutions has become increasingly important. Existing machine learning frameworks have provided a managed API set that allows developers to execute models and decode results, but implementing complex on-device applications remains a challenge.
 
-To respond to these changes, the **SingleO** AI service framework supports multiple input sources and provides interfaces to easily handle various models. It is designed and implemented to enable input feeding through various input sources such as camera, audio, text, sensor and so on, and also to enable various machine learning frameworks such as media vision, NNStreamer, Mediapipe, and even private external frameworks in a platform-independent manner. In addition, **SingleO** AI service framework has been developed to provide various AI services which are combined with various inputs and even models to users with easy-to-use API set.
+To address these changes, this **SingleO AI Service Framework** has been developed. **SingleO AI Service Framework** supports various types of input sources - such as camera, audio, text, and sensors - and various machine learning frameworks - such as Mediavision, NNStreamer, Mediapipe, and private external frameworks - in platform-independent. In addition, it provides a range of AI services that are combined with various inputs and models for multimodality. These services are made available through easy-to-use API sets, making it simple for developers to incorporate AI into their applications. With the **SingleO AI Service Framework**, on-device AI development has become simpler and more accessible, enabling developers to create innovative and advanced applications that leverage the power of AI on-device.
 
 ## Features
 
-* Platform-independent deployment support for Mediavision, NNStreamer, Mediapipe, and other private external machine learning frameworks
-* Support for various input - such as camera, audio, text, sensor and etc - feeding services
-* Multi-Modality support
-* Provides a unified API set for various AI services
-* Build system support for feature-unit builds
-* Asynchronous behavior API support for optimal performance
-* Postprocessed Camera preview bypass support
+* Support for various input - such as camera, audio, text, sensor and etc - feeding services in platform-independent
+* Support for various machine learning frameworks - such as Mediavision, NNStreamer, Mediapipe and etc - in platform-independent
+* Provide a unified API set for various AI services
+* Support for feature-unit build system
+* Support for asynchronous behavior API for optimal performance
+* Support for postprocessed camera preview bypass
 
-## How to use AI Service API
+## Example for AI Service API
 
-Below example shows how Autozoom Service API is used by application.
+Below example shows how application can use service API for camera autozoom service
 
 ```
-#include <string.h>
 #include <memory>
 
 #include "singleo_native_capi_internal.h"
 #include "singleo_error.h"
 
-using namespace std;
-
 struct Context {
        singleo_service_h handle {};
 };
@@ -41,20 +37,41 @@ void user_callback(unsigned char *buffer, unsigned int width, unsigned int heigh
        // 'buffer' contains postprocessed image data for Autozoom service which emulates autozoom camera device using face or object detection service internally
 }
 
+void autozoom_callback(void *user_data)
+{
+       Context *context = static_cast<Context *>(user_data);
+       singleo_service_h handle = static_cast<singleo_service_h>(context->handle);
+       bool is_loop_exit = false;
+       unsigned long frame_number = 0;
+
+       while (!is_loop_exit) {
+               unsigned int cnt;
+
+               // Get the number of results. If no result then wait until new result is ready
+               int ret = singleo_service_get_result_cnt(handle, &cnt);
+               if (ret != SINGLEO_ERROR_NONE)
+                       break;
+               ...
+       }
+}
+
 int main()
 {
        Context context {};
 
-       int ret = singleo_service_create("service=auto_zoom, input_feed=camera, camera_id=0, fps=30, async=1", &context.handle);
-       ...
-       ret = singleo_service_register_user_callback(context.handle, user_callback, &context);
-       ...
-       ret = singleo_service_perform(context.handle);
-       ...
-       ret = singleo_service_unregister_user_callback(context.handle);
-       ...
-       ret = singleo_service_destroy(context.handle);
-       ...
+       singleo_service_create("service=auto_zoom, input_feed=camera, camera_id=0, fps=30, async=1", &context.handle);
+
+       // Register user callback function to receive postprocessed camera preview image
+       singleo_service_register_user_callback(context.handle, user_callback, &context);
+
+       singleo_service_perform(context.handle);
+
+       unique_ptr<thread> thread_handle = make_unique<thread>(&autozoom_callback, static_cast<void *>(&context));
+
+       thread_handle->join();
+
+       singleo_service_destroy(context.handle);
+
        return 0;
 }
 ```
\ No newline at end of file