1 #ifndef OPENPOSE_POSE_W_POSE_EXTRACTOR_HPP
2 #define OPENPOSE_POSE_W_POSE_EXTRACTOR_HPP
10 template<
typename TDatums>
14 explicit WPoseExtractor(
const std::shared_ptr<PoseExtractor>& poseExtractorSharedPtr);
20 void work(TDatums& tDatums);
23 std::shared_ptr<PoseExtractor> spPoseExtractor;
37 template<
typename TDatums>
39 spPoseExtractor{poseExtractorSharedPtr}
43 template<
typename TDatums>
48 template<
typename TDatums>
53 spPoseExtractor->initializationOnThread();
55 catch (
const std::exception& e)
57 error(e.what(), __LINE__, __FUNCTION__, __FILE__);
61 template<
typename TDatums>
73 for (
auto i = 0u ; i < tDatums->size() ; i++)
76 auto& tDatumPtr = (*tDatums)[i];
78 spPoseExtractor->forwardPass(
79 tDatumPtr->inputNetData,
Point<int>{tDatumPtr->cvInputData.cols(), tDatumPtr->cvInputData.rows()},
80 tDatumPtr->scaleInputToNetInputs, tDatumPtr->poseNetOutput, tDatumPtr->id);
82 tDatumPtr->poseCandidates = spPoseExtractor->getCandidatesCopy();
83 tDatumPtr->poseHeatMaps = spPoseExtractor->getHeatMapsCopy();
84 tDatumPtr->poseKeypoints = spPoseExtractor->getPoseKeypoints().clone();
85 tDatumPtr->poseScores = spPoseExtractor->getPoseScores().clone();
86 tDatumPtr->scaleNetToOutput = spPoseExtractor->getScaleNetToOutput();
88 spPoseExtractor->keepTopPeople(tDatumPtr->poseKeypoints, tDatumPtr->poseScores);
90 tDatumPtr->poseIds = spPoseExtractor->extractIdsLockThread(
91 tDatumPtr->poseKeypoints, tDatumPtr->cvInputData, i, tDatumPtr->id);
93 spPoseExtractor->trackLockThread(
94 tDatumPtr->poseKeypoints, tDatumPtr->poseIds, tDatumPtr->cvInputData, i, tDatumPtr->id);
103 catch (
const std::exception& e)
107 error(e.what(), __LINE__, __FUNCTION__, __FILE__);
static void printAveragedTimeMsOnIterationX(const std::string &key, const int line, const std::string &function, const std::string &file, const unsigned long long x=DEFAULT_X)
static const std::string timerInit(const int line, const std::string &function, const std::string &file)
static void timerEnd(const std::string &key)
bool checkNoNullNorEmpty(const TPointerContainer &tPointerContainer)
COMPILE_TEMPLATE_DATUM(WPoseTriangulation)
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="")