MCPcopy Create free account
hub / github.com/CMU-Perceptual-Computing-Lab/openpose / work

Method work

include/openpose/thread/wIdGenerator.hpp:55–87  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

53
54 template<typename TDatums>
55 void WIdGenerator<TDatums>::work(TDatums& tDatums)
56 {
57 try
58 {
59 if (checkNoNullNorEmpty(tDatums))
60 {
61 // Debugging log
62 opLogIfDebug("", Priority::Low, __LINE__, __FUNCTION__, __FILE__);
63 // Profiling speed
64 const auto profilerKey = Profiler::timerInit(__LINE__, __FUNCTION__, __FILE__);
65 // Add ID
66 for (auto& tDatumPtr : *tDatums)
67 // To avoid overwritting ID if e.g., custom input has already filled it
68 if (tDatumPtr->id == std::numeric_limits<unsigned long long>::max())
69 tDatumPtr->id = mGlobalCounter;
70 // Increase ID
71 const auto& tDatumPtr = (*tDatums)[0];
72 if (tDatumPtr->subId == tDatumPtr->subIdMax)
73 mGlobalCounter++;
74 // Profiling speed
75 Profiler::timerEnd(profilerKey);
76 Profiler::printAveragedTimeMsOnIterationX(profilerKey, __LINE__, __FUNCTION__, __FILE__);
77 // Debugging log
78 opLogIfDebug("", Priority::Low, __LINE__, __FUNCTION__, __FILE__);
79 }
80 }
81 catch (const std::exception& e)
82 {
83 this->stop();
84 tDatums = nullptr;
85 error(e.what(), __LINE__, __FUNCTION__, __FILE__);
86 }
87 }
88
89 COMPILE_TEMPLATE_DATUM(WIdGenerator);
90}

Callers

nothing calls this directly

Calls 5

checkNoNullNorEmptyFunction · 0.85
opLogIfDebugFunction · 0.85
whatMethod · 0.80
errorFunction · 0.50
stopMethod · 0.45

Tested by

no test coverage detected