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

Method work

include/openpose/core/wCvMatToOpInput.hpp:54–81  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

52
53 template<typename TDatums>
54 void WCvMatToOpInput<TDatums>::work(TDatums& tDatums)
55 {
56 try
57 {
58 if (checkNoNullNorEmpty(tDatums))
59 {
60 // Debugging log
61 opLogIfDebug("", Priority::Low, __LINE__, __FUNCTION__, __FILE__);
62 // Profiling speed
63 const auto profilerKey = Profiler::timerInit(__LINE__, __FUNCTION__, __FILE__);
64 // cv::Mat -> float*
65 for (auto& tDatumPtr : *tDatums)
66 tDatumPtr->inputNetData = spCvMatToOpInput->createArray(
67 tDatumPtr->cvInputData, tDatumPtr->scaleInputToNetInputs, tDatumPtr->netInputSizes);
68 // Profiling speed
69 Profiler::timerEnd(profilerKey);
70 Profiler::printAveragedTimeMsOnIterationX(profilerKey, __LINE__, __FUNCTION__, __FILE__);
71 // Debugging log
72 opLogIfDebug("", Priority::Low, __LINE__, __FUNCTION__, __FILE__);
73 }
74 }
75 catch (const std::exception& e)
76 {
77 this->stop();
78 tDatums = nullptr;
79 error(e.what(), __LINE__, __FUNCTION__, __FILE__);
80 }
81 }
82
83 COMPILE_TEMPLATE_DATUM(WCvMatToOpInput);
84}

Callers

nothing calls this directly

Calls 6

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

Tested by

no test coverage detected