[ML] Add files structure 69/250169/7
authorRafal Walczyna <r.walczyna@samsung.com>
Mon, 21 Dec 2020 12:43:54 +0000 (13:43 +0100)
committerRafal Walczyna <r.walczyna@samsung.com>
Mon, 4 Jan 2021 11:19:12 +0000 (12:19 +0100)
[Verification] Build successful, tizen.ml.single and tizen.ml.pipeline
are visible in WebApplication

Change-Id: Iddd81dbff6531db9395495ecbbd94f0a9b81f95c
Signed-off-by: Rafal Walczyna <r.walczyna@samsung.com>
14 files changed:
packaging/webapi-plugins.spec
src/ml/js/ml_common.js [new file with mode: 0755]
src/ml/js/ml_manager.js [new file with mode: 0755]
src/ml/js/ml_pipeline.js [new file with mode: 0755]
src/ml/js/ml_single.js [new file with mode: 0755]
src/ml/ml.gyp [new file with mode: 0644]
src/ml/ml_api.js [new file with mode: 0755]
src/ml/ml_extension.cc [new file with mode: 0644]
src/ml/ml_extension.h [new file with mode: 0644]
src/ml/ml_instance.cc [new file with mode: 0644]
src/ml/ml_instance.h [new file with mode: 0644]
src/ml/ml_utils.cc [new file with mode: 0644]
src/ml/ml_utils.h [new file with mode: 0644]
src/tizen-wrt.gyp

index cebe7f4b996ed15c8032707adf3a493bf0b0be05..57019b4494ba62119f2ce6bc66c9510ef6ec4ff1 100644 (file)
@@ -50,7 +50,8 @@ Source0:    %{name}-%{version}.tar.gz
 %define tizen_common_feature_media_key_support               0
 %define tizen_common_feature_message_port_support            1
 %define tizen_common_feature_messaging_support               0
-%define tizen_common_feature_metadata_support      1
+%define tizen_common_feature_metadata_support                1
+%define tizen_common_feature_ml_support                      1
 %define tizen_common_feature_nbs_support                     0
 %define tizen_common_feature_nfc_support                     0
 %define tizen_common_feature_nfc_emulation_support           0
@@ -113,7 +114,8 @@ Source0:    %{name}-%{version}.tar.gz
 %define tizen_mobile_feature_media_key_support               1
 %define tizen_mobile_feature_message_port_support            1
 %define tizen_mobile_feature_messaging_support               1
-%define tizen_mobile_feature_metadata_support      1
+%define tizen_mobile_feature_metadata_support                1
+%define tizen_mobile_feature_ml_support                      1
 %define tizen_mobile_feature_nfc_support                     0
 %define tizen_mobile_feature_nfc_emulation_support           0
 %define tizen_mobile_feature_notification_support            1
@@ -220,7 +222,8 @@ Source0:    %{name}-%{version}.tar.gz
 %define tizen_wearable_feature_media_key_support               1
 %define tizen_wearable_feature_message_port_support            1
 %define tizen_wearable_feature_messaging_support               0
-%define tizen_wearable_feature_metadata_support      1
+%define tizen_wearable_feature_metadata_support                1
+%define tizen_wearable_feature_ml_support                      1
 %define tizen_wearable_feature_nfc_support                     1
 %define tizen_wearable_feature_nfc_emulation_support           0
 %define tizen_wearable_feature_notification_support            1
@@ -300,7 +303,8 @@ Source0:    %{name}-%{version}.tar.gz
 %define tizen_tv_feature_media_key_support               0
 %define tizen_tv_feature_message_port_support            1
 %define tizen_tv_feature_messaging_support               0
-%define tizen_tv_feature_metadata_support      1
+%define tizen_tv_feature_metadata_support                1
+%define tizen_tv_feature_ml_support                      1
 %define tizen_tv_feature_nbs_support                     0
 %define tizen_tv_feature_nfc_support                     0
 %define tizen_tv_feature_nfc_emulation_support           0
@@ -360,6 +364,7 @@ Source0:    %{name}-%{version}.tar.gz
 %define tizen_feature_media_key_support               %{expand:%tizen_%{?profile}_feature_media_key_support}
 %define tizen_feature_message_port_support            %{expand:%tizen_%{?profile}_feature_message_port_support}
 %define tizen_feature_messaging_support               %{expand:%tizen_%{?profile}_feature_messaging_support}
+%define tizen_feature_ml_support                      %{expand:%tizen_%{?profile}_feature_ml_support}
 %define tizen_feature_nfc_emulation_support           %{expand:%tizen_%{?profile}_feature_nfc_emulation_support}
 %define tizen_feature_nfc_support                     %{expand:%tizen_%{?profile}_feature_nfc_support}
 %define tizen_feature_notification_support            %{expand:%tizen_%{?profile}_feature_notification_support}
@@ -517,6 +522,11 @@ BuildRequires:  pkgconfig(msg-service)
 BuildRequires:  pkgconfig(db-util)
 %endif
 
+%if "%{?tizen_feature_ml_support}" == "1" || "%{?unified_build}" == "1"
+BuildRequires: pkgconfig(nnstreamer)
+BuildRequires: pkgconfig(capi-nnstreamer)
+%endif
+
 %if "%{?tizen_feature_badge_support}" == "1" || "%{?unified_build}" == "1"
 BuildRequires:  pkgconfig(badge)
 %endif
@@ -717,6 +727,7 @@ GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_media_key_support=%{?tizen_mobile_feat
 GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_message_port_support=%{?tizen_mobile_feature_message_port_support}"
 GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_messaging_support=%{?tizen_mobile_feature_messaging_support}"
 GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_metadata_support=%{?tizen_mobile_feature_metadata_support}"
+GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_ml_support=%{?tizen_mobile_feature_ml_support}"
 GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_nbs_support=%{?tizen_mobile_feature_nbs_support}"
 GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_nfc_emulation_support=%{?tizen_mobile_feature_nfc_emulation_support}"
 GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_nfc_support=%{?tizen_mobile_feature_nfc_support}"
@@ -807,6 +818,7 @@ GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_media_key_support=%{?tizen_mobile_feat
 GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_message_port_support=%{?tizen_mobile_feature_message_port_support}"
 GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_messaging_support=%{?tizen_mobile_feature_messaging_support}"
 GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_metadata_support=%{?tizen_mobile_feature_metadata_support}"
+GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_ml_support=%{?tizen_mobile_feature_ml_support}"
 GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_nbs_support=%{?tizen_mobile_feature_nbs_support}"
 GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_nfc_emulation_support=%{?tizen_mobile_feature_nfc_emulation_support}"
 GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_nfc_support=%{?tizen_mobile_feature_nfc_support}"
@@ -885,6 +897,7 @@ GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_media_key_support=%{?tizen_wearable_fe
 GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_message_port_support=%{?tizen_wearable_feature_message_port_support}"
 GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_messaging_support=%{?tizen_wearable_feature_messaging_support}"
 GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_metadata_support=%{?tizen_wearable_feature_metadata_support}"
+GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_ml_support=%{?tizen_wearable_feature_ml_support}"
 GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_nbs_support=%{?tizen_wearable_feature_nbs_support}"
 GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_nfc_emulation_support=%{?tizen_wearable_feature_nfc_emulation_support}"
 GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_nfc_support=%{?tizen_wearable_feature_nfc_support}"
@@ -970,6 +983,7 @@ GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_media_key_support=%{?tizen_wearable_fe
 GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_message_port_support=%{?tizen_wearable_feature_message_port_support}"
 GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_messaging_support=%{?tizen_wearable_feature_messaging_support}"
 GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_metadata_support=%{?tizen_wearable_feature_metadata_support}"
+GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_ml_support=%{?tizen_wearable_feature_ml_support}"
 GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_nbs_support=%{?tizen_wearable_feature_nbs_support}"
 GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_nfc_emulation_support=%{?tizen_wearable_feature_nfc_emulation_support}"
 GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_nfc_support=%{?tizen_wearable_feature_nfc_support}"
@@ -1048,6 +1062,7 @@ GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_media_key_support=%{?tizen_tv_feature_
 GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_message_port_support=%{?tizen_tv_feature_message_port_support}"
 GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_messaging_support=%{?tizen_tv_feature_messaging_support}"
 GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_metadata_support=%{?tizen_tv_feature_metadata_support}"
+GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_ml_support=%{?tizen_tv_feature_ml_support}"
 GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_nbs_support=%{?tizen_tv_feature_nbs_support}"
 GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_nfc_emulation_support=%{?tizen_tv_feature_nfc_emulation_support}"
 GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_nfc_support=%{?tizen_tv_feature_nfc_support}"
@@ -1124,6 +1139,7 @@ GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_media_key_support=%{?tizen_common_feat
 GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_message_port_support=%{?tizen_common_feature_message_port_support}"
 GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_messaging_support=%{?tizen_common_feature_messaging_support}"
 GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_metadata_support=%{?tizen_common_feature_metadata_support}"
+GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_ml_support=%{?tizen_common_feature_ml_support}"
 GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_nbs_support=%{?tizen_common_feature_nbs_support}"
 GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_nfc_emulation_support=%{?tizen_common_feature_nfc_emulation_support}"
 GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_nfc_support=%{?tizen_common_feature_nfc_support}"
diff --git a/src/ml/js/ml_common.js b/src/ml/js/ml_common.js
new file mode 100755 (executable)
index 0000000..21819da
--- /dev/null
@@ -0,0 +1,151 @@
+/*
+ * Copyright (c) 2020 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ *    Licensed under the Apache License, Version 2.0 (the "License");
+ *    you may not use this file except in compliance with the License.
+ *    You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *    Unless required by applicable law or agreed to in writing, software
+ *    distributed under the License is distributed on an "AS IS" BASIS,
+ *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *    See the License for the specific language governing permissions and
+ *    limitations under the License.
+ */
+
+var privUtils_ = xwalk.utils;
+var validator_ = privUtils_.validator;
+var types_ = validator_.Types;
+
+// TensorRawData
+
+var TensorRawData = function() {
+    Object.defineProperties(this, {
+        data: {
+            enumerable: true,
+            get: function() {
+                throw new WebAPIException(WebAPIException.ABORT_ERR, 'Not implemented');
+            }
+        },
+        size: {
+            enumerable: true,
+            get: function() {
+                throw new WebAPIException(WebAPIException.ABORT_ERR, 'Not implemented');
+            }
+        },
+        shape: {
+            enumerable: true,
+            get: function() {
+                throw new WebAPIException(WebAPIException.ABORT_ERR, 'Not implemented');
+            }
+        }
+    });
+};
+
+var TensorType = {
+    INT8: 'INT8',
+    UINT8: 'UINT8',
+    INT16: 'INT16',
+    UINT16: 'UINT16',
+    FLOAT32: 'FLOAT32',
+    INT32: 'INT32',
+    UINT32: 'UINT32',
+    FLOAT64: 'FLOAT64',
+    INT64: 'INT64',
+    UINT64: 'UINT64',
+    UNKNOWN: 'UNKNOWN'
+};
+
+// TensorsData
+
+var TensorsData = function() {
+    Object.defineProperties(this, {
+        count: {
+            enumerable: true,
+            get: function() {
+                throw new WebAPIException(WebAPIException.ABORT_ERR, 'Not implemented');
+            }
+        },
+        tensorsInfo : {
+            enumerable: true,
+            get: function() {
+                throw new WebAPIException(WebAPIException.ABORT_ERR, 'Not implemented');
+            }
+        }
+    });
+};
+
+TensorsData.prototype.getTensorRawData = function() {
+    throw new WebAPIException(WebAPIException.ABORT_ERR, 'Not implemented');
+};
+
+TensorsData.prototype.setTensorData = function() {
+    throw new WebAPIException(WebAPIException.ABORT_ERR, 'Not implemented');
+};
+
+TensorsData.prototype.dispose = function() {
+    throw new WebAPIException(WebAPIException.ABORT_ERR, 'Not implemented');
+};
+
+// TensorsInfo
+
+var TensorsInfo = function() {
+    validator_.isConstructorCall(this, TensorsInfo);
+    Object.defineProperties(this, {
+        count: {
+            enumerable: true,
+            get: function() {
+                throw new WebAPIException(WebAPIException.ABORT_ERR, 'Not implemented');
+            }
+        }
+    });
+};
+
+TensorsInfo.prototype.addTensorInfo = function() {
+    throw new WebAPIException(WebAPIException.ABORT_ERR, 'Not implemented');
+};
+
+TensorsInfo.prototype.clone = function() {
+    throw new WebAPIException(WebAPIException.ABORT_ERR, 'Not implemented');
+};
+
+TensorsInfo.prototype.equals = function() {
+    throw new WebAPIException(WebAPIException.ABORT_ERR, 'Not implemented');
+};
+
+TensorsInfo.prototype.getDimensions = function() {
+    throw new WebAPIException(WebAPIException.ABORT_ERR, 'Not implemented');
+};
+
+TensorsInfo.prototype.setDimensions = function() {
+    throw new WebAPIException(WebAPIException.ABORT_ERR, 'Not implemented');
+};
+
+TensorsInfo.prototype.getTensorName = function() {
+    throw new WebAPIException(WebAPIException.ABORT_ERR, 'Not implemented');
+};
+
+TensorsInfo.prototype.setTensorName = function() {
+    throw new WebAPIException(WebAPIException.ABORT_ERR, 'Not implemented');
+};
+
+TensorsInfo.prototype.getTensorType = function() {
+    throw new WebAPIException(WebAPIException.ABORT_ERR, 'Not implemented');
+};
+
+TensorsInfo.prototype.setTensorType = function() {
+    throw new WebAPIException(WebAPIException.ABORT_ERR, 'Not implemented');
+};
+
+TensorsInfo.prototype.getTensorSize = function() {
+    throw new WebAPIException(WebAPIException.ABORT_ERR, 'Not implemented');
+};
+
+TensorsInfo.prototype.getTensorsData = function() {
+    throw new WebAPIException(WebAPIException.ABORT_ERR, 'Not implemented');
+};
+
+TensorsInfo.prototype.dispose = function() {
+    throw new WebAPIException(WebAPIException.ABORT_ERR, 'Not implemented');
+};
diff --git a/src/ml/js/ml_manager.js b/src/ml/js/ml_manager.js
new file mode 100755 (executable)
index 0000000..549bcdd
--- /dev/null
@@ -0,0 +1,28 @@
+/*
+ * Copyright (c) 2020 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ *    Licensed under the Apache License, Version 2.0 (the "License");
+ *    you may not use this file except in compliance with the License.
+ *    You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *    Unless required by applicable law or agreed to in writing, software
+ *    distributed under the License is distributed on an "AS IS" BASIS,
+ *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *    See the License for the specific language governing permissions and
+ *    limitations under the License.
+ */
+
+var MachineLearningManager = function() {};
+
+MachineLearningManager.prototype.single = new MachineLearningSingle();
+
+MachineLearningManager.prototype.pipeline = new MachineLearningPipeline();
+
+MachineLearningManager.prototype.checkNNFWAvailability = function() {
+    throw new WebAPIException(WebAPIException.ABORT_ERR, 'Not implemented');
+};
+
+exports = new MachineLearningManager();
+exports.TensorsInfo = TensorsInfo;
diff --git a/src/ml/js/ml_pipeline.js b/src/ml/js/ml_pipeline.js
new file mode 100755 (executable)
index 0000000..1aa4728
--- /dev/null
@@ -0,0 +1,19 @@
+/*
+ * Copyright (c) 2020 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ *    Licensed under the Apache License, Version 2.0 (the "License");
+ *    you may not use this file except in compliance with the License.
+ *    You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *    Unless required by applicable law or agreed to in writing, software
+ *    distributed under the License is distributed on an "AS IS" BASIS,
+ *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *    See the License for the specific language governing permissions and
+ *    limitations under the License.
+ */
+
+var MachineLearningPipeline = function() {};
+
+// ML Pipeline API
diff --git a/src/ml/js/ml_single.js b/src/ml/js/ml_single.js
new file mode 100755 (executable)
index 0000000..923af0a
--- /dev/null
@@ -0,0 +1,19 @@
+/*
+ * Copyright (c) 2020 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ *    Licensed under the Apache License, Version 2.0 (the "License");
+ *    you may not use this file except in compliance with the License.
+ *    You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *    Unless required by applicable law or agreed to in writing, software
+ *    distributed under the License is distributed on an "AS IS" BASIS,
+ *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *    See the License for the specific language governing permissions and
+ *    limitations under the License.
+ */
+
+var MachineLearningSingle = function() {};
+
+// ML Single API
diff --git a/src/ml/ml.gyp b/src/ml/ml.gyp
new file mode 100644 (file)
index 0000000..b21279a
--- /dev/null
@@ -0,0 +1,33 @@
+{
+  'includes':[
+    '../common/common.gypi',
+  ],
+  'targets': [
+    {
+      'target_name': 'tizen_ml',
+      'type': 'loadable_module',
+      'dependencies': [
+        '../common/common.gyp:tizen_common',
+      ],
+      'sources': [
+        'ml_api.js',
+        'ml_extension.cc',
+        'ml_extension.h',
+        'ml_instance.cc',
+        'ml_instance.h',
+        'ml_utils.cc',
+        'ml_utils.h',
+      ],
+      'conditions': [
+        ['tizen == 1', {
+          'variables': {
+            'packages': [
+              'nnstreamer',
+              'capi-nnstreamer',
+            ]
+          },
+        }],
+      ],
+    },
+  ],
+}
\ No newline at end of file
diff --git a/src/ml/ml_api.js b/src/ml/ml_api.js
new file mode 100755 (executable)
index 0000000..316fb4e
--- /dev/null
@@ -0,0 +1,20 @@
+/*
+ * Copyright (c) 2020 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ *    Licensed under the Apache License, Version 2.0 (the "License");
+ *    you may not use this file except in compliance with the License.
+ *    You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *    Unless required by applicable law or agreed to in writing, software
+ *    distributed under the License is distributed on an "AS IS" BASIS,
+ *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *    See the License for the specific language governing permissions and
+ *    limitations under the License.
+ */
+
+//= require('ml_common.js');
+//= require('ml_single.js');
+//= require('ml_pipeline.js');
+//= require('ml_manager.js');
diff --git a/src/ml/ml_extension.cc b/src/ml/ml_extension.cc
new file mode 100644 (file)
index 0000000..391f2d6
--- /dev/null
@@ -0,0 +1,44 @@
+/*
+ * Copyright (c) 2020 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ *    Licensed under the Apache License, Version 2.0 (the "License");
+ *    you may not use this file except in compliance with the License.
+ *    You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *    Unless required by applicable law or agreed to in writing, software
+ *    distributed under the License is distributed on an "AS IS" BASIS,
+ *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *    See the License for the specific language governing permissions and
+ *    limitations under the License.
+ */
+
+#include "ml_extension.h"
+#include "ml_instance.h"
+
+#include "common/logger.h"
+
+namespace {}
+
+// This will be generated from ml_api.js.
+extern const char kSource_ml_api[];
+
+common::Extension* CreateExtension() {
+  ScopeLogger();
+  return new MlExtension;
+}
+
+MlExtension::MlExtension() {
+  ScopeLogger();
+  SetExtensionName("tizen.ml");
+  SetJavaScriptAPI(kSource_ml_api);
+}
+
+MlExtension::~MlExtension() {
+}
+
+common::Instance* MlExtension::CreateInstance() {
+  ScopeLogger();
+  return new extension::ml::MlInstance();
+}
diff --git a/src/ml/ml_extension.h b/src/ml/ml_extension.h
new file mode 100644 (file)
index 0000000..546a810
--- /dev/null
@@ -0,0 +1,31 @@
+/*
+ * Copyright (c) 2020 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ *    Licensed under the Apache License, Version 2.0 (the "License");
+ *    you may not use this file except in compliance with the License.
+ *    You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *    Unless required by applicable law or agreed to in writing, software
+ *    distributed under the License is distributed on an "AS IS" BASIS,
+ *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *    See the License for the specific language governing permissions and
+ *    limitations under the License.
+ */
+
+#ifndef ML_EXTENSION_H_
+#define ML_EXTENSION_H_
+
+#include "common/extension.h"
+
+class MlExtension : public common::Extension {
+ public:
+  MlExtension();
+  virtual ~MlExtension();
+
+ private:
+  virtual common::Instance* CreateInstance();
+};
+
+#endif  // ML_EXTENSION_H_
diff --git a/src/ml/ml_instance.cc b/src/ml/ml_instance.cc
new file mode 100644 (file)
index 0000000..ec1e267
--- /dev/null
@@ -0,0 +1,65 @@
+/*
+ * Copyright (c) 2020 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ *    Licensed under the Apache License, Version 2.0 (the "License");
+ *    you may not use this file except in compliance with the License.
+ *    You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *    Unless required by applicable law or agreed to in writing, software
+ *    distributed under the License is distributed on an "AS IS" BASIS,
+ *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *    See the License for the specific language governing permissions and
+ *    limitations under the License.
+ */
+
+#include "ml_instance.h"
+
+#include "common/logger.h"
+#include "common/picojson.h"
+
+namespace extension {
+namespace ml {
+
+using namespace common;
+
+MlInstance::MlInstance() {
+  ScopeLogger();
+  using namespace std::placeholders;
+
+#define REGISTER_METHOD(M) RegisterSyncHandler(#M, std::bind(&MlInstance::M, this, _1, _2))
+
+// Common ML API begin
+
+// Common ML API end
+
+// Single API begin
+
+// Single API end
+
+// Pipeline API begin
+
+// Pipeline API end
+
+#undef REGISTER_METHOD
+}
+
+MlInstance::~MlInstance() {
+  ScopeLogger();
+}
+
+// Common ML API begin
+
+// Common ML API end
+
+// Single API begin
+
+// Single API end
+
+// Pipeline API begin
+
+// Pipeline API end
+
+}  // namespace ml
+}  // namespace extension
diff --git a/src/ml/ml_instance.h b/src/ml/ml_instance.h
new file mode 100644 (file)
index 0000000..fc179d2
--- /dev/null
@@ -0,0 +1,50 @@
+/*
+ * Copyright (c) 2020 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ *    Licensed under the Apache License, Version 2.0 (the "License");
+ *    you may not use this file except in compliance with the License.
+ *    You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *    Unless required by applicable law or agreed to in writing, software
+ *    distributed under the License is distributed on an "AS IS" BASIS,
+ *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *    See the License for the specific language governing permissions and
+ *    limitations under the License.
+ */
+
+#ifndef ML_ML_INSTANCE_H_
+#define ML_ML_INSTANCE_H_
+
+#include "common/extension.h"
+
+#include "nnstreamer/nnstreamer-single.h"
+#include "nnstreamer/nnstreamer.h"
+
+namespace extension {
+namespace ml {
+
+class MlInstance : public common::ParsedInstance {
+ public:
+  MlInstance();
+  virtual ~MlInstance();
+
+ private:
+  // Common ML API begin
+
+  // Common ML API end
+
+  // Single API begin
+
+  // Single API end
+
+  // Pipeline API begin
+
+  // Pipeline API end
+};
+
+}  // namespace ml
+}  // namespace extension
+
+#endif  // ML_ML_INSTANCE_H_
diff --git a/src/ml/ml_utils.cc b/src/ml/ml_utils.cc
new file mode 100644 (file)
index 0000000..44987d8
--- /dev/null
@@ -0,0 +1,31 @@
+/*
+ * Copyright (c) 2020 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ *    Licensed under the Apache License, Version 2.0 (the "License");
+ *    you may not use this file except in compliance with the License.
+ *    You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *    Unless required by applicable law or agreed to in writing, software
+ *    distributed under the License is distributed on an "AS IS" BASIS,
+ *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *    See the License for the specific language governing permissions and
+ *    limitations under the License.
+ */
+
+#include <memory>
+
+#include "ml_utils.h"
+
+#include "common/logger.h"
+
+namespace extension {
+namespace ml {
+namespace util {
+
+using namespace common;
+
+}  // util
+}  // ml
+}  // extension
diff --git a/src/ml/ml_utils.h b/src/ml/ml_utils.h
new file mode 100644 (file)
index 0000000..3424aad
--- /dev/null
@@ -0,0 +1,29 @@
+/*
+ * Copyright (c) 2020 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ *    Licensed under the Apache License, Version 2.0 (the "License");
+ *    you may not use this file except in compliance with the License.
+ *    You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *    Unless required by applicable law or agreed to in writing, software
+ *    distributed under the License is distributed on an "AS IS" BASIS,
+ *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *    See the License for the specific language governing permissions and
+ *    limitations under the License.
+ */
+
+#ifndef ML_ML_UTILS_H_
+#define ML_ML_UTILS_H_
+
+#include "common/picojson.h"
+#include "common/platform_result.h"
+
+namespace extension {
+namespace ml {
+namespace util {}  // util
+}  // ml
+}  // extension
+
+#endif  // ML_ML_UTILS_H_
index 9235bf2e08f878980c8c09ec9dd8689875bdcd9e..517a17bc210d59fdac8ea1e07737720f396189ca 100755 (executable)
@@ -12,6 +12,7 @@
         'common/common.gyp:*',
         'tizen/tizen.gyp:*',
         'utils/utils.gyp:*',
+        'ml/ml.gyp:*',
       ],
       'conditions': [
         [