Skip to content

Commit

Permalink
Added more verbose to Wrapper & fixed wrong non-CPU render when body=…
Browse files Browse the repository at this point in the history
…cpu & face/hand set to auto but disabled
  • Loading branch information
gineshidalgo99 committed Apr 24, 2020
1 parent 66a2757 commit 82e452f
Showing 1 changed file with 29 additions and 9 deletions.
38 changes: 29 additions & 9 deletions include/openpose/wrapper/wrapperAuxiliary.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ namespace op
{
try
{
opLog("", Priority::Low, __LINE__, __FUNCTION__, __FILE__);
opLog("Running configureThreadManager...", Priority::Normal);

// Create producer
auto producerSharedPtr = createProducer(
Expand Down Expand Up @@ -151,24 +151,37 @@ namespace op
const auto renderOutput = renderModePose != RenderMode::None
|| renderModeFace != RenderMode::None
|| renderModeHand != RenderMode::None;
const auto renderOutputGpu = renderModePose == RenderMode::Gpu
|| renderModeFace == RenderMode::Gpu
|| renderModeHand == RenderMode::Gpu;
const auto renderFace = wrapperStructFace.enable && renderModeFace != RenderMode::None;
const auto renderHand = wrapperStructHand.enable && renderModeHand != RenderMode::None;
const auto renderHandGpu = wrapperStructHand.enable && renderModeHand == RenderMode::Gpu;
const bool renderOutputGpu = renderModePose == RenderMode::Gpu
|| (wrapperStructFace.enable && renderModeFace == RenderMode::Gpu)
|| (wrapperStructHand.enable && renderModeHand == RenderMode::Gpu);
const bool renderFace = wrapperStructFace.enable && renderModeFace != RenderMode::None;
const bool renderHand = wrapperStructHand.enable && renderModeHand != RenderMode::None;
const bool renderHandGpu = wrapperStructHand.enable && renderModeHand == RenderMode::Gpu;
opLog("renderModePose = " + std::to_string(int(renderModePose)), Priority::Normal);
opLog("renderModeFace = " + std::to_string(int(renderModeFace)), Priority::Normal);
opLog("renderModeHand = " + std::to_string(int(renderModeHand)), Priority::Normal);
opLog("renderOutput = " + std::to_string(int(renderOutput)), Priority::Normal);
opLog("renderOutputGpu = " + std::to_string(int(renderOutput)), Priority::Normal);
opLog("renderFace = " + std::to_string(int(renderFace)), Priority::Normal);
opLog("renderHand = " + std::to_string(int(renderHand)), Priority::Normal);
opLog("renderHandGpu = " + std::to_string(int(renderHandGpu)), Priority::Normal);

// Check no wrong/contradictory flags enabled
const auto userInputAndPreprocessingWsEmpty = userInputWs.empty() && userPreProcessingWs.empty();
const auto userOutputWsEmpty = userOutputWs.empty();
const bool userInputAndPreprocessingWsEmpty = userInputWs.empty() && userPreProcessingWs.empty();
const bool userOutputWsEmpty = userOutputWs.empty();
wrapperConfigureSanityChecks(
wrapperStructPose, wrapperStructFace, wrapperStructHand, wrapperStructExtra, wrapperStructInput,
wrapperStructOutput, wrapperStructGui, renderOutput, userInputAndPreprocessingWsEmpty,
userOutputWsEmpty, producerSharedPtr, threadManagerMode);
opLog("userInputAndPreprocessingWsEmpty = " + std::to_string(int(userInputAndPreprocessingWsEmpty)),
Priority::Normal);
opLog("userOutputWsEmpty = " + std::to_string(int(userOutputWsEmpty)), Priority::Normal);

// Get number threads
auto numberGpuThreads = wrapperStructPose.gpuNumber;
auto gpuNumberStart = wrapperStructPose.gpuNumberStart;
opLog("numberGpuThreads = " + std::to_string(numberGpuThreads), Priority::Normal);
opLog("gpuNumberStart = " + std::to_string(gpuNumberStart), Priority::Normal);
// CPU --> 1 thread or no pose extraction
if (gpuMode == GpuMode::NoGpu)
{
Expand Down Expand Up @@ -213,6 +226,11 @@ namespace op
const auto writeJsonCleaned = formatAsDirectory(wrapperStructOutput.writeJson.getStdString());
const auto writeHeatMapsCleaned = formatAsDirectory(wrapperStructOutput.writeHeatMaps.getStdString());
const auto modelFolder = formatAsDirectory(wrapperStructPose.modelFolder.getStdString());
opLog("writeImagesCleaned = " + writeImagesCleaned, Priority::Normal);
opLog("writeKeypointCleaned = " + writeKeypointCleaned, Priority::Normal);
opLog("writeJsonCleaned = " + writeJsonCleaned, Priority::Normal);
opLog("writeHeatMapsCleaned = " + writeHeatMapsCleaned, Priority::Normal);
opLog("modelFolder = " + modelFolder, Priority::Normal);

// Common parameters
auto finalOutputSize = wrapperStructPose.outputSize;
Expand All @@ -234,6 +252,8 @@ namespace op
if (finalOutputSize.x == -1 || finalOutputSize.y == -1)
finalOutputSize = producerSize;
}
opLog("finalOutputSize = [" + std::to_string(finalOutputSize.x) + "," + std::to_string(finalOutputSize.y)
+ "]", Priority::Normal);

// Producer
TWorker datumProducerW;
Expand Down

0 comments on commit 82e452f

Please sign in to comment.