1 #ifndef OPENPOSE_WRAPPER_WRAPPER_AUXILIARY_HPP
2 #define OPENPOSE_WRAPPER_WRAPPER_AUXILIARY_HPP
30 WrapperStructPose& wrapperStructPose,
const WrapperStructFace& wrapperStructFace,
31 const WrapperStructHand& wrapperStructHand,
const WrapperStructExtra& wrapperStructExtra,
32 const WrapperStructInput& wrapperStructInput,
const WrapperStructOutput& wrapperStructOutput,
33 const WrapperStructGui& wrapperStructGui,
const bool renderOutput,
const bool userOutputWsEmpty,
34 const std::shared_ptr<Producer>& producerSharedPtr,
const ThreadManagerMode threadManagerMode);
44 OP_API void threadIdPP(
unsigned long long& threadId,
const bool multiThreadEnabled);
52 template<
typename TDatums,
53 typename TDatumsSP = std::shared_ptr<TDatums>,
54 typename TWorker = std::shared_ptr<Worker<TDatumsSP>>>
56 ThreadManager<TDatumsSP>& threadManager,
const bool multiThreadEnabled,
57 const ThreadManagerMode threadManagerMode,
const WrapperStructPose& wrapperStructPose,
58 const WrapperStructFace& wrapperStructFace,
const WrapperStructHand& wrapperStructHand,
59 const WrapperStructExtra& wrapperStructExtra,
const WrapperStructInput& wrapperStructInput,
60 const WrapperStructOutput& wrapperStructOutput,
const WrapperStructGui& wrapperStructGui,
84 template<
typename TDatums,
typename TDatumsSP,
typename TWorker>
106 auto wrapperStructPose = wrapperStructPoseTemp;
107 auto multiThreadEnabled = multiThreadEnabledTemp;
110 TWorker datumProducerW;
111 TWorker scaleAndSizeExtractorW;
112 TWorker cvMatToOpInputW;
113 TWorker cvMatToOpOutputW;
114 std::vector<std::vector<TWorker>> poseExtractorsWs;
115 std::vector<std::vector<TWorker>> poseTriangulationsWs;
116 std::vector<std::vector<TWorker>> jointAngleEstimationsWs;
117 std::vector<TWorker> postProcessingWs;
118 std::vector<TWorker> outputWs;
130 const auto spVideoSeek = std::make_shared<std::pair<std::atomic<bool>, std::atomic<int>>>();
132 spVideoSeek->first =
false;
133 spVideoSeek->second = 0;
139 const auto renderOutputGpu = wrapperStructPose.renderMode ==
RenderMode::Gpu
147 const auto userOutputWsEmpty = userOutputWs.empty();
149 wrapperStructPose, wrapperStructFace, wrapperStructHand, wrapperStructExtra, wrapperStructInput,
150 wrapperStructOutput, wrapperStructGui, renderOutput, userOutputWsEmpty, producerSharedPtr,
154 auto numberThreads = wrapperStructPose.gpuNumber;
155 auto gpuNumberStart = wrapperStructPose.gpuNumberStart;
159 numberThreads = (wrapperStructPose.gpuNumber == 0 ? 0 : 1);
164 multiThreadEnabled =
false;
172 if (numberThreads < 0)
174 if (totalGpuNumber <= gpuNumberStart)
175 error(
"Number of initial GPU (`--number_gpu_start`) must be lower than the total number of"
176 " used GPUs (`--number_gpu`)", __LINE__, __FUNCTION__, __FILE__);
177 numberThreads = totalGpuNumber - gpuNumberStart;
180 log(
"Auto-detecting all available GPUs... Detected " + std::to_string(totalGpuNumber)
181 +
" GPU(s), using " + std::to_string(numberThreads) +
" of them starting at GPU "
185 if (gpuNumberStart + numberThreads > totalGpuNumber)
186 error(
"Initial GPU selected (`--number_gpu_start`) + number GPUs to use (`--number_gpu`) must"
187 " be lower or equal than the total number of GPUs in your machine ("
188 + std::to_string(gpuNumberStart) +
" + "
189 + std::to_string(numberThreads) +
" vs. "
190 + std::to_string(totalGpuNumber) +
").",
191 __LINE__, __FUNCTION__, __FILE__);
202 auto finalOutputSize = wrapperStructPose.outputSize;
204 const auto oPProducer = (producerSharedPtr !=
nullptr);
210 producerSharedPtr->setProducerFpsMode(displayProducerFpsMode);
215 producerSize =
Point<int>{(int)producerSharedPtr->get(CV_CAP_PROP_FRAME_WIDTH),
216 (int)producerSharedPtr->get(CV_CAP_PROP_FRAME_HEIGHT)};
218 if (finalOutputSize.x == -1 || finalOutputSize.y == -1)
219 finalOutputSize = producerSize;
225 const auto datumProducer = std::make_shared<DatumProducer<TDatums>>(
227 wrapperStructInput.
frameLast, spVideoSeek
229 datumProducerW = std::make_shared<WDatumProducer<TDatumsSP, TDatums>>(datumProducer);
232 datumProducerW =
nullptr;
234 std::vector<std::shared_ptr<PoseExtractorNet>> poseExtractorNets;
235 std::vector<std::shared_ptr<FaceExtractorNet>> faceExtractorNets;
236 std::vector<std::shared_ptr<HandExtractorNet>> handExtractorNets;
237 std::vector<std::shared_ptr<PoseGpuRenderer>> poseGpuRenderers;
238 std::shared_ptr<PoseCpuRenderer> poseCpuRenderer;
239 if (numberThreads > 0)
242 const auto scaleAndSizeExtractor = std::make_shared<ScaleAndSizeExtractor>(
243 wrapperStructPose.netInputSize, finalOutputSize, wrapperStructPose.scalesNumber,
244 wrapperStructPose.scaleGap
246 scaleAndSizeExtractorW = std::make_shared<WScaleAndSizeExtractor<TDatumsSP>>(scaleAndSizeExtractor);
249 const auto cvMatToOpInput = std::make_shared<CvMatToOpInput>(wrapperStructPose.poseModel);
250 cvMatToOpInputW = std::make_shared<WCvMatToOpInput<TDatumsSP>>(cvMatToOpInput);
253 const auto cvMatToOpOutput = std::make_shared<CvMatToOpOutput>();
254 cvMatToOpOutputW = std::make_shared<WCvMatToOpOutput<TDatumsSP>>(cvMatToOpOutput);
258 std::vector<TWorker> cpuRenderers;
259 poseExtractorsWs.clear();
260 poseExtractorsWs.resize(numberThreads);
261 if (wrapperStructPose.enable)
264 for (
auto gpuId = 0; gpuId < numberThreads; gpuId++)
265 poseExtractorNets.emplace_back(std::make_shared<PoseExtractorCaffe>(
266 wrapperStructPose.poseModel, modelFolder, gpuId + gpuNumberStart,
267 wrapperStructPose.heatMapTypes, wrapperStructPose.heatMapScale,
268 wrapperStructPose.addPartCandidates, wrapperStructPose.maximizePositives,
269 wrapperStructPose.enableGoogleLogging
273 if (renderOutputGpu || wrapperStructPose.renderMode ==
RenderMode::Cpu)
277 const auto alphaKeypoint = (wrapperStructPose.renderMode !=
RenderMode::None
278 ? wrapperStructPose.alphaKeypoint : 0.f);
280 ? wrapperStructPose.alphaHeatMap : 0.f);
284 for (
const auto& poseExtractorNet : poseExtractorNets)
286 poseGpuRenderers.emplace_back(std::make_shared<PoseGpuRenderer>(
287 wrapperStructPose.poseModel, poseExtractorNet, wrapperStructPose.renderThreshold,
288 wrapperStructPose.blendOriginalFrame, alphaKeypoint,
289 alphaHeatMap, wrapperStructPose.defaultPartToRender
296 poseCpuRenderer = std::make_shared<PoseCpuRenderer>(
297 wrapperStructPose.poseModel, wrapperStructPose.renderThreshold,
298 wrapperStructPose.blendOriginalFrame, alphaKeypoint, alphaHeatMap,
299 wrapperStructPose.defaultPartToRender);
306 poseExtractorsWs.resize(poseExtractorNets.size());
308 ? std::make_shared<PersonIdExtractor>() :
nullptr);
315 const auto keepTopNPeople = (wrapperStructPose.numberPeopleMax > 0 ?
316 std::make_shared<KeepTopNPeople>(wrapperStructPose.numberPeopleMax)
319 auto personTrackers = std::make_shared<std::vector<std::shared_ptr<PersonTracker>>>();
320 if (wrapperStructExtra.
tracking > -1)
321 personTrackers->emplace_back(
322 std::make_shared<PersonTracker>(wrapperStructExtra.
tracking == 0));
323 for (
auto i = 0u; i < poseExtractorsWs.size(); i++)
327 const auto poseExtractor = std::make_shared<PoseExtractor>(
328 poseExtractorNets.at(i), keepTopNPeople, personIdExtractor, personTrackers,
329 wrapperStructPose.numberPeopleMax, wrapperStructExtra.
tracking);
330 poseExtractorsWs.at(i) = {std::make_shared<WPoseExtractor<TDatumsSP>>(poseExtractor)};
352 if (wrapperStructFace.
enable)
356 if (wrapperStructPose.enable)
358 const auto faceDetector = std::make_shared<FaceDetector>(wrapperStructPose.poseModel);
359 for (
auto& wPose : poseExtractorsWs)
365 log(
"Body keypoint detection is disabled. Hence, using OpenCV face detector (much less"
367 for (
auto& wPose : poseExtractorsWs)
370 const auto faceDetectorOpenCV = std::make_shared<FaceDetectorOpenCV>(modelFolder);
377 for (
auto gpu = 0u; gpu < poseExtractorsWs.size(); gpu++)
380 const auto netOutputSize = wrapperStructFace.
netInputSize;
381 const auto faceExtractorNet = std::make_shared<FaceExtractorCaffe>(
382 wrapperStructFace.
netInputSize, netOutputSize, modelFolder,
383 gpu + gpuNumberStart, wrapperStructPose.heatMapTypes, wrapperStructPose.heatMapScale,
384 wrapperStructPose.enableGoogleLogging
386 faceExtractorNets.emplace_back(faceExtractorNet);
387 poseExtractorsWs.at(gpu).emplace_back(
393 if (wrapperStructHand.
enable)
395 const auto handDetector = std::make_shared<HandDetector>(wrapperStructPose.poseModel);
396 for (
auto gpu = 0u; gpu < poseExtractorsWs.size(); gpu++)
401 poseExtractorsWs.at(gpu).emplace_back(
406 poseExtractorsWs.at(gpu).emplace_back(
409 const auto netOutputSize = wrapperStructHand.
netInputSize;
410 const auto handExtractorNet = std::make_shared<HandExtractorCaffe>(
411 wrapperStructHand.
netInputSize, netOutputSize, modelFolder,
413 wrapperStructPose.heatMapTypes, wrapperStructPose.heatMapScale,
414 wrapperStructPose.enableGoogleLogging
416 handExtractorNets.emplace_back(handExtractorNet);
417 poseExtractorsWs.at(gpu).emplace_back(
422 poseExtractorsWs.at(gpu).emplace_back(
429 if (!poseGpuRenderers.empty())
430 for (
auto i = 0u; i < poseExtractorsWs.size(); i++)
432 poseGpuRenderers.at(i)
442 const auto faceRenderer = std::make_shared<FaceCpuRenderer>(wrapperStructFace.
renderThreshold,
451 for (
auto i = 0u; i < poseExtractorsWs.size(); i++)
454 const auto faceRenderer = std::make_shared<FaceGpuRenderer>(
459 if (!poseGpuRenderers.empty())
461 const bool isLastRenderer = !renderHandGpu;
463 poseGpuRenderers.at(i)
469 poseExtractorsWs.at(i).emplace_back(
474 error(
"Unknown RenderMode.", __LINE__, __FUNCTION__, __FILE__);
484 const auto handRenderer = std::make_shared<HandCpuRenderer>(wrapperStructHand.
renderThreshold,
493 for (
auto i = 0u; i < poseExtractorsWs.size(); i++)
496 const auto handRenderer = std::make_shared<HandGpuRenderer>(
501 if (!poseGpuRenderers.empty())
503 const bool isLastRenderer =
true;
505 poseGpuRenderers.at(i)
511 poseExtractorsWs.at(i).emplace_back(
516 error(
"Unknown RenderMode.", __LINE__, __FUNCTION__, __FILE__);
520 poseTriangulationsWs.clear();
524 poseTriangulationsWs.resize(
fastMax(1,
int(poseExtractorsWs.size() / 4)));
525 for (
auto i = 0u ; i < poseTriangulationsWs.size() ; i++)
527 const auto poseTriangulation = std::make_shared<PoseTriangulation>(
529 poseTriangulationsWs.at(i) = {std::make_shared<WPoseTriangulation<TDatumsSP>>(
534 postProcessingWs.clear();
546 postProcessingWs =
mergeVectors(postProcessingWs, cpuRenderers);
547 const auto opOutputToCvMat = std::make_shared<OpOutputToCvMat>();
555 (finalOutputSize == producerSize || finalOutputSize.x <= 0 || finalOutputSize.y <= 0))
558 && producerSize == wrapperStructPose.netInputSize))
561 auto keypointScaler = std::make_shared<KeypointScaler>(wrapperStructPose.keypointScale);
570 jointAngleEstimationsWs.clear();
571 #ifdef USE_3D_ADAM_MODEL
574 jointAngleEstimationsWs.resize(wrapperStructExtra.
ikThreads);
576 for (
auto i = 0u; i < jointAngleEstimationsWs.size(); i++)
578 const auto jointAngleEstimation = std::make_shared<JointAngleEstimation>(displayAdam);
579 jointAngleEstimationsWs.at(i) = {std::make_shared<WJointAngleEstimation<TDatumsSP>>(
580 jointAngleEstimation)};
588 if (wrapperStructOutput.
verbose > 0.)
590 const auto verbosePrinter = std::make_shared<VerbosePrinter>(
591 wrapperStructOutput.
verbose, producerSharedPtr->get(CV_CAP_PROP_FRAME_COUNT));
596 #ifdef USE_3D_ADAM_MODEL
597 if (!wrapperStructOutput.
udpHost.empty() && !wrapperStructOutput.
udpPort.empty())
599 const auto udpSender = std::make_shared<UdpSender>(wrapperStructOutput.
udpHost,
605 if (!writeKeypointCleaned.empty())
607 const auto keypointSaver = std::make_shared<KeypointSaver>(writeKeypointCleaned,
610 if (wrapperStructFace.
enable)
612 if (wrapperStructHand.
enable)
617 if (!writeJsonCleaned.empty())
619 const auto peopleJsonSaver = std::make_shared<PeopleJsonSaver>(writeJsonCleaned);
626 const auto humanFormat =
true;
627 const auto cocoJsonSaver = std::make_shared<CocoJsonSaver>(
639 const auto humanFormat =
true;
640 const auto cocoJsonSaver = std::make_shared<CocoJsonSaver>(wrapperStructOutput.
writeCocoFootJson,
645 if (!writeImagesCleaned.empty())
647 const auto imageSaver = std::make_shared<ImageSaver>(writeImagesCleaned,
652 const auto producerFps = (producerSharedPtr ==
nullptr ?
653 0. : producerSharedPtr->get(CV_CAP_PROP_FPS));
654 const auto originalVideoFps = (wrapperStructOutput.
writeVideoFps > 0 ?
660 error(
"Video file can only be recorded inside `wrapper/wrapper.hpp` if the producer"
661 " is one of the default ones (e.g., video, webcam, ...).",
662 __LINE__, __FUNCTION__, __FILE__);
663 if (finalOutputSize.x <= 0 || finalOutputSize.y <= 0)
664 error(
"Video can only be recorded if outputSize is fixed (e.g., video, webcam, IP camera),"
665 "but not for a image directory.", __LINE__, __FUNCTION__, __FILE__);
666 const auto videoSaver = std::make_shared<VideoSaver>(
667 wrapperStructOutput.
writeVideo, CV_FOURCC(
'M',
'J',
'P',
'G'), originalVideoFps, finalOutputSize
672 #ifdef USE_3D_ADAM_MODEL
673 if (!wrapperStructOutput.
writeBvh.empty())
675 const auto bvhSaver = std::make_shared<BvhSaver>(
676 wrapperStructOutput.
writeBvh, JointAngleEstimation::getTotalModel(), originalVideoFps
678 outputWs.emplace_back(std::make_shared<WBvhSaver<TDatumsSP>>(bvhSaver));
682 if (!writeHeatMapsCleaned.empty())
684 const auto heatMapSaver = std::make_shared<HeatMapSaver>(writeHeatMapsCleaned,
692 if (wrapperStructGui.
guiVerbose && (guiEnabled || !userOutputWs.empty()
696 const auto guiInfoAdder = std::make_shared<GuiInfoAdder>(numberThreads, guiEnabled);
704 std::vector<std::shared_ptr<Renderer>> renderers;
706 renderers.emplace_back(std::static_pointer_cast<Renderer>(poseCpuRenderer));
708 for (
const auto& poseGpuRenderer : poseGpuRenderers)
709 renderers.emplace_back(std::static_pointer_cast<Renderer>(poseGpuRenderer));
714 #ifdef USE_3D_ADAM_MODEL
716 const auto gui = std::make_shared<GuiAdam>(
718 spVideoSeek, poseExtractorNets, faceExtractorNets, handExtractorNets, renderers,
719 wrapperStructGui.
displayMode, JointAngleEstimation::getTotalModel(),
723 guiW = {std::make_shared<WGuiAdam<TDatumsSP>>(gui)};
731 const auto gui = std::make_shared<Gui3D>(
733 spVideoSeek, poseExtractorNets, faceExtractorNets, handExtractorNets, renderers,
734 wrapperStructPose.poseModel, wrapperStructGui.
displayMode
737 guiW = {std::make_shared<WGui3D<TDatumsSP>>(gui)};
743 const auto gui = std::make_shared<Gui>(
745 spVideoSeek, poseExtractorNets, faceExtractorNets, handExtractorNets, renderers
748 guiW = {std::make_shared<WGui<TDatumsSP>>(gui)};
751 error(
"Unknown DisplayMode.", __LINE__, __FUNCTION__, __FILE__);
763 if ((datumProducerW ==
nullptr) == (userInputWs.empty())
767 const auto message =
"You need to have 1 and only 1 producer selected. You can introduce your own"
768 " producer by using setWorker(WorkerType::Input, ...) or use the OpenPose"
769 " default producer by configuring it in the configure function) or use the"
770 " ThreadManagerMode::Asynchronous(In) mode.";
771 error(message, __LINE__, __FUNCTION__, __FILE__);
773 if (outputWs.empty() && userOutputWs.empty() && guiW ==
nullptr
777 error(
"No output selected.", __LINE__, __FUNCTION__, __FILE__);
782 threadManager.
reset();
783 unsigned long long threadId = 0ull;
785 auto queueOut = 1ull;
788 const auto wIdGenerator = std::make_shared<WIdGenerator<TDatumsSP>>();
789 std::vector<TWorker> workersAux{wIdGenerator};
791 if (scaleAndSizeExtractorW !=
nullptr)
792 workersAux =
mergeVectors(workersAux, {scaleAndSizeExtractorW});
793 if (cvMatToOpInputW !=
nullptr)
794 workersAux =
mergeVectors(workersAux, {cvMatToOpInputW});
796 if (cvMatToOpOutputW !=
nullptr)
797 workersAux =
mergeVectors(workersAux, {cvMatToOpOutputW});
801 if (!userInputWs.empty() && userInputWsOnNewThread)
805 threadManager.
add(threadId, userInputWs, queueIn++, queueOut++);
809 else if (!userInputWs.empty())
812 else if (datumProducerW !=
nullptr)
813 workersAux =
mergeVectors({datumProducerW}, workersAux);
817 error(
"No input selected.", __LINE__, __FUNCTION__, __FILE__);
820 threadManager.
add(threadId, workersAux, queueIn++, queueOut++);
826 if (!poseExtractorsWs.empty())
828 if (multiThreadEnabled)
830 for (
auto& wPose : poseExtractorsWs)
833 threadManager.
add(threadId, wPose, queueIn, queueOut);
839 if (poseExtractorsWs.size() > 1u)
841 const auto wQueueOrderer = std::make_shared<WQueueOrderer<TDatumsSP>>();
843 threadManager.
add(threadId, wQueueOrderer, queueIn++, queueOut++);
849 if (poseExtractorsWs.size() > 1)
850 log(
"Multi-threading disabled, only 1 thread running. All GPUs have been disabled but the"
851 " first one, which is defined by gpuNumberStart (e.g., in the OpenPose demo, it is set"
854 threadManager.
add(threadId, poseExtractorsWs.at(0), queueIn++, queueOut++);
858 const auto wQueueAssembler = std::make_shared<WQueueAssembler<TDatumsSP, TDatums>>();
860 if (!poseTriangulationsWs.empty())
864 threadManager.
add(threadId, wQueueAssembler, queueIn++, queueOut++);
867 if (multiThreadEnabled)
869 for (
auto& wPoseTriangulations : poseTriangulationsWs)
872 threadManager.
add(threadId, wPoseTriangulations, queueIn, queueOut);
878 if (poseTriangulationsWs.size() > 1u)
880 const auto wQueueOrderer = std::make_shared<WQueueOrderer<TDatumsSP>>();
882 threadManager.
add(threadId, wQueueOrderer, queueIn++, queueOut++);
888 if (poseTriangulationsWs.size() > 1)
889 log(
"Multi-threading disabled, only 1 thread running for 3-D triangulation.",
892 threadManager.
add(threadId, poseTriangulationsWs.at(0), queueIn++, queueOut++);
896 postProcessingWs =
mergeVectors({wQueueAssembler}, postProcessingWs);
898 if (!jointAngleEstimationsWs.empty())
900 if (multiThreadEnabled)
902 for (
auto& wJointAngleEstimator : jointAngleEstimationsWs)
905 threadManager.
add(threadId, wJointAngleEstimator, queueIn, queueOut);
911 if (jointAngleEstimationsWs.size() > 1)
913 const auto wQueueOrderer = std::make_shared<WQueueOrderer<TDatumsSP>>();
915 threadManager.
add(threadId, wQueueOrderer, queueIn++, queueOut++);
921 if (jointAngleEstimationsWs.size() > 1)
922 log(
"Multi-threading disabled, only 1 thread running for joint angle estimation.",
925 threadManager.
add(threadId, jointAngleEstimationsWs.at(0), queueIn++, queueOut++);
929 if (!postProcessingWs.empty())
939 if (!userPostProcessingWs.empty())
942 if (userPostProcessingWsOnNewThread)
945 threadManager.
add(threadId, userPostProcessingWs, queueIn++, queueOut++);
951 outputWs =
mergeVectors(outputWs, userPostProcessingWs);
954 if (!outputWs.empty())
958 threadManager.
add(threadId, outputWs, queueIn++, queueOut++);
963 if (!userOutputWs.empty())
965 if (userOutputWsOnNewThread)
968 threadManager.
add(threadId, userOutputWs, queueIn++, queueOut++);
974 threadManager.
add(threadId-1, userOutputWs, queueIn++, queueOut++);
982 threadManager.
add(threadId, guiW, queueIn++, queueOut++);
987 catch (
const std::exception& e)
989 error(e.what(), __LINE__, __FUNCTION__, __FILE__);
994 #endif // OPENPOSE_WRAPPER_WRAPPER_AUXILIARY_HPP
OP_API void threadIdPP(unsigned long long &threadId, const bool multiThreadEnabled)
int writeCocoJsonVariant
Definition: wrapperStructOutput.hpp:62
Definition: wHandDetectorTracking.hpp:11
Definition: wGuiInfoAdder.hpp:11
OP_API std::shared_ptr< Producer > createProducer(const ProducerType producerType=ProducerType::None, const std::string &producerString="", const Point< int > &cameraResolution=Point< int >{-1,-1}, const double webcamFps=30., const std::string &cameraParameterPath="models/cameraParameters/", const bool undistortImage=true, const unsigned int imageDirectoryStereo=-1)
std::array< T, N > array
Definition: cl2.hpp:594
float alphaHeatMap
Definition: wrapperStructFace.hpp:46
std::string writeHeatMapsFormat
Definition: wrapperStructOutput.hpp:96
Definition: wPoseSaver.hpp:12
Definition: wrapperStructPose.hpp:17
std::string writeKeypoint
Definition: wrapperStructOutput.hpp:28
float alphaKeypoint
Definition: wrapperStructFace.hpp:39
Definition: wFaceSaver.hpp:12
float alphaKeypoint
Definition: wrapperStructHand.hpp:61
OP_API void wrapperConfigureSanityChecks(WrapperStructPose &wrapperStructPose, const WrapperStructFace &wrapperStructFace, const WrapperStructHand &wrapperStructHand, const WrapperStructExtra &wrapperStructExtra, const WrapperStructInput &wrapperStructInput, const WrapperStructOutput &wrapperStructOutput, const WrapperStructGui &wrapperStructGui, const bool renderOutput, const bool userOutputWsEmpty, const std::shared_ptr< Producer > &producerSharedPtr, const ThreadManagerMode threadManagerMode)
Definition: wPeopleJsonSaver.hpp:11
Definition: wHandRenderer.hpp:11
double writeVideoFps
Definition: wrapperStructOutput.hpp:101
Definition: wImageSaver.hpp:11
std::string udpPort
Definition: wrapperStructOutput.hpp:125
std::string writeImages
Definition: wrapperStructOutput.hpp:68
std::shared_ptr< std::atomic< bool > > getIsRunningSharedPtr()
Definition: threadManager.hpp:40
T fastMax(const T a, const T b)
Definition: fastMath.hpp:70
float alphaHeatMap
Definition: wrapperStructHand.hpp:68
Definition: wKeypointScaler.hpp:11
std::string writeHeatMaps
Definition: wrapperStructOutput.hpp:90
std::string writeCocoJson
Definition: wrapperStructOutput.hpp:51
DisplayMode displayMode
Definition: wrapperStructGui.hpp:23
void add(const unsigned long long threadId, const std::vector< TWorker > &tWorkers, const unsigned long long queueInId, const unsigned long long queueOutId)
Definition: threadManager.hpp:125
Definition: wFaceDetector.hpp:11
void reset()
Definition: threadManager.hpp:157
Definition: wrapperStructFace.hpp:15
OP_API void error(const std::string &message, const int line=-1, const std::string &function="", const std::string &file="")
Definition: wVerbosePrinter.hpp:11
std::string udpHost
Definition: wrapperStructOutput.hpp:120
DataFormat writeKeypointFormat
Definition: wrapperStructOutput.hpp:35
std::string writeCocoFootJson
Definition: wrapperStructOutput.hpp:56
RenderMode renderMode
Definition: wrapperStructPose.hpp:81
float scaleRange
Definition: wrapperStructHand.hpp:41
OP_API GpuMode getGpuMode()
RenderMode renderMode
Definition: wrapperStructFace.hpp:33
bool tracking
Definition: wrapperStructHand.hpp:49
bool enable
Definition: wrapperStructFace.hpp:20
Definition: wFaceDetectorOpenCV.hpp:11
Definition: wVideoSaver.hpp:11
Definition: wUdpSender.hpp:11
Definition: wOpOutputToCvMat.hpp:11
OP_API std::string formatAsDirectory(const std::string &directoryPathString)
Definition: wHandDetectorUpdate.hpp:11
Definition: wrapperStructGui.hpp:12
Definition: wHandExtractorNet.hpp:11
std::string writeBvh
Definition: wrapperStructOutput.hpp:115
Definition: wFaceRenderer.hpp:11
Definition: wPoseRenderer.hpp:11
std::string writeJson
Definition: wrapperStructOutput.hpp:45
OP_API void log(const std::string &message, const Priority priority=Priority::Max, const int line=-1, const std::string &function="", const std::string &file="")
Definition: wCocoJsonSaver.hpp:11
double verbose
Definition: wrapperStructOutput.hpp:21
bool guiVerbose
Definition: wrapperStructGui.hpp:29
Definition: wrapperStructHand.hpp:15
float renderThreshold
Definition: wrapperStructHand.hpp:76
Definition: poseGpuRenderer.hpp:13
Definition: wHandDetector.hpp:11
std::string writeVideoAdam
Definition: wrapperStructOutput.hpp:108
std::vector< T > mergeVectors(const std::vector< T > &vectorA, const std::vector< T > &vectorB)
Definition: standard.hpp:40
Definition: wHandSaver.hpp:12
std::string writeVideo
Definition: wrapperStructOutput.hpp:83
Point< int > netInputSize
Definition: wrapperStructFace.hpp:27
void setSharedParametersAndIfLast(const std::tuple< std::shared_ptr< float * >, std::shared_ptr< bool >, std::shared_ptr< std::atomic< unsigned int >>, std::shared_ptr< std::atomic< unsigned long long >>, std::shared_ptr< const unsigned int >> &tuple, const bool isLast)
Definition: wHeatMapSaver.hpp:11
bool enable
Definition: wrapperStructHand.hpp:20
ThreadManagerMode
Definition: enumClasses.hpp:9
#define OP_API
Definition: macros.hpp:19
float renderThreshold
Definition: wrapperStructFace.hpp:54
std::string writeImagesFormat
Definition: wrapperStructOutput.hpp:76
Definition: wrapperStructOutput.hpp:13
OP_API int getGpuNumber()
Point< int > netInputSize
Definition: wrapperStructHand.hpp:27
void configureThreadManager(ThreadManager< TDatumsSP > &threadManager, const bool multiThreadEnabled, const ThreadManagerMode threadManagerMode, const WrapperStructPose &wrapperStructPose, const WrapperStructFace &wrapperStructFace, const WrapperStructHand &wrapperStructHand, const WrapperStructExtra &wrapperStructExtra, const WrapperStructInput &wrapperStructInput, const WrapperStructOutput &wrapperStructOutput, const WrapperStructGui &wrapperStructGui, const std::array< std::vector< TWorker >, int(WorkerType::Size)> &userWs, const std::array< bool, int(WorkerType::Size)> &userWsOnNewThread)
Definition: wrapperAuxiliary.hpp:85
int scalesNumber
Definition: wrapperStructHand.hpp:35
RenderMode renderMode
Definition: wrapperStructHand.hpp:55
bool fullScreen
Definition: wrapperStructGui.hpp:35