{
namespace inference
{
-enum class TaskType { NONE, IMAGE_CLASSIFICATION, OBJECT_DETECTION, FACE_DETECTION, FACE_LANDMARK_DETECTION };
+enum class TaskType { NONE, IMAGE_CLASSIFICATION, OBJECT_DETECTION, FACE_DETECTION, FACE_LANDMARK_DETECTION, HAND_GESTURE};
} // inference
} // singleo
${SINGLEO_SERVICE_SOURCE_FILES}
smart_pointer/src/SmartPointer.cpp
smart_pointer/src/GazeEstimator.cpp
+ smart_pointer/src/HandGestureRecognizer.cpp
smart_pointer/src/FaceShapeModelManager.cpp
smart_pointer/src/HeadPoseEstimator.cpp
smart_pointer/src/CameraParamManager.cpp
--- /dev/null
+/**
+ * Copyright (c) 2024 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 __HAND_GESTURE_RECOGNIZER_H__
+#define __HAND_GESTURE_RECOGNIZER_H__
+
+#include <memory>
+#include "IInferenceHandGestureService.h"
+#include "IInputService.h"
+#include "SingleoInferenceTypes.h"
+
+namespace singleo
+{
+namespace services
+{
+namespace smartpointer
+{
+class HandGestureRecognizer
+{
+private:
+ std::unique_ptr<singleo::inference::IInferenceHandGestureService> _recognizer;
+ std::vector<inference::TaskType> _tasks { inference::TaskType::HAND_GESTURE};
+
+public:
+ explicit HandGestureRecognizer(input::InputConfigBase &config);
+ ~HandGestureRecognizer();
+ int recognizeGesture(BaseDataType &input);
+
+};
+} // smartpointer
+} // services
+} // singleo
+
+#endif
#include "InputTypes.h"
#include "SingleoInputManager.h"
#include "GazeEstimator.h"
+#include "HandGestureRecognizer.h"
#include "InputCamera.h"
#include "AsyncManager.h"
#include "SmartPointerDataType.h"
{
private:
std::unique_ptr<GazeEstimator> _gaze_estimator;
+ std::unique_ptr<HandGestureRecognizer> _gesture_recognizer;
std::unique_ptr<singleo::input::IInputService> _data_feeder;
SingleoInputManager _input_image_data;
PoseVector _head_pose;
--- /dev/null
+/**
+ * Copyright (c) 2024 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 "HandGestureRecognizer.h"
+#include "PrivateInferenceServiceFactory.h"
+#include "InputCamera.h"
+#include "SingleoLog.h"
+
+
+using namespace std;
+using namespace singleo::inference;
+using namespace singleo::input;
+
+namespace singleo
+{
+namespace services
+{
+namespace smartpointer
+{
+HandGestureRecognizer::HandGestureRecognizer(InputConfigBase& config)
+{
+ // MvInferenceServiceFactory factory;
+ PrivateInferenceServiceFactory factory;
+ _recognizer = factory.createInferenceHandGestureService(_tasks);
+
+ _recognizer->configure();
+ _recognizer->prepare();
+}
+
+HandGestureRecognizer::~HandGestureRecognizer()
+{
+
+}
+
+int HandGestureRecognizer::recognizeGesture(BaseDataType &input)
+{
+ SINGLEO_LOGD("HandGestureRecognizer->recognizeGesture");
+ return -1;
+ // _recognizer->invoke(input);
+ // auto &result = _recognizer->result();
+}
+
+} // smartpointer
+} // services
+} // singleo
SmartPointer::SmartPointer(InputConfigBase& config)
{
_gaze_estimator = make_unique<GazeEstimator>(config);
+ _gesture_recognizer = make_unique<HandGestureRecognizer>(config);
if (config._input_feed_type == InputFeedType::CAMERA) {
_data_feeder = make_unique<InputCamera>(dynamic_cast<CameraConfig &>(config));
_data_feeder->setUserCb(internalDataFeederCb, static_cast<void *>(this));
_data_feeder->capture(input_data);
preprocessor.update(input_data);
_head_pose = _gaze_estimator->estimateHeadpose(preprocessor.getData());
+ auto gestureResult = _gesture_recognizer->recognizeGesture(preprocessor.getData());
+
updateResult(_head_pose);
if (_user_cb) {
SINGLEO_LOGD("user callback in perform()");