1 #ifndef OPENPOSE_WRAPPER_WRAPPER_AUXILIARY_HPP
2 #define OPENPOSE_WRAPPER_WRAPPER_AUXILIARY_HPP
29 WrapperStructPose& wrapperStructPose,
const WrapperStructFace& wrapperStructFace,
30 const WrapperStructHand& wrapperStructHand,
const WrapperStructExtra& wrapperStructExtra,
31 const WrapperStructInput& wrapperStructInput,
const WrapperStructOutput& wrapperStructOutput,
32 const bool renderOutput,
const bool userOutputWsEmpty,
const std::shared_ptr<Producer>& producerSharedPtr,
43 OP_API void threadIdPP(
unsigned long long& threadId,
const bool multiThreadEnabled);
51 template<
typename TDatums,
52 typename TDatumsSP = std::shared_ptr<TDatums>,
53 typename TWorker = std::shared_ptr<Worker<TDatumsSP>>>
55 ThreadManager<TDatumsSP>& threadManager,
const bool multiThreadEnabled,
56 const ThreadManagerMode threadManagerMode,
const WrapperStructPose& wrapperStructPose,
57 const WrapperStructFace& wrapperStructFace,
const WrapperStructHand& wrapperStructHand,
58 const WrapperStructExtra& wrapperStructExtra,
const WrapperStructInput& wrapperStructInput,
59 const WrapperStructOutput& wrapperStructOutput,
83 template<
typename TDatums,
typename TDatumsSP,
typename TWorker>
105 auto wrapperStructPose = wrapperStructPoseTemp;
106 auto multiThreadEnabled = multiThreadEnabledTemp;
109 TWorker datumProducerW;
110 TWorker scaleAndSizeExtractorW;
111 TWorker cvMatToOpInputW;
112 TWorker cvMatToOpOutputW;
113 std::vector<std::vector<TWorker>> poseExtractorsWs;
114 std::vector<std::vector<TWorker>> poseTriangulationsWs;
115 std::vector<std::vector<TWorker>> jointAngleEstimationsWs;
116 std::vector<TWorker> postProcessingWs;
117 std::vector<TWorker> outputWs;
129 const auto spVideoSeek = std::make_shared<std::pair<std::atomic<bool>, std::atomic<int>>>();
131 spVideoSeek->first =
false;
132 spVideoSeek->second = 0;
138 const auto renderOutputGpu = wrapperStructPose.renderMode ==
RenderMode::Gpu
146 const auto userOutputWsEmpty = userOutputWs.empty();
148 wrapperStructPose, wrapperStructFace, wrapperStructHand, wrapperStructExtra, wrapperStructInput,
149 wrapperStructOutput, renderOutput, userOutputWsEmpty, producerSharedPtr, threadManagerMode);
152 auto numberThreads = wrapperStructPose.gpuNumber;
153 auto gpuNumberStart = wrapperStructPose.gpuNumberStart;
157 numberThreads = (wrapperStructPose.gpuNumber == 0 ? 0 : 1);
162 multiThreadEnabled =
false;
170 if (numberThreads < 0)
172 if (totalGpuNumber <= gpuNumberStart)
173 error(
"Number of initial GPU (`--number_gpu_start`) must be lower than the total number of"
174 " used GPUs (`--number_gpu`)", __LINE__, __FUNCTION__, __FILE__);
175 numberThreads = totalGpuNumber - gpuNumberStart;
178 log(
"Auto-detecting all available GPUs... Detected " + std::to_string(totalGpuNumber)
179 +
" GPU(s), using " + std::to_string(numberThreads) +
" of them starting at GPU "
183 if (gpuNumberStart + numberThreads > totalGpuNumber)
184 error(
"Initial GPU selected (`--number_gpu_start`) + number GPUs to use (`--number_gpu`) must"
185 " be lower or equal than the total number of GPUs in your machine ("
186 + std::to_string(gpuNumberStart) +
" + "
187 + std::to_string(numberThreads) +
" vs. "
188 + std::to_string(totalGpuNumber) +
").",
189 __LINE__, __FUNCTION__, __FILE__);
200 auto finalOutputSize = wrapperStructPose.outputSize;
202 const auto oPProducer = (producerSharedPtr !=
nullptr);
208 producerSharedPtr->setProducerFpsMode(displayProducerFpsMode);
213 producerSize =
Point<int>{(int)producerSharedPtr->get(CV_CAP_PROP_FRAME_WIDTH),
214 (int)producerSharedPtr->get(CV_CAP_PROP_FRAME_HEIGHT)};
216 if (finalOutputSize.x == -1 || finalOutputSize.y == -1)
217 finalOutputSize = producerSize;
223 const auto datumProducer = std::make_shared<DatumProducer<TDatums>>(
225 wrapperStructInput.
frameLast, spVideoSeek
227 datumProducerW = std::make_shared<WDatumProducer<TDatumsSP, TDatums>>(datumProducer);
230 datumProducerW =
nullptr;
232 std::vector<std::shared_ptr<PoseExtractorNet>> poseExtractorNets;
233 std::vector<std::shared_ptr<FaceExtractorNet>> faceExtractorNets;
234 std::vector<std::shared_ptr<HandExtractorNet>> handExtractorNets;
235 std::vector<std::shared_ptr<PoseGpuRenderer>> poseGpuRenderers;
236 std::shared_ptr<PoseCpuRenderer> poseCpuRenderer;
237 if (numberThreads > 0)
240 const auto scaleAndSizeExtractor = std::make_shared<ScaleAndSizeExtractor>(
241 wrapperStructPose.netInputSize, finalOutputSize, wrapperStructPose.scalesNumber,
242 wrapperStructPose.scaleGap
244 scaleAndSizeExtractorW = std::make_shared<WScaleAndSizeExtractor<TDatumsSP>>(scaleAndSizeExtractor);
247 const auto cvMatToOpInput = std::make_shared<CvMatToOpInput>(wrapperStructPose.poseModel);
248 cvMatToOpInputW = std::make_shared<WCvMatToOpInput<TDatumsSP>>(cvMatToOpInput);
251 const auto cvMatToOpOutput = std::make_shared<CvMatToOpOutput>();
252 cvMatToOpOutputW = std::make_shared<WCvMatToOpOutput<TDatumsSP>>(cvMatToOpOutput);
256 std::vector<TWorker> cpuRenderers;
257 poseExtractorsWs.clear();
258 poseExtractorsWs.resize(numberThreads);
259 if (wrapperStructPose.enable)
262 for (
auto gpuId = 0; gpuId < numberThreads; gpuId++)
263 poseExtractorNets.emplace_back(std::make_shared<PoseExtractorCaffe>(
264 wrapperStructPose.poseModel, modelFolder, gpuId + gpuNumberStart,
265 wrapperStructPose.heatMapTypes, wrapperStructPose.heatMapScale,
266 wrapperStructPose.addPartCandidates, wrapperStructPose.enableGoogleLogging
270 if (renderOutputGpu || wrapperStructPose.renderMode ==
RenderMode::Cpu)
274 const auto alphaKeypoint = (wrapperStructPose.renderMode !=
RenderMode::None
275 ? wrapperStructPose.alphaKeypoint : 0.f);
277 ? wrapperStructPose.alphaHeatMap : 0.f);
281 for (
const auto& poseExtractorNet : poseExtractorNets)
283 poseGpuRenderers.emplace_back(std::make_shared<PoseGpuRenderer>(
284 wrapperStructPose.poseModel, poseExtractorNet, wrapperStructPose.renderThreshold,
285 wrapperStructPose.blendOriginalFrame, alphaKeypoint,
286 alphaHeatMap, wrapperStructPose.defaultPartToRender
293 poseCpuRenderer = std::make_shared<PoseCpuRenderer>(
294 wrapperStructPose.poseModel, wrapperStructPose.renderThreshold,
295 wrapperStructPose.blendOriginalFrame, alphaKeypoint, alphaHeatMap,
296 wrapperStructPose.defaultPartToRender);
303 poseExtractorsWs.resize(poseExtractorNets.size());
305 ? std::make_shared<PersonIdExtractor>() :
nullptr);
312 const auto keepTopNPeople = (wrapperStructPose.numberPeopleMax > 0 ?
313 std::make_shared<KeepTopNPeople>(wrapperStructPose.numberPeopleMax)
316 auto personTrackers = std::make_shared<std::vector<std::shared_ptr<PersonTracker>>>();
317 if (wrapperStructExtra.
tracking > -1)
318 personTrackers->emplace_back(
319 std::make_shared<PersonTracker>(wrapperStructExtra.
tracking == 0));
320 for (
auto i = 0u; i < poseExtractorsWs.size(); i++)
324 const auto poseExtractor = std::make_shared<PoseExtractor>(
325 poseExtractorNets.at(i), keepTopNPeople, personIdExtractor, personTrackers,
326 wrapperStructPose.numberPeopleMax, wrapperStructExtra.
tracking);
327 poseExtractorsWs.at(i) = {std::make_shared<WPoseExtractor<TDatumsSP>>(poseExtractor)};
349 if (wrapperStructFace.
enable)
353 if (wrapperStructPose.enable)
355 const auto faceDetector = std::make_shared<FaceDetector>(wrapperStructPose.poseModel);
356 for (
auto& wPose : poseExtractorsWs)
362 log(
"Body keypoint detection is disabled. Hence, using OpenCV face detector (much less"
364 for (
auto& wPose : poseExtractorsWs)
367 const auto faceDetectorOpenCV = std::make_shared<FaceDetectorOpenCV>(modelFolder);
374 for (
auto gpu = 0u; gpu < poseExtractorsWs.size(); gpu++)
377 const auto netOutputSize = wrapperStructFace.
netInputSize;
378 const auto faceExtractorNet = std::make_shared<FaceExtractorCaffe>(
379 wrapperStructFace.
netInputSize, netOutputSize, modelFolder,
380 gpu + gpuNumberStart, wrapperStructPose.heatMapTypes, wrapperStructPose.heatMapScale,
381 wrapperStructPose.enableGoogleLogging
383 faceExtractorNets.emplace_back(faceExtractorNet);
384 poseExtractorsWs.at(gpu).emplace_back(
390 if (wrapperStructHand.
enable)
392 const auto handDetector = std::make_shared<HandDetector>(wrapperStructPose.poseModel);
393 for (
auto gpu = 0u; gpu < poseExtractorsWs.size(); gpu++)
398 poseExtractorsWs.at(gpu).emplace_back(
403 poseExtractorsWs.at(gpu).emplace_back(
406 const auto netOutputSize = wrapperStructHand.
netInputSize;
407 const auto handExtractorNet = std::make_shared<HandExtractorCaffe>(
408 wrapperStructHand.
netInputSize, netOutputSize, modelFolder,
410 wrapperStructPose.heatMapTypes, wrapperStructPose.heatMapScale,
411 wrapperStructPose.enableGoogleLogging
413 handExtractorNets.emplace_back(handExtractorNet);
414 poseExtractorsWs.at(gpu).emplace_back(
419 poseExtractorsWs.at(gpu).emplace_back(
426 if (!poseGpuRenderers.empty())
427 for (
auto i = 0u; i < poseExtractorsWs.size(); i++)
429 poseGpuRenderers.at(i)
439 const auto faceRenderer = std::make_shared<FaceCpuRenderer>(wrapperStructFace.
renderThreshold,
448 for (
auto i = 0u; i < poseExtractorsWs.size(); i++)
451 const auto faceRenderer = std::make_shared<FaceGpuRenderer>(
456 if (!poseGpuRenderers.empty())
458 const bool isLastRenderer = !renderHandGpu;
460 poseGpuRenderers.at(i)
466 poseExtractorsWs.at(i).emplace_back(
471 error(
"Unknown RenderMode.", __LINE__, __FUNCTION__, __FILE__);
481 const auto handRenderer = std::make_shared<HandCpuRenderer>(wrapperStructHand.
renderThreshold,
490 for (
auto i = 0u; i < poseExtractorsWs.size(); i++)
493 const auto handRenderer = std::make_shared<HandGpuRenderer>(
498 if (!poseGpuRenderers.empty())
500 const bool isLastRenderer =
true;
502 poseGpuRenderers.at(i)
508 poseExtractorsWs.at(i).emplace_back(
513 error(
"Unknown RenderMode.", __LINE__, __FUNCTION__, __FILE__);
517 poseTriangulationsWs.clear();
521 poseTriangulationsWs.resize(
fastMax(1,
int(poseExtractorsWs.size() / 4)));
522 for (
auto i = 0u ; i < poseTriangulationsWs.size() ; i++)
524 const auto poseTriangulation = std::make_shared<PoseTriangulation>(
526 poseTriangulationsWs.at(i) = {std::make_shared<WPoseTriangulation<TDatumsSP>>(
531 postProcessingWs.clear();
543 postProcessingWs =
mergeVectors(postProcessingWs, cpuRenderers);
544 const auto opOutputToCvMat = std::make_shared<OpOutputToCvMat>();
552 (finalOutputSize == producerSize || finalOutputSize.x <= 0 || finalOutputSize.y <= 0))
555 && producerSize == wrapperStructPose.netInputSize))
558 auto keypointScaler = std::make_shared<KeypointScaler>(wrapperStructPose.keypointScale);
567 jointAngleEstimationsWs.clear();
568 #ifdef USE_3D_ADAM_MODEL
571 jointAngleEstimationsWs.resize(wrapperStructExtra.
ikThreads);
573 for (
auto i = 0u; i < jointAngleEstimationsWs.size(); i++)
575 const auto jointAngleEstimation = std::make_shared<JointAngleEstimation>(displayAdam);
576 jointAngleEstimationsWs.at(i) = {std::make_shared<WJointAngleEstimation<TDatumsSP>>(
577 jointAngleEstimation)};
585 #ifdef USE_3D_ADAM_MODEL
586 if (!wrapperStructOutput.
udpHost.empty() && !wrapperStructOutput.
udpPort.empty())
588 const auto udpSender = std::make_shared<UdpSender>(wrapperStructOutput.
udpHost,
594 if (!writeKeypointCleaned.empty())
596 const auto keypointSaver = std::make_shared<KeypointSaver>(writeKeypointCleaned,
599 if (wrapperStructFace.
enable)
601 if (wrapperStructHand.
enable)
606 if (!writeJsonCleaned.empty())
608 const auto peopleJsonSaver = std::make_shared<PeopleJsonSaver>(writeJsonCleaned);
615 const auto humanFormat =
true;
616 const auto cocoJsonSaver = std::make_shared<CocoJsonSaver>(
628 const auto humanFormat =
true;
629 const auto cocoJsonSaver = std::make_shared<CocoJsonSaver>(wrapperStructOutput.
writeCocoFootJson,
634 if (!writeImagesCleaned.empty())
636 const auto imageSaver = std::make_shared<ImageSaver>(writeImagesCleaned,
641 const auto producerFps = (producerSharedPtr ==
nullptr ?
642 0. : producerSharedPtr->get(CV_CAP_PROP_FPS));
643 const auto originalVideoFps = (wrapperStructOutput.
writeVideoFps > 0 ?
649 error(
"Video file can only be recorded inside `wrapper/wrapper.hpp` if the producer"
650 " is one of the default ones (e.g., video, webcam, ...).",
651 __LINE__, __FUNCTION__, __FILE__);
652 if (finalOutputSize.x <= 0 || finalOutputSize.y <= 0)
653 error(
"Video can only be recorded if outputSize is fixed (e.g., video, webcam, IP camera),"
654 "but not for a image directory.", __LINE__, __FUNCTION__, __FILE__);
655 const auto videoSaver = std::make_shared<VideoSaver>(
656 wrapperStructOutput.
writeVideo, CV_FOURCC(
'M',
'J',
'P',
'G'), originalVideoFps, finalOutputSize
661 #ifdef USE_3D_ADAM_MODEL
662 if (!wrapperStructOutput.
writeBvh.empty())
664 const auto bvhSaver = std::make_shared<BvhSaver>(
665 wrapperStructOutput.
writeBvh, JointAngleEstimation::getTotalModel(), originalVideoFps
667 outputWs.emplace_back(std::make_shared<WBvhSaver<TDatumsSP>>(bvhSaver));
671 if (!writeHeatMapsCleaned.empty())
673 const auto heatMapSaver = std::make_shared<HeatMapSaver>(writeHeatMapsCleaned,
681 if (wrapperStructOutput.
guiVerbose && (guiEnabled || !userOutputWs.empty()
685 const auto guiInfoAdder = std::make_shared<GuiInfoAdder>(numberThreads, guiEnabled);
693 std::vector<std::shared_ptr<Renderer>> renderers;
695 renderers.emplace_back(std::static_pointer_cast<Renderer>(poseCpuRenderer));
697 for (
const auto& poseGpuRenderer : poseGpuRenderers)
698 renderers.emplace_back(std::static_pointer_cast<Renderer>(poseGpuRenderer));
703 #ifdef USE_3D_ADAM_MODEL
705 const auto gui = std::make_shared<GuiAdam>(
707 spVideoSeek, poseExtractorNets, faceExtractorNets, handExtractorNets, renderers,
708 wrapperStructOutput.
displayMode, JointAngleEstimation::getTotalModel(),
712 guiW = {std::make_shared<WGuiAdam<TDatumsSP>>(gui)};
720 const auto gui = std::make_shared<Gui3D>(
722 spVideoSeek, poseExtractorNets, faceExtractorNets, handExtractorNets, renderers,
723 wrapperStructPose.poseModel, wrapperStructOutput.
displayMode
726 guiW = {std::make_shared<WGui3D<TDatumsSP>>(gui)};
732 const auto gui = std::make_shared<Gui>(
734 spVideoSeek, poseExtractorNets, faceExtractorNets, handExtractorNets, renderers
737 guiW = {std::make_shared<WGui<TDatumsSP>>(gui)};
740 error(
"Unknown DisplayMode.", __LINE__, __FUNCTION__, __FILE__);
752 if ((datumProducerW ==
nullptr) == (userInputWs.empty())
756 const auto message =
"You need to have 1 and only 1 producer selected. You can introduce your own"
757 " producer by using setWorker(WorkerType::Input, ...) or use the OpenPose"
758 " default producer by configuring it in the configure function) or use the"
759 " ThreadManagerMode::Asynchronous(In) mode.";
760 error(message, __LINE__, __FUNCTION__, __FILE__);
762 if (outputWs.empty() && userOutputWs.empty() && guiW ==
nullptr
766 error(
"No output selected.", __LINE__, __FUNCTION__, __FILE__);
771 threadManager.
reset();
772 unsigned long long threadId = 0ull;
774 auto queueOut = 1ull;
777 const auto wIdGenerator = std::make_shared<WIdGenerator<TDatumsSP>>();
778 std::vector<TWorker> workersAux{wIdGenerator};
780 if (scaleAndSizeExtractorW !=
nullptr)
781 workersAux =
mergeVectors(workersAux, {scaleAndSizeExtractorW});
782 if (cvMatToOpInputW !=
nullptr)
783 workersAux =
mergeVectors(workersAux, {cvMatToOpInputW});
785 if (cvMatToOpOutputW !=
nullptr)
786 workersAux =
mergeVectors(workersAux, {cvMatToOpOutputW});
790 if (!userInputWs.empty() && userInputWsOnNewThread)
794 threadManager.
add(threadId, userInputWs, queueIn++, queueOut++);
798 else if (!userInputWs.empty())
801 else if (datumProducerW !=
nullptr)
802 workersAux =
mergeVectors({datumProducerW}, workersAux);
806 error(
"No input selected.", __LINE__, __FUNCTION__, __FILE__);
809 threadManager.
add(threadId, workersAux, queueIn++, queueOut++);
815 if (!poseExtractorsWs.empty())
817 if (multiThreadEnabled)
819 for (
auto& wPose : poseExtractorsWs)
822 threadManager.
add(threadId, wPose, queueIn, queueOut);
828 if (poseExtractorsWs.size() > 1u)
830 const auto wQueueOrderer = std::make_shared<WQueueOrderer<TDatumsSP>>();
832 threadManager.
add(threadId, wQueueOrderer, queueIn++, queueOut++);
838 if (poseExtractorsWs.size() > 1)
839 log(
"Multi-threading disabled, only 1 thread running. All GPUs have been disabled but the"
840 " first one, which is defined by gpuNumberStart (e.g., in the OpenPose demo, it is set"
843 threadManager.
add(threadId, poseExtractorsWs.at(0), queueIn++, queueOut++);
847 const auto wQueueAssembler = std::make_shared<WQueueAssembler<TDatumsSP, TDatums>>();
849 if (!poseTriangulationsWs.empty())
853 threadManager.
add(threadId, wQueueAssembler, queueIn++, queueOut++);
856 if (multiThreadEnabled)
858 for (
auto& wPoseTriangulations : poseTriangulationsWs)
861 threadManager.
add(threadId, wPoseTriangulations, queueIn, queueOut);
867 if (poseTriangulationsWs.size() > 1u)
869 const auto wQueueOrderer = std::make_shared<WQueueOrderer<TDatumsSP>>();
871 threadManager.
add(threadId, wQueueOrderer, queueIn++, queueOut++);
877 if (poseTriangulationsWs.size() > 1)
878 log(
"Multi-threading disabled, only 1 thread running for 3-D triangulation.",
881 threadManager.
add(threadId, poseTriangulationsWs.at(0), queueIn++, queueOut++);
885 postProcessingWs =
mergeVectors({wQueueAssembler}, postProcessingWs);
887 if (!jointAngleEstimationsWs.empty())
889 if (multiThreadEnabled)
891 for (
auto& wJointAngleEstimator : jointAngleEstimationsWs)
894 threadManager.
add(threadId, wJointAngleEstimator, queueIn, queueOut);
900 if (jointAngleEstimationsWs.size() > 1)
902 const auto wQueueOrderer = std::make_shared<WQueueOrderer<TDatumsSP>>();
904 threadManager.
add(threadId, wQueueOrderer, queueIn++, queueOut++);
910 if (jointAngleEstimationsWs.size() > 1)
911 log(
"Multi-threading disabled, only 1 thread running for joint angle estimation.",
914 threadManager.
add(threadId, jointAngleEstimationsWs.at(0), queueIn++, queueOut++);
918 if (!postProcessingWs.empty())
928 if (!userPostProcessingWs.empty())
931 if (userPostProcessingWsOnNewThread)
934 threadManager.
add(threadId, userPostProcessingWs, queueIn++, queueOut++);
940 outputWs =
mergeVectors(outputWs, userPostProcessingWs);
943 if (!outputWs.empty())
947 threadManager.
add(threadId, outputWs, queueIn++, queueOut++);
952 if (!userOutputWs.empty())
954 if (userOutputWsOnNewThread)
957 threadManager.
add(threadId, userOutputWs, queueIn++, queueOut++);
963 threadManager.
add(threadId-1, userOutputWs, queueIn++, queueOut++);
971 threadManager.
add(threadId, guiW, queueIn++, queueOut++);
976 catch (
const std::exception& e)
978 error(e.what(), __LINE__, __FUNCTION__, __FILE__);
983 #endif // OPENPOSE_WRAPPER_WRAPPER_AUXILIARY_HPP
OP_API void threadIdPP(unsigned long long &threadId, const bool multiThreadEnabled)
int writeCocoJsonVariant
Definition: wrapperStructOutput.hpp:78
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
bool guiVerbose
Definition: wrapperStructOutput.hpp:31
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 std::array< std::vector< TWorker >, int(WorkerType::Size)> &userWs, const std::array< bool, int(WorkerType::Size)> &userWsOnNewThread)
Definition: wrapperAuxiliary.hpp:84
std::string writeHeatMapsFormat
Definition: wrapperStructOutput.hpp:112
Definition: wPoseSaver.hpp:12
Definition: wrapperStructPose.hpp:17
std::string writeKeypoint
Definition: wrapperStructOutput.hpp:44
float alphaKeypoint
Definition: wrapperStructFace.hpp:39
Definition: wFaceSaver.hpp:12
float alphaKeypoint
Definition: wrapperStructHand.hpp:61
Definition: wPeopleJsonSaver.hpp:11
Definition: wHandRenderer.hpp:11
double writeVideoFps
Definition: wrapperStructOutput.hpp:117
Definition: wImageSaver.hpp:11
std::string udpPort
Definition: wrapperStructOutput.hpp:141
std::string writeImages
Definition: wrapperStructOutput.hpp:84
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:106
std::string writeCocoJson
Definition: wrapperStructOutput.hpp:67
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="")
bool fullScreen
Definition: wrapperStructOutput.hpp:37
std::string udpHost
Definition: wrapperStructOutput.hpp:136
DataFormat writeKeypointFormat
Definition: wrapperStructOutput.hpp:51
std::string writeCocoFootJson
Definition: wrapperStructOutput.hpp:72
RenderMode renderMode
Definition: wrapperStructPose.hpp:81
OP_API void wrapperConfigureSanityChecks(WrapperStructPose &wrapperStructPose, const WrapperStructFace &wrapperStructFace, const WrapperStructHand &wrapperStructHand, const WrapperStructExtra &wrapperStructExtra, const WrapperStructInput &wrapperStructInput, const WrapperStructOutput &wrapperStructOutput, const bool renderOutput, const bool userOutputWsEmpty, const std::shared_ptr< Producer > &producerSharedPtr, const ThreadManagerMode threadManagerMode)
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: wHandExtractorNet.hpp:11
std::string writeBvh
Definition: wrapperStructOutput.hpp:131
Definition: wFaceRenderer.hpp:11
Definition: wPoseRenderer.hpp:11
std::string writeJson
Definition: wrapperStructOutput.hpp:61
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
Definition: wrapperStructHand.hpp:15
float renderThreshold
Definition: wrapperStructHand.hpp:76
Definition: poseGpuRenderer.hpp:13
Definition: wHandDetector.hpp:11
std::string writeVideoAdam
Definition: wrapperStructOutput.hpp:124
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:99
DisplayMode displayMode
Definition: wrapperStructOutput.hpp:25
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:92
Definition: wrapperStructOutput.hpp:14
OP_API int getGpuNumber()
Point< int > netInputSize
Definition: wrapperStructHand.hpp:27
int scalesNumber
Definition: wrapperStructHand.hpp:35
RenderMode renderMode
Definition: wrapperStructHand.hpp:55