| 53 | |
| 54 | template<typename TDatums> |
| 55 | void WCvMatToOpOutput<TDatums>::work(TDatums& tDatums) |
| 56 | { |
| 57 | try |
| 58 | { |
| 59 | if (checkNoNullNorEmpty(tDatums)) |
| 60 | { |
| 61 | // Debugging log |
| 62 | opLogIfDebug("", Priority::Low, __LINE__, __FUNCTION__, __FILE__); |
| 63 | // T* to T |
| 64 | auto& tDatumsNoPtr = *tDatums; |
| 65 | // Profiling speed |
| 66 | const auto profilerKey = Profiler::timerInit(__LINE__, __FUNCTION__, __FILE__); |
| 67 | // cv::Mat -> float* |
| 68 | for (auto& tDatumPtr : tDatumsNoPtr) |
| 69 | tDatumPtr->outputData = spCvMatToOpOutput->createArray( |
| 70 | tDatumPtr->cvInputData, tDatumPtr->scaleInputToOutput, tDatumPtr->netOutputSize); |
| 71 | // Profiling speed |
| 72 | Profiler::timerEnd(profilerKey); |
| 73 | Profiler::printAveragedTimeMsOnIterationX(profilerKey, __LINE__, __FUNCTION__, __FILE__); |
| 74 | // Debugging log |
| 75 | opLogIfDebug("", Priority::Low, __LINE__, __FUNCTION__, __FILE__); |
| 76 | } |
| 77 | } |
| 78 | catch (const std::exception& e) |
| 79 | { |
| 80 | this->stop(); |
| 81 | tDatums = nullptr; |
| 82 | error(e.what(), __LINE__, __FUNCTION__, __FILE__); |
| 83 | } |
| 84 | } |
| 85 | |
| 86 | COMPILE_TEMPLATE_DATUM(WCvMatToOpOutput); |
| 87 | } |
nothing calls this directly
no test coverage detected