smart_pointer/src/SmartPointer.cpp
smart_pointer/src/GazeEstimator.cpp
smart_pointer/src/FaceShapeModelManager.cpp
+ smart_pointer/src/HeadPoseEstimator.cpp
)
LIST(APPEND SERVICE_LIBRARY_LIST singleo_inference)
\ No newline at end of file
public:
FaceShapeModelManager(const std::string &model_path);
~FaceShapeModelManager();
+ const std::vector<Point3f> &getFaceShape();
};
} // smartpointer
} // services
} // singleo
-#endif
+#endif
\ No newline at end of file
private:
std::unique_ptr<singleo::inference::IInferenceFaceService> _face_estimator;
std::unique_ptr<singleo::input::IInputService> _input_service;
- std::unique_ptr<FaceShapeModelManager> _face_shape_model_manager;
std::vector<inference::TaskType> _tasks { inference::TaskType::FACE_DETECTION, inference::TaskType::FACE_LANDMARK_DETECTION };
--- /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 __HEAD_POSE_ESTIMATOR_H__
+#define __HEAD_POSE_ESTIMATOR_H__
+
+#include <memory>
+#include <vector>
+#include <opencv2/core.hpp>
+#include <opencv2/calib3d.hpp>
+
+namespace singleo
+{
+namespace services
+{
+namespace smartpointer
+{
+class HeadPoseEstimator
+{
+private:
+ std::vector<cv::Point2f> _landmarks_2d;
+ std::vector<cv::Point3f> _landmarks_3d;
+
+public:
+ HeadPoseEstimator();
+ ~HeadPoseEstimator();
+};
+} // smartpointer
+} // services
+} // singleo
+
+#endif
SINGLEO_LOGI("%zd landarks", _faceShape.size());
}
+const vector<Point3f> &FaceShapeModelManager::getFaceShape()
+{
+ return _faceShape;
+}
+
template float FaceShapeModelManager::ToNumber(const string &text);
} // smartpointer
} // services
_face_estimator->configure();
_face_estimator->prepare();
- _face_shape_model_manager = make_unique<FaceShapeModelManager>("/usr/share/singleo/pdm.txt");
_headPose.reset();
}
--- /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 "FaceShapeModelManager.h"
+#include "HeadPoseEstimator.h"
+#include "SingleoLog.h"
+
+using namespace std;
+using namespace cv;
+
+namespace singleo
+{
+namespace services
+{
+namespace smartpointer
+{
+HeadPoseEstimator::HeadPoseEstimator()
+{
+ FaceShapeModelManager faceShapeModelmgr("/usr/share/singleo/pdm.txt");
+ const vector<Point3f> faceShape = faceShapeModelmgr.getFaceShape();
+
+ for (auto &point : faceShape)
+ _landmarks_3d.push_back(cv::Point3f(point.x, point.y, point.z));
+
+}
+
+HeadPoseEstimator::~HeadPoseEstimator()
+{
+
+}
+
+} // smartpointer
+} // services
+} // singleo