1 #ifdef USE_3D_ADAM_MODEL
2 #ifndef OPENPOSE_3D_W_JOINT_ANGLE_ESTIMATION_HPP
3 #define OPENPOSE_3D_W_JOINT_ANGLE_ESTIMATION_HPP
11 template<
typename TDatums>
12 class WJointAngleEstimation :
public Worker<TDatums>
15 explicit WJointAngleEstimation(
const std::shared_ptr<JointAngleEstimation>& jointAngleEstimation);
17 virtual ~WJointAngleEstimation();
19 void initializationOnThread();
21 void work(TDatums& tDatums);
24 const std::shared_ptr<JointAngleEstimation> spJointAngleEstimation;
38 template<
typename TDatums>
39 WJointAngleEstimation<TDatums>::WJointAngleEstimation(
const std::shared_ptr<JointAngleEstimation>& jointAngleEstimation) :
40 spJointAngleEstimation{jointAngleEstimation}
44 template<
typename TDatums>
45 WJointAngleEstimation<TDatums>::~WJointAngleEstimation()
49 template<
typename TDatums>
50 void WJointAngleEstimation<TDatums>::initializationOnThread()
54 spJointAngleEstimation->initializationOnThread();
56 catch (
const std::exception& e)
58 error(e.what(), __LINE__, __FUNCTION__, __FILE__);
62 template<
typename TDatums>
63 void WJointAngleEstimation<TDatums>::work(TDatums& tDatums)
70 opLogIfDebug(
"", Priority::Low, __LINE__, __FUNCTION__, __FILE__);
72 const auto profilerKey = Profiler::timerInit(__LINE__, __FUNCTION__, __FILE__);
74 auto& tDatumPtr = tDatums->at(0);
75 const auto& poseKeypoints3D = tDatumPtr->poseKeypoints3D;
76 const auto& faceKeypoints3D = tDatumPtr->faceKeypoints3D;
77 const auto& handKeypoints3D = tDatumPtr->handKeypoints3D;
79 spJointAngleEstimation->adamFastFit(
80 tDatumPtr->adamPose, tDatumPtr->adamTranslation, tDatumPtr->vtVec, tDatumPtr->j0Vec,
81 tDatumPtr->adamFaceCoeffsExp, poseKeypoints3D, faceKeypoints3D, handKeypoints3D);
83 Profiler::timerEnd(profilerKey);
84 Profiler::printAveragedTimeMsOnIterationX(profilerKey, __LINE__, __FUNCTION__, __FILE__);
86 opLogIfDebug(
"", Priority::Low, __LINE__, __FUNCTION__, __FILE__);
89 catch (
const std::exception& e)
93 error(e.what(), __LINE__, __FUNCTION__, __FILE__);
#define COMPILE_TEMPLATE_DATUM(templateName)
#define DELETE_COPY(className)
bool checkNoNullNorEmpty(const TPointerContainer &tPointerContainer)
OP_API void error(const std::string &message, const int line=-1, const std::string &function="", const std::string &file="")
void opLogIfDebug(const T &message, const Priority priority=Priority::Max, const int line=-1, const std::string &function="", const std::string &file="")