PrivateInferenceHandGestureService has a dummy implementation.
MvInferenceHandGestureService isn't implemented and
createInferenceHandGestureService() will throw runtime_error.
Change-Id: If34b238424a1417590c85068f71129c6410f40a1
Signed-off-by: Tae-Young Chung <ty83.chung@samsung.com>
FIND_PACKAGE(PkgConfig REQUIRED)
PKG_CHECK_MODULES(${PROJECT_NAME}_DEP REQUIRED capi-media-vision opencv facedetection)
-TARGET_INCLUDE_DIRECTORIES(${PROJECT_NAME} PRIVATE ../include ../../common/include ../../log/include mediavision/include /usr/include/media private/include /usr/include/facedetection)
+TARGET_INCLUDE_DIRECTORIES(${PROJECT_NAME} PRIVATE ../include ../../common/include ../../log/include mediavision/include /usr/include/media private/include /usr/include/facedetection /usr/include/mediapipe)
TARGET_LINK_LIBRARIES(${PROJECT_NAME} PRIVATE mv_common singleo_log ${${PROJECT_NAME}_DEP_LIBRARIES} )
# Install the library
--- /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 __PRIVATE_INFERENCE_HAND_GESTURE_SERVICE_H__
+#define __PRIVATE_INFERENCE_HAND_GESTURE_SERVICE_H__
+
+#include <memory>
+#include <vector>
+#include <opencv2/core.hpp>
+#include "IInferenceHandGestureService.h"
+
+namespace singleo
+{
+namespace inference
+{
+class PrivateInferenceHandGestureService : public IInferenceHandGestureService
+{
+private:
+
+ HandGestureResult _result;
+
+public:
+ PrivateInferenceHandGestureService(std::vector<inference::TaskType> &tasks);
+ virtual ~PrivateInferenceHandGestureService();
+ void configure() override;
+ void prepare() override;
+ void invoke(BaseDataType &input) override;
+ HandGestureResult &result() override;
+};
+
+} // inference
+} // singleo
+
+#endif
\ No newline at end of file
--- /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 "SingleoCommonTypes.h"
+#include "SingleoLog.h"
+#include "PrivateInferenceHandGestureService.h"
+#include "SingleoTimer.h"
+
+#include <opencv2/core.hpp>
+#include <opencv2/imgcodecs.hpp>
+#include <opencv2/imgproc.hpp>
+#include "IHand.h"
+
+using namespace std;
+#define DETECT_BUFFER_SIZE 0x9000
+namespace singleo
+{
+namespace inference
+{
+
+
+PrivateInferenceHandGestureService::PrivateInferenceHandGestureService(std::vector<inference::TaskType> &tasks)
+{
+
+}
+
+PrivateInferenceHandGestureService::~PrivateInferenceHandGestureService()
+{
+
+}
+
+void PrivateInferenceHandGestureService::configure()
+{
+
+}
+
+void PrivateInferenceHandGestureService::prepare()
+{
+
+}
+
+void PrivateInferenceHandGestureService::invoke(BaseDataType &input)
+{
+
+}
+
+HandGestureResult& PrivateInferenceHandGestureService::result()
+{
+ return _result;
+}
+} // inference
+} // singleo
\ No newline at end of file
--- /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 __INFERENCE_SERVICE_HAND_GESTURE_RESULT_H__
+#define __INFERENCE_SERVICE_HAND_GESTURE_RESULT_H__
+
+#include "SingleoCommonTypes.h"
+
+namespace singleo
+{
+namespace inference
+{
+using Points = std::vector<Point>;
+struct HandGestureResult {
+ unsigned int _frame_number {};
+ int _gestureId;
+};
+} // inference
+} // singleo
+
+#endif
--- /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 __IINFERENCE_HAND_GESTURE_SERVICE_H__
+#define __IINFERENCE_HAND_GESTURE_SERVICE_H__
+
+#include "HandGestureResult.h"
+#include "SingleoInferenceTypes.h"
+#include "FaceShapeComponents.h"
+
+namespace singleo
+{
+namespace inference
+{
+class IInferenceHandGestureService
+{
+public:
+ virtual ~IInferenceHandGestureService() {};
+
+ virtual void configure() = 0;
+ virtual void prepare() = 0;
+ virtual void invoke(BaseDataType &input) = 0;
+ virtual HandGestureResult &result() = 0;
+};
+
+} // inference
+} // singleo
+
+#endif
\ No newline at end of file
#include <memory>
#include "IInferenceFaceService.h"
+#include "IInferenceHandGestureService.h"
#include "SingleoInferenceTypes.h"
namespace singleo
{
public:
virtual std::unique_ptr<IInferenceFaceService> createInferenceFaceService(std::vector<inference::TaskType> &tasks) = 0;
+ virtual std::unique_ptr<IInferenceHandGestureService> createInferenceHandGestureService(std::vector<inference::TaskType> &tasks) = 0;
};
} // inference
{
public:
std::unique_ptr<IInferenceFaceService> createInferenceFaceService(std::vector<inference::TaskType> &tasks) override;
+ std::unique_ptr<IInferenceHandGestureService> createInferenceHandGestureService(std::vector<inference::TaskType> &tasks) override;
};
} // inference
{
public:
std::unique_ptr<IInferenceFaceService> createInferenceFaceService(std::vector<inference::TaskType> &tasks) override;
+ std::unique_ptr<IInferenceHandGestureService> createInferenceHandGestureService(std::vector<inference::TaskType> &tasks) override;
};
} // inference
{
return make_unique<MvInferenceFaceService>(tasks);
}
+unique_ptr<IInferenceHandGestureService> MvInferenceServiceFactory::createInferenceHandGestureService(std::vector<inference::TaskType> &tasks)
+{
+ throw runtime_error("Not implemented");
+}
} // inference
} // singleo
\ No newline at end of file
#include "PrivateInferenceServiceFactory.h"
#include "PrivateInferenceFaceService.h"
+#include "PrivateInferenceHandGestureService.h"
using namespace std;
{
return make_unique<PrivateInferenceFaceService>(tasks);
}
+unique_ptr<IInferenceHandGestureService> PrivateInferenceServiceFactory::createInferenceHandGestureService(std::vector<inference::TaskType> &tasks)
+{
+ return make_unique<PrivateInferenceHandGestureService>(tasks);
+}
} // inference
} // singleo
\ No newline at end of file
BuildRequires: pkgconfig(grpc++)
BuildRequires: pkgconfig(re2)
BuildRequires: pkgconfig(facedetection)
+BuildRequires: mediapipe-devel
+# BuildRequires: mediapipe-image-segmentation
%define enable_autozoom_api 0
%define enable_smartpointer 1