#ifndef OPENPOSE_GUI_W_ADD_GUI_INFO_HPP #define OPENPOSE_GUI_W_ADD_GUI_INFO_HPP #include #include #include namespace op { template class WGuiInfoAdder : public Worker { public: explicit WGuiInfoAdder(const std::shared_ptr& guiInfoAdder); virtual ~WGuiInfoAdder(); void initializationOnThread(); void work(TDatums& tDatums); private: std::shared_ptr spGuiInfoAdder; DELETE_COPY(WGuiInfoAdder); }; } // Implementation #include namespace op { template WGuiInfoAdder::WGuiInfoAdder(const std::shared_ptr& guiInfoAdder) : spGuiInfoAdder{guiInfoAdder} { } template WGuiInfoAdder::~WGuiInfoAdder() { } template void WGuiInfoAdder::initializationOnThread() { } template void WGuiInfoAdder::work(TDatums& tDatums) { try { if (checkNoNullNorEmpty(tDatums)) { // Debugging log opLogIfDebug("", Priority::Low, __LINE__, __FUNCTION__, __FILE__); // Profiling speed const auto profilerKey = Profiler::timerInit(__LINE__, __FUNCTION__, __FILE__); // Add GUI components to frame for (auto& tDatumPtr : *tDatums) spGuiInfoAdder->addInfo( tDatumPtr->cvOutputData, std::max(tDatumPtr->poseKeypoints.getSize(0), tDatumPtr->faceKeypoints.getSize(0)), tDatumPtr->id, tDatumPtr->elementRendered.second, tDatumPtr->frameNumber, tDatumPtr->poseIds, tDatumPtr->poseKeypoints); // Profiling speed Profiler::timerEnd(profilerKey); Profiler::printAveragedTimeMsOnIterationX(profilerKey, __LINE__, __FUNCTION__, __FILE__); // Debugging log opLogIfDebug("", Priority::Low, __LINE__, __FUNCTION__, __FILE__); } } catch (const std::exception& e) { this->stop(); tDatums = nullptr; error(e.what(), __LINE__, __FUNCTION__, __FILE__); } } COMPILE_TEMPLATE_DATUM(WGuiInfoAdder); } #endif // OPENPOSE_GUI_W_ADD_GUI_INFO_HPP