mirror of
https://github.com/gosticks/openpose.git
synced 2026-08-13 12:50:29 +00:00
Profiler slightly changed
This commit is contained in:
@@ -64,7 +64,7 @@ namespace op
|
||||
tDatum.inputNetData = spCvMatToOpInput->format(tDatum.cvInputData);
|
||||
// Profiling speed
|
||||
Profiler::timerEnd(profilerKey);
|
||||
Profiler::printAveragedTimeMsOnIterationX(profilerKey, __LINE__, __FUNCTION__, __FILE__, 1000);
|
||||
Profiler::printAveragedTimeMsOnIterationX(profilerKey, __LINE__, __FUNCTION__, __FILE__, Profiler::DEFAULT_X);
|
||||
// Debugging log
|
||||
dLog("", Priority::Low, __LINE__, __FUNCTION__, __FILE__);
|
||||
}
|
||||
|
||||
@@ -66,7 +66,7 @@ namespace op
|
||||
std::tie(tDatum.scaleInputToOutput, tDatum.outputData) = spCvMatToOpOutput->format(tDatum.cvInputData);
|
||||
// Profiling speed
|
||||
Profiler::timerEnd(profilerKey);
|
||||
Profiler::printAveragedTimeMsOnIterationX(profilerKey, __LINE__, __FUNCTION__, __FILE__, 1000);
|
||||
Profiler::printAveragedTimeMsOnIterationX(profilerKey, __LINE__, __FUNCTION__, __FILE__, Profiler::DEFAULT_X);
|
||||
// Debugging log
|
||||
dLog("", Priority::Low, __LINE__, __FUNCTION__, __FILE__);
|
||||
}
|
||||
|
||||
@@ -63,7 +63,7 @@ namespace op
|
||||
}
|
||||
// Profiling speed
|
||||
Profiler::timerEnd(profilerKey);
|
||||
Profiler::printAveragedTimeMsOnIterationX(profilerKey, __LINE__, __FUNCTION__, __FILE__, 1000);
|
||||
Profiler::printAveragedTimeMsOnIterationX(profilerKey, __LINE__, __FUNCTION__, __FILE__, Profiler::DEFAULT_X);
|
||||
// Debugging log
|
||||
dLog("", Priority::Low, __LINE__, __FUNCTION__, __FILE__);
|
||||
}
|
||||
|
||||
@@ -64,7 +64,7 @@ namespace op
|
||||
tDatum.cvOutputData = spOpOutputToCvMat->formatToCvMat(tDatum.outputData);
|
||||
// Profiling speed
|
||||
Profiler::timerEnd(profilerKey);
|
||||
Profiler::printAveragedTimeMsOnIterationX(profilerKey, __LINE__, __FUNCTION__, __FILE__, 1000);
|
||||
Profiler::printAveragedTimeMsOnIterationX(profilerKey, __LINE__, __FUNCTION__, __FILE__, Profiler::DEFAULT_X);
|
||||
// Debugging log
|
||||
dLog("", Priority::Low, __LINE__, __FUNCTION__, __FILE__);
|
||||
}
|
||||
|
||||
@@ -71,7 +71,7 @@ namespace op
|
||||
}
|
||||
// Profiling speed
|
||||
Profiler::timerEnd(profilerKey);
|
||||
Profiler::printAveragedTimeMsOnIterationX(profilerKey, __LINE__, __FUNCTION__, __FILE__, 1000);
|
||||
Profiler::printAveragedTimeMsOnIterationX(profilerKey, __LINE__, __FUNCTION__, __FILE__, Profiler::DEFAULT_X);
|
||||
// Debugging log
|
||||
dLog("", Priority::Low, __LINE__, __FUNCTION__, __FILE__);
|
||||
}
|
||||
|
||||
@@ -68,7 +68,7 @@ namespace op
|
||||
spFaceRenderer->renderFace(tDatum.outputData, tDatum.faceKeyPoints);
|
||||
// Profiling speed
|
||||
Profiler::timerEnd(profilerKey);
|
||||
Profiler::printAveragedTimeMsOnIterationX(profilerKey, __LINE__, __FUNCTION__, __FILE__, 1000);
|
||||
Profiler::printAveragedTimeMsOnIterationX(profilerKey, __LINE__, __FUNCTION__, __FILE__, Profiler::DEFAULT_X);
|
||||
// Debugging log
|
||||
dLog("", Priority::Low, __LINE__, __FUNCTION__, __FILE__);
|
||||
}
|
||||
|
||||
@@ -81,7 +81,7 @@ namespace op
|
||||
spPoseJsonCocoSaver->record(tDatum.poseKeyPoints, imageId);
|
||||
// Profiling speed
|
||||
Profiler::timerEnd(profilerKey);
|
||||
Profiler::printAveragedTimeMsOnIterationX(profilerKey, __LINE__, __FUNCTION__, __FILE__, 1000);
|
||||
Profiler::printAveragedTimeMsOnIterationX(profilerKey, __LINE__, __FUNCTION__, __FILE__, Profiler::DEFAULT_X);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -71,7 +71,7 @@ namespace op
|
||||
}
|
||||
// Profiling speed
|
||||
Profiler::timerEnd(profilerKey);
|
||||
Profiler::printAveragedTimeMsOnIterationX(profilerKey, __LINE__, __FUNCTION__, __FILE__, 1000);
|
||||
Profiler::printAveragedTimeMsOnIterationX(profilerKey, __LINE__, __FUNCTION__, __FILE__, Profiler::DEFAULT_X);
|
||||
// Debugging log
|
||||
dLog("", Priority::Low, __LINE__, __FUNCTION__, __FILE__);
|
||||
}
|
||||
|
||||
@@ -68,7 +68,7 @@ namespace op
|
||||
spHandRenderer->renderHands(tDatum.outputData, tDatum.handKeyPoints);
|
||||
// Profiling speed
|
||||
Profiler::timerEnd(profilerKey);
|
||||
Profiler::printAveragedTimeMsOnIterationX(profilerKey, __LINE__, __FUNCTION__, __FILE__, 1000);
|
||||
Profiler::printAveragedTimeMsOnIterationX(profilerKey, __LINE__, __FUNCTION__, __FILE__, Profiler::DEFAULT_X);
|
||||
// Debugging log
|
||||
dLog("", Priority::Low, __LINE__, __FUNCTION__, __FILE__);
|
||||
}
|
||||
|
||||
@@ -70,7 +70,7 @@ namespace op
|
||||
spHeatMapSaver->saveHeatMaps(poseHeatMaps, fileName);
|
||||
// Profiling speed
|
||||
Profiler::timerEnd(profilerKey);
|
||||
Profiler::printAveragedTimeMsOnIterationX(profilerKey, __LINE__, __FUNCTION__, __FILE__, 1000);
|
||||
Profiler::printAveragedTimeMsOnIterationX(profilerKey, __LINE__, __FUNCTION__, __FILE__, Profiler::DEFAULT_X);
|
||||
// Debugging log
|
||||
dLog("", Priority::Low, __LINE__, __FUNCTION__, __FILE__);
|
||||
}
|
||||
|
||||
@@ -70,7 +70,7 @@ namespace op
|
||||
spImageSaver->saveImages(cvOutputDatas, fileName);
|
||||
// Profiling speed
|
||||
Profiler::timerEnd(profilerKey);
|
||||
Profiler::printAveragedTimeMsOnIterationX(profilerKey, __LINE__, __FUNCTION__, __FILE__, 1000);
|
||||
Profiler::printAveragedTimeMsOnIterationX(profilerKey, __LINE__, __FUNCTION__, __FILE__, Profiler::DEFAULT_X);
|
||||
// Debugging log
|
||||
dLog("", Priority::Low, __LINE__, __FUNCTION__, __FILE__);
|
||||
}
|
||||
|
||||
@@ -68,7 +68,7 @@ namespace op
|
||||
spPoseJsonSaver->savePoseKeyPoints(poseKeyPointsVector, fileName);
|
||||
// Profiling speed
|
||||
Profiler::timerEnd(profilerKey);
|
||||
Profiler::printAveragedTimeMsOnIterationX(profilerKey, __LINE__, __FUNCTION__, __FILE__, 1000);
|
||||
Profiler::printAveragedTimeMsOnIterationX(profilerKey, __LINE__, __FUNCTION__, __FILE__, Profiler::DEFAULT_X);
|
||||
// Debugging log
|
||||
dLog("", Priority::Low, __LINE__, __FUNCTION__, __FILE__);
|
||||
}
|
||||
|
||||
@@ -69,7 +69,7 @@ namespace op
|
||||
spPoseSaver->savePoseKeyPoints(poseKeyPointsVector, fileName);
|
||||
// Profiling speed
|
||||
Profiler::timerEnd(profilerKey);
|
||||
Profiler::printAveragedTimeMsOnIterationX(profilerKey, __LINE__, __FUNCTION__, __FILE__, 1000);
|
||||
Profiler::printAveragedTimeMsOnIterationX(profilerKey, __LINE__, __FUNCTION__, __FILE__, Profiler::DEFAULT_X);
|
||||
// Debugging log
|
||||
dLog("", Priority::Low, __LINE__, __FUNCTION__, __FILE__);
|
||||
}
|
||||
|
||||
@@ -69,7 +69,7 @@ namespace op
|
||||
spVideoSaver->write(cvOutputDatas);
|
||||
// Profiling speed
|
||||
Profiler::timerEnd(profilerKey);
|
||||
Profiler::printAveragedTimeMsOnIterationX(profilerKey, __LINE__, __FUNCTION__, __FILE__, 1000);
|
||||
Profiler::printAveragedTimeMsOnIterationX(profilerKey, __LINE__, __FUNCTION__, __FILE__, Profiler::DEFAULT_X);
|
||||
// Debugging log
|
||||
dLog("", Priority::Low, __LINE__, __FUNCTION__, __FILE__);
|
||||
}
|
||||
|
||||
@@ -71,7 +71,7 @@ namespace op
|
||||
if (!tDatumsNoPtr.empty())
|
||||
{
|
||||
Profiler::timerEnd(profilerKey);
|
||||
Profiler::printAveragedTimeMsOnIterationX(profilerKey, __LINE__, __FUNCTION__, __FILE__, 1000);
|
||||
Profiler::printAveragedTimeMsOnIterationX(profilerKey, __LINE__, __FUNCTION__, __FILE__, Profiler::DEFAULT_X);
|
||||
}
|
||||
// Debugging log
|
||||
dLog("", Priority::Low, __LINE__, __FUNCTION__, __FILE__);
|
||||
|
||||
@@ -61,7 +61,7 @@ namespace op
|
||||
spGuiInfoAdder->addInfo(tDatum.cvOutputData, tDatum.poseKeyPoints, tDatum.id, tDatum.elementRendered.second);
|
||||
// Profiling speed
|
||||
Profiler::timerEnd(profilerKey);
|
||||
Profiler::printAveragedTimeMsOnIterationX(profilerKey, __LINE__, __FUNCTION__, __FILE__, 1000);
|
||||
Profiler::printAveragedTimeMsOnIterationX(profilerKey, __LINE__, __FUNCTION__, __FILE__, Profiler::DEFAULT_X);
|
||||
// Debugging log
|
||||
dLog("", Priority::Low, __LINE__, __FUNCTION__, __FILE__);
|
||||
}
|
||||
|
||||
@@ -68,7 +68,7 @@ namespace op
|
||||
}
|
||||
// Profiling speed
|
||||
Profiler::timerEnd(profilerKey);
|
||||
Profiler::printAveragedTimeMsOnIterationX(profilerKey, __LINE__, __FUNCTION__, __FILE__, 1000);
|
||||
Profiler::printAveragedTimeMsOnIterationX(profilerKey, __LINE__, __FUNCTION__, __FILE__, Profiler::DEFAULT_X);
|
||||
// Debugging log
|
||||
dLog("", Priority::Low, __LINE__, __FUNCTION__, __FILE__);
|
||||
}
|
||||
|
||||
@@ -63,7 +63,7 @@ namespace op
|
||||
tDatum.elementRendered = spPoseRenderer->renderPose(tDatum.outputData, tDatum.poseKeyPoints, tDatum.scaleNetToOutput);
|
||||
// Profiling speed
|
||||
Profiler::timerEnd(profilerKey);
|
||||
Profiler::printAveragedTimeMsOnIterationX(profilerKey, __LINE__, __FUNCTION__, __FILE__, 1000);
|
||||
Profiler::printAveragedTimeMsOnIterationX(profilerKey, __LINE__, __FUNCTION__, __FILE__, Profiler::DEFAULT_X);
|
||||
// Debugging log
|
||||
dLog("", Priority::Low, __LINE__, __FUNCTION__, __FILE__);
|
||||
}
|
||||
|
||||
@@ -64,7 +64,7 @@ namespace op
|
||||
this->stop();
|
||||
// Profiling speed
|
||||
Profiler::timerEnd(profilerKey);
|
||||
Profiler::printAveragedTimeMsOnIterationX(profilerKey, __LINE__, __FUNCTION__, __FILE__, 1000);
|
||||
Profiler::printAveragedTimeMsOnIterationX(profilerKey, __LINE__, __FUNCTION__, __FILE__, Profiler::DEFAULT_X);
|
||||
// Debugging log
|
||||
dLog("", Priority::Low, __LINE__, __FUNCTION__, __FILE__);
|
||||
// Return TDatums
|
||||
|
||||
@@ -108,7 +108,7 @@ namespace op
|
||||
{
|
||||
// Profiling speed
|
||||
Profiler::timerEnd(profilerKey);
|
||||
Profiler::printAveragedTimeMsOnIterationX(profilerKey, __LINE__, __FUNCTION__, __FILE__, 1000);
|
||||
Profiler::printAveragedTimeMsOnIterationX(profilerKey, __LINE__, __FUNCTION__, __FILE__, Profiler::DEFAULT_X);
|
||||
// Debugging log
|
||||
dLog("", Priority::Low, __LINE__, __FUNCTION__, __FILE__);
|
||||
}
|
||||
|
||||
@@ -13,20 +13,22 @@
|
||||
// const auto profilerKey = Profiler::timerInit(__LINE__, __FUNCTION__, __FILE__);
|
||||
// // functions to do...
|
||||
// Profiler::timerEnd(profilerKey);
|
||||
// Profiler::printAveragedTimeMsOnIterationX(profilerKey, __LINE__, __FUNCTION__, __FILE__, 1000);
|
||||
// Profiler::printAveragedTimeMsOnIterationX(profilerKey, __LINE__, __FUNCTION__, __FILE__, Profiler::DEFAULT_X);
|
||||
|
||||
namespace op
|
||||
{
|
||||
class Profiler
|
||||
{
|
||||
public:
|
||||
static const unsigned long long 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);
|
||||
|
||||
static void printAveragedTimeMsOnIterationX(const std::string& key, const int line, const std::string& function, const std::string& file, const unsigned long long x);
|
||||
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 void printAveragedTimeMsEveryXIterations(const std::string& key, const int line, const std::string& function, const std::string& file, const unsigned long long x);
|
||||
static void printAveragedTimeMsEveryXIterations(const std::string& key, const int line, const std::string& function, const std::string& file, const unsigned long long x = DEFAULT_X);
|
||||
|
||||
static void profileGpuMemory(const int line, const std::string& function, const std::string& file);
|
||||
};
|
||||
|
||||
@@ -11,7 +11,10 @@
|
||||
|
||||
namespace op
|
||||
{
|
||||
const unsigned long long Profiler::DEFAULT_X = 1000;
|
||||
|
||||
#ifdef PROFILER_ENABLED
|
||||
|
||||
std::map<std::string, std::tuple<double, unsigned long long, std::chrono::high_resolution_clock::time_point>> sProfilerTuple{
|
||||
std::map<std::string, std::tuple<double, unsigned long long, std::chrono::high_resolution_clock::time_point>>()
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user