Skip to content

Commit

Permalink
Add config debug and remove set multithread (CMU-Perceptual-Computing…
Browse files Browse the repository at this point in the history
  • Loading branch information
ZiuTinyat authored and gineshidalgo99 committed Feb 11, 2019
1 parent 784fc30 commit ea9bfe0
Showing 1 changed file with 20 additions and 16 deletions.
36 changes: 20 additions & 16 deletions src/openpose/unity/unityBinding.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ namespace op
#endif

// Other global parameters
bool sMultiThreadEnabled = true;
bool sMultiThreadDisabled = false;
bool sUnityOutputEnabled = true;
bool sImageOutput = false;

Expand Down Expand Up @@ -439,7 +439,7 @@ namespace op
spWrapper->configure(*spWrapperStructOutput);

// Multi-threading
if (!sMultiThreadEnabled)
if (sMultiThreadDisabled)
spWrapper->disableMultiThreading();

// Processing...
Expand Down Expand Up @@ -501,19 +501,6 @@ namespace op
}
#endif

// Enable/disable multi-threading
OP_API void _OPSetMultiThreadEnable(bool enable)
{
try
{
sMultiThreadEnabled = enable;
}
catch (const std::exception& e)
{
log(e.what(), Priority::Max, __LINE__, __FUNCTION__, __FILE__);
}
}

// Enable/disable output callback
OP_API void _OPSetOutputEnable(bool enable)
{
Expand Down Expand Up @@ -554,7 +541,7 @@ namespace op
bool heatMapAddPAFs, // HeatMapType // uchar heatmap_type,
uchar heatMapScaleMode, // ScaleMode
bool addPartCandidates, float renderThreshold, int numberPeopleMax,
bool maximizePositives, double fpsMax, char* protoTxtPath, float upsamplingRatio, char* caffeModelPath)
bool maximizePositives, double fpsMax, char* protoTxtPath, char* caffeModelPath, float upsamplingRatio)
{
try
{
Expand Down Expand Up @@ -682,6 +669,23 @@ namespace op
log(e.what(), Priority::Max, __LINE__, __FUNCTION__, __FILE__);
}
}

OP_API void _OPConfigureDebugging(
uchar loggingLevel, // Priority
bool disableMultiThread,
unsigned long long profileSpeed)
{
try
{
ConfigureLog::setPriorityThreshold((Priority)loggingLevel);
sMultiThreadDisabled = disableMultiThread;
Profiler::setDefaultX(profileSpeed);
}
catch (const std::exception& e)
{
log(e.what(), Priority::Max, __LINE__, __FUNCTION__, __FILE__);
}
}
}
}
#endif

0 comments on commit ea9bfe0

Please sign in to comment.