1 #ifndef OPENPOSE_FILESTREAM_W_HAND_SAVER_HPP
2 #define OPENPOSE_FILESTREAM_W_HAND_SAVER_HPP
11 template<
typename TDatums>
15 explicit WHandSaver(
const std::shared_ptr<KeypointSaver>& keypointSaver);
24 const std::shared_ptr<KeypointSaver> spKeypointSaver;
38 template<
typename TDatums>
40 spKeypointSaver{keypointSaver}
44 template<
typename TDatums>
49 template<
typename TDatums>
54 template<
typename TDatums>
66 auto& tDatumsNoPtr = *tDatums;
68 const auto fileName = (!tDatumsNoPtr[0]->name.empty()
69 ? tDatumsNoPtr[0]->name : std::to_string(tDatumsNoPtr[0]->
id));
70 std::vector<Array<float>> keypointVector(tDatumsNoPtr.size());
72 for (
auto i = 0u; i < tDatumsNoPtr.size(); i++)
73 keypointVector[i] = tDatumsNoPtr[i]->handKeypoints[0];
74 spKeypointSaver->saveKeypoints(keypointVector, fileName,
"hand_left");
76 for (
auto i = 0u; i < tDatumsNoPtr.size(); i++)
77 keypointVector[i] = tDatumsNoPtr[i]->handKeypoints[1];
78 spKeypointSaver->saveKeypoints(keypointVector, fileName,
"hand_right");
86 catch (
const std::exception& e)
89 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)
void initializationOnThread()
WHandSaver(const std::shared_ptr< KeypointSaver > &keypointSaver)
void workConsumer(const TDatums &tDatums)
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="")