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>
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, wrapperStructGui, renderOutput, userOutputWsEmpty, producerSharedPtr,
153 auto numberThreads = wrapperStructPose.gpuNumber;
154 auto gpuNumberStart = wrapperStructPose.gpuNumberStart;
158 numberThreads = (wrapperStructPose.gpuNumber == 0 ? 0 : 1);
163 multiThreadEnabled =
false;
171 if (numberThreads < 0)
173 if (totalGpuNumber <= gpuNumberStart)
174 error(
"Number of initial GPU (`--number_gpu_start`) must be lower than the total number of"
175 " used GPUs (`--number_gpu`)", __LINE__, __FUNCTION__, __FILE__);
176 numberThreads = totalGpuNumber - gpuNumberStart;
179 log(
"Auto-detecting all available GPUs... Detected " + std::to_string(totalGpuNumber)
180 +
" GPU(s), using " + std::to_string(numberThreads) +
" of them starting at GPU "
184 if (gpuNumberStart + numberThreads > totalGpuNumber)
185 error(
"Initial GPU selected (`--number_gpu_start`) + number GPUs to use (`--number_gpu`) must"
186 " be lower or equal than the total number of GPUs in your machine ("
187 + std::to_string(gpuNumberStart) +
" + "
188 + std::to_string(numberThreads) +
" vs. "
189 + std::to_string(totalGpuNumber) +
").",
190 __LINE__, __FUNCTION__, __FILE__);
201 auto finalOutputSize = wrapperStructPose.outputSize;
203 const auto oPProducer = (producerSharedPtr !=
nullptr);
209 producerSharedPtr->setProducerFpsMode(displayProducerFpsMode);
214 producerSize =
Point<int>{(int)producerSharedPtr->get(CV_CAP_PROP_FRAME_WIDTH),
215 (int)producerSharedPtr->get(CV_CAP_PROP_FRAME_HEIGHT)};
217 if (finalOutputSize.x == -1 || finalOutputSize.y == -1)
218 finalOutputSize = producerSize;
224 const auto datumProducer = std::make_shared<DatumProducer<TDatums>>(
226 wrapperStructInput.
frameLast, spVideoSeek
228 datumProducerW = std::make_shared<WDatumProducer<TDatumsSP, TDatums>>(datumProducer);
231 datumProducerW =
nullptr;
233 std::vector<std::shared_ptr<PoseExtractorNet>> poseExtractorNets;
234 std::vector<std::shared_ptr<FaceExtractorNet>> faceExtractorNets;
235 std::vector<std::shared_ptr<HandExtractorNet>> handExtractorNets;
236 std::vector<std::shared_ptr<PoseGpuRenderer>> poseGpuRenderers;
237 std::shared_ptr<PoseCpuRenderer> poseCpuRenderer;
238 if (numberThreads > 0)
241 const auto scaleAndSizeExtractor = std::make_shared<ScaleAndSizeExtractor>(
242 wrapperStructPose.netInputSize, finalOutputSize, wrapperStructPose.scalesNumber,
243 wrapperStructPose.scaleGap
245 scaleAndSizeExtractorW = std::make_shared<WScaleAndSizeExtractor<TDatumsSP>>(scaleAndSizeExtractor);
248 const auto cvMatToOpInput = std::make_shared<CvMatToOpInput>(wrapperStructPose.poseModel);
249 cvMatToOpInputW = std::make_shared<WCvMatToOpInput<TDatumsSP>>(cvMatToOpInput);
252 const auto cvMatToOpOutput = std::make_shared<CvMatToOpOutput>();
253 cvMatToOpOutputW = std::make_shared<WCvMatToOpOutput<TDatumsSP>>(cvMatToOpOutput);
257 std::vector<TWorker> cpuRenderers;
258 poseExtractorsWs.clear();
259 poseExtractorsWs.resize(numberThreads);
260 if (wrapperStructPose.enable)
263 for (
auto gpuId = 0; gpuId < numberThreads; gpuId++)
264 poseExtractorNets.emplace_back(std::make_shared<PoseExtractorCaffe>(
265 wrapperStructPose.poseModel, modelFolder, gpuId + gpuNumberStart,
266 wrapperStructPose.heatMapTypes, wrapperStructPose.heatMapScale,
267 wrapperStructPose.addPartCandidates, wrapperStructPose.maximizePositives,
268 wrapperStructPose.enableGoogleLogging
272 if (renderOutputGpu || wrapperStructPose.renderMode ==
RenderMode::Cpu)
276 const auto alphaKeypoint = (wrapperStructPose.renderMode !=
RenderMode::None
277 ? wrapperStructPose.alphaKeypoint : 0.f);
279 ? wrapperStructPose.alphaHeatMap : 0.f);
283 for (
const auto& poseExtractorNet : poseExtractorNets)
285 poseGpuRenderers.emplace_back(std::make_shared<PoseGpuRenderer>(
286 wrapperStructPose.poseModel, poseExtractorNet, wrapperStructPose.renderThreshold,
287 wrapperStructPose.blendOriginalFrame, alphaKeypoint,
288 alphaHeatMap, wrapperStructPose.defaultPartToRender
295 poseCpuRenderer = std::make_shared<PoseCpuRenderer>(
296 wrapperStructPose.poseModel, wrapperStructPose.renderThreshold,
297 wrapperStructPose.blendOriginalFrame, alphaKeypoint, alphaHeatMap,
298 wrapperStructPose.defaultPartToRender);
305 poseExtractorsWs.resize(poseExtractorNets.size());
307 ? std::make_shared<PersonIdExtractor>() :
nullptr);
314 const auto keepTopNPeople = (wrapperStructPose.numberPeopleMax > 0 ?
315 std::make_shared<KeepTopNPeople>(wrapperStructPose.numberPeopleMax)
318 auto personTrackers = std::make_shared<std::vector<std::shared_ptr<PersonTracker>>>();
319 if (wrapperStructExtra.
tracking > -1)
320 personTrackers->emplace_back(
321 std::make_shared<PersonTracker>(wrapperStructExtra.
tracking == 0));
322 for (
auto i = 0u; i < poseExtractorsWs.size(); i++)
326 const auto poseExtractor = std::make_shared<PoseExtractor>(
327 poseExtractorNets.at(i), keepTopNPeople, personIdExtractor, personTrackers,
328 wrapperStructPose.numberPeopleMax, wrapperStructExtra.
tracking);
329 poseExtractorsWs.at(i) = {std::make_shared<WPoseExtractor<TDatumsSP>>(poseExtractor)};
351 if (wrapperStructFace.
enable)
355 if (wrapperStructPose.enable)
357 const auto faceDetector = std::make_shared<FaceDetector>(wrapperStructPose.poseModel);
358 for (
auto& wPose : poseExtractorsWs)
364 log(
"Body keypoint detection is disabled. Hence, using OpenCV face detector (much less"
366 for (
auto& wPose : poseExtractorsWs)
369 const auto faceDetectorOpenCV = std::make_shared<FaceDetectorOpenCV>(modelFolder);
376 for (
auto gpu = 0u; gpu < poseExtractorsWs.size(); gpu++)
379 const auto netOutputSize = wrapperStructFace.
netInputSize;
380 const auto faceExtractorNet = std::make_shared<FaceExtractorCaffe>(
381 wrapperStructFace.
netInputSize, netOutputSize, modelFolder,
382 gpu + gpuNumberStart, wrapperStructPose.heatMapTypes, wrapperStructPose.heatMapScale,
383 wrapperStructPose.enableGoogleLogging
385 faceExtractorNets.emplace_back(faceExtractorNet);
386 poseExtractorsWs.at(gpu).emplace_back(
392 if (wrapperStructHand.
enable)
394 const auto handDetector = std::make_shared<HandDetector>(wrapperStructPose.poseModel);
395 for (
auto gpu = 0u; gpu < poseExtractorsWs.size(); gpu++)
400 poseExtractorsWs.at(gpu).emplace_back(
405 poseExtractorsWs.at(gpu).emplace_back(
408 const auto netOutputSize = wrapperStructHand.
netInputSize;
409 const auto handExtractorNet = std::make_shared<HandExtractorCaffe>(
410 wrapperStructHand.
netInputSize, netOutputSize, modelFolder,
412 wrapperStructPose.heatMapTypes, wrapperStructPose.heatMapScale,
413 wrapperStructPose.enableGoogleLogging
415 handExtractorNets.emplace_back(handExtractorNet);
416 poseExtractorsWs.at(gpu).emplace_back(
421 poseExtractorsWs.at(gpu).emplace_back(
428 if (!poseGpuRenderers.empty())
429 for (
auto i = 0u; i < poseExtractorsWs.size(); i++)
431 poseGpuRenderers.at(i)
441 const auto faceRenderer = std::make_shared<FaceCpuRenderer>(wrapperStructFace.
renderThreshold,
450 for (
auto i = 0u; i < poseExtractorsWs.size(); i++)
453 const auto faceRenderer = std::make_shared<FaceGpuRenderer>(
458 if (!poseGpuRenderers.empty())
460 const bool isLastRenderer = !renderHandGpu;
462 poseGpuRenderers.at(i)
468 poseExtractorsWs.at(i).emplace_back(
473 error(
"Unknown RenderMode.", __LINE__, __FUNCTION__, __FILE__);
483 const auto handRenderer = std::make_shared<HandCpuRenderer>(wrapperStructHand.
renderThreshold,
492 for (
auto i = 0u; i < poseExtractorsWs.size(); i++)
495 const auto handRenderer = std::make_shared<HandGpuRenderer>(
500 if (!poseGpuRenderers.empty())
502 const bool isLastRenderer =
true;
504 poseGpuRenderers.at(i)
510 poseExtractorsWs.at(i).emplace_back(
515 error(
"Unknown RenderMode.", __LINE__, __FUNCTION__, __FILE__);
519 poseTriangulationsWs.clear();
523 poseTriangulationsWs.resize(
fastMax(1,
int(poseExtractorsWs.size() / 4)));
524 for (
auto i = 0u ; i < poseTriangulationsWs.size() ; i++)
526 const auto poseTriangulation = std::make_shared<PoseTriangulation>(
528 poseTriangulationsWs.at(i) = {std::make_shared<WPoseTriangulation<TDatumsSP>>(
533 postProcessingWs.clear();
545 postProcessingWs =
mergeVectors(postProcessingWs, cpuRenderers);
546 const auto opOutputToCvMat = std::make_shared<OpOutputToCvMat>();
554 (finalOutputSize == producerSize || finalOutputSize.x <= 0 || finalOutputSize.y <= 0))
557 && producerSize == wrapperStructPose.netInputSize))
560 auto keypointScaler = std::make_shared<KeypointScaler>(wrapperStructPose.keypointScale);
569 jointAngleEstimationsWs.clear();
570 #ifdef USE_3D_ADAM_MODEL
573 jointAngleEstimationsWs.resize(wrapperStructExtra.
ikThreads);
575 for (
auto i = 0u; i < jointAngleEstimationsWs.size(); i++)
577 const auto jointAngleEstimation = std::make_shared<JointAngleEstimation>(displayAdam);
578 jointAngleEstimationsWs.at(i) = {std::make_shared<WJointAngleEstimation<TDatumsSP>>(
579 jointAngleEstimation)};
587 if (wrapperStructOutput.
verbose > 0.)
589 const auto verbosePrinter = std::make_shared<VerbosePrinter>(
590 wrapperStructOutput.
verbose, producerSharedPtr->get(CV_CAP_PROP_FRAME_COUNT));
595 #ifdef USE_3D_ADAM_MODEL
596 if (!wrapperStructOutput.
udpHost.empty() && !wrapperStructOutput.
udpPort.empty())
598 const auto udpSender = std::make_shared<UdpSender>(wrapperStructOutput.
udpHost,
604 if (!writeKeypointCleaned.empty())
606 const auto keypointSaver = std::make_shared<KeypointSaver>(writeKeypointCleaned,
609 if (wrapperStructFace.
enable)
611 if (wrapperStructHand.
enable)
616 if (!writeJsonCleaned.empty())
618 const auto peopleJsonSaver = std::make_shared<PeopleJsonSaver>(writeJsonCleaned);
625 const auto humanFormat =
true;
626 const auto cocoJsonSaver = std::make_shared<CocoJsonSaver>(
638 const auto humanFormat =
true;
639 const auto cocoJsonSaver = std::make_shared<CocoJsonSaver>(wrapperStructOutput.
writeCocoFootJson,
644 if (!writeImagesCleaned.empty())
646 const auto imageSaver = std::make_shared<ImageSaver>(writeImagesCleaned,
654 && (producerSharedPtr ==
nullptr || producerSharedPtr->get(CV_CAP_PROP_FPS) <= 0))
655 error(
"The frame rate of the frames producer is unknown. Set `--write_video_fps` to your desired"
656 " FPS if you wanna record video (`--write_video`). E.g., if it is a folder of images, you"
657 " will have to know or guess the frame rate; if it is a webcam, you should use the OpenPose"
658 " displayed FPS as desired value. If you do not care, simply add `--write_video_fps 30`.",
659 __LINE__, __FUNCTION__, __FILE__);
660 const auto originalVideoFps = (
662 wrapperStructOutput.
writeVideoFps : producerSharedPtr->get(CV_CAP_PROP_FPS));
666 error(
"Video file can only be recorded inside `wrapper/wrapper.hpp` if the producer"
667 " is one of the default ones (e.g., video, webcam, ...).",
668 __LINE__, __FUNCTION__, __FILE__);
669 if (finalOutputSize.x <= 0 || finalOutputSize.y <= 0)
670 error(
"Video can only be recorded if outputSize is fixed (e.g., video, webcam, IP camera),"
671 " but not for a image directory.", __LINE__, __FUNCTION__, __FILE__);
672 const auto videoSaver = std::make_shared<VideoSaver>(
673 wrapperStructOutput.
writeVideo, CV_FOURCC(
'M',
'J',
'P',
'G'), originalVideoFps, finalOutputSize
678 #ifdef USE_3D_ADAM_MODEL
679 if (!wrapperStructOutput.
writeBvh.empty())
681 const auto bvhSaver = std::make_shared<BvhSaver>(
682 wrapperStructOutput.
writeBvh, JointAngleEstimation::getTotalModel(), originalVideoFps
684 outputWs.emplace_back(std::make_shared<WBvhSaver<TDatumsSP>>(bvhSaver));
689 if (!writeHeatMapsCleaned.empty())
691 const auto heatMapSaver = std::make_shared<HeatMapSaver>(writeHeatMapsCleaned,
699 if (wrapperStructGui.
guiVerbose && (guiEnabled || !userOutputWs.empty()
703 const auto guiInfoAdder = std::make_shared<GuiInfoAdder>(numberThreads, guiEnabled);
711 std::vector<std::shared_ptr<Renderer>> renderers;
713 renderers.emplace_back(std::static_pointer_cast<Renderer>(poseCpuRenderer));
715 for (
const auto& poseGpuRenderer : poseGpuRenderers)
716 renderers.emplace_back(std::static_pointer_cast<Renderer>(poseGpuRenderer));
721 #ifdef USE_3D_ADAM_MODEL
723 const auto gui = std::make_shared<GuiAdam>(
725 spVideoSeek, poseExtractorNets, faceExtractorNets, handExtractorNets, renderers,
726 wrapperStructGui.
displayMode, JointAngleEstimation::getTotalModel(),
730 guiW = {std::make_shared<WGuiAdam<TDatumsSP>>(gui)};
738 const auto gui = std::make_shared<Gui3D>(
740 spVideoSeek, poseExtractorNets, faceExtractorNets, handExtractorNets, renderers,
741 wrapperStructPose.poseModel, wrapperStructGui.
displayMode
744 guiW = {std::make_shared<WGui3D<TDatumsSP>>(gui)};
750 const auto gui = std::make_shared<Gui>(
752 spVideoSeek, poseExtractorNets, faceExtractorNets, handExtractorNets, renderers
755 guiW = {std::make_shared<WGui<TDatumsSP>>(gui)};
758 error(
"Unknown DisplayMode.", __LINE__, __FUNCTION__, __FILE__);
770 if ((datumProducerW ==
nullptr) == (userInputWs.empty())
774 const auto message =
"You need to have 1 and only 1 producer selected. You can introduce your own"
775 " producer by using setWorker(WorkerType::Input, ...) or use the OpenPose"
776 " default producer by configuring it in the configure function) or use the"
777 " ThreadManagerMode::Asynchronous(In) mode.";
778 error(message, __LINE__, __FUNCTION__, __FILE__);
780 if (outputWs.empty() && userOutputWs.empty() && guiW ==
nullptr
784 error(
"No output selected.", __LINE__, __FUNCTION__, __FILE__);
789 threadManager.
reset();
790 unsigned long long threadId = 0ull;
792 auto queueOut = 1ull;
795 const auto wIdGenerator = std::make_shared<WIdGenerator<TDatumsSP>>();
796 std::vector<TWorker> workersAux{wIdGenerator};
798 if (scaleAndSizeExtractorW !=
nullptr)
799 workersAux =
mergeVectors(workersAux, {scaleAndSizeExtractorW});
800 if (cvMatToOpInputW !=
nullptr)
801 workersAux =
mergeVectors(workersAux, {cvMatToOpInputW});
803 if (cvMatToOpOutputW !=
nullptr)
804 workersAux =
mergeVectors(workersAux, {cvMatToOpOutputW});
808 if (!userInputWs.empty() && userInputWsOnNewThread)
812 threadManager.
add(threadId, userInputWs, queueIn++, queueOut++);
816 else if (!userInputWs.empty())
819 else if (datumProducerW !=
nullptr)
820 workersAux =
mergeVectors({datumProducerW}, workersAux);
824 error(
"No input selected.", __LINE__, __FUNCTION__, __FILE__);
827 threadManager.
add(threadId, workersAux, queueIn++, queueOut++);
833 if (!poseExtractorsWs.empty())
835 if (multiThreadEnabled)
837 for (
auto& wPose : poseExtractorsWs)
840 threadManager.
add(threadId, wPose, queueIn, queueOut);
846 if (poseExtractorsWs.size() > 1u)
848 const auto wQueueOrderer = std::make_shared<WQueueOrderer<TDatumsSP>>();
850 threadManager.
add(threadId, wQueueOrderer, queueIn++, queueOut++);
856 if (poseExtractorsWs.size() > 1)
857 log(
"Multi-threading disabled, only 1 thread running. All GPUs have been disabled but the"
858 " first one, which is defined by gpuNumberStart (e.g., in the OpenPose demo, it is set"
861 threadManager.
add(threadId, poseExtractorsWs.at(0), queueIn++, queueOut++);
865 const auto wQueueAssembler = std::make_shared<WQueueAssembler<TDatumsSP, TDatums>>();
867 if (!poseTriangulationsWs.empty())
871 threadManager.
add(threadId, wQueueAssembler, queueIn++, queueOut++);
874 if (multiThreadEnabled)
876 for (
auto& wPoseTriangulations : poseTriangulationsWs)
879 threadManager.
add(threadId, wPoseTriangulations, queueIn, queueOut);
885 if (poseTriangulationsWs.size() > 1u)
887 const auto wQueueOrderer = std::make_shared<WQueueOrderer<TDatumsSP>>();
889 threadManager.
add(threadId, wQueueOrderer, queueIn++, queueOut++);
895 if (poseTriangulationsWs.size() > 1)
896 log(
"Multi-threading disabled, only 1 thread running for 3-D triangulation.",
899 threadManager.
add(threadId, poseTriangulationsWs.at(0), queueIn++, queueOut++);
903 postProcessingWs =
mergeVectors({wQueueAssembler}, postProcessingWs);
905 if (!jointAngleEstimationsWs.empty())
907 if (multiThreadEnabled)
909 for (
auto& wJointAngleEstimator : jointAngleEstimationsWs)
912 threadManager.
add(threadId, wJointAngleEstimator, queueIn, queueOut);
918 if (jointAngleEstimationsWs.size() > 1)
920 const auto wQueueOrderer = std::make_shared<WQueueOrderer<TDatumsSP>>();
922 threadManager.
add(threadId, wQueueOrderer, queueIn++, queueOut++);
928 if (jointAngleEstimationsWs.size() > 1)
929 log(
"Multi-threading disabled, only 1 thread running for joint angle estimation.",
932 threadManager.
add(threadId, jointAngleEstimationsWs.at(0), queueIn++, queueOut++);
936 if (!postProcessingWs.empty())
946 if (!userPostProcessingWs.empty())
949 if (userPostProcessingWsOnNewThread)
952 threadManager.
add(threadId, userPostProcessingWs, queueIn++, queueOut++);
958 outputWs =
mergeVectors(outputWs, userPostProcessingWs);
961 if (!outputWs.empty())
965 threadManager.
add(threadId, outputWs, queueIn++, queueOut++);
970 if (!userOutputWs.empty())
972 if (userOutputWsOnNewThread)
975 threadManager.
add(threadId, userOutputWs, queueIn++, queueOut++);
981 threadManager.
add(threadId-1, userOutputWs, queueIn++, queueOut++);
989 threadManager.
add(threadId, guiW, queueIn++, queueOut++);
994 catch (
const std::exception& e)
996 error(e.what(), __LINE__, __FUNCTION__, __FILE__);
1001 #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
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:105
Definition: wImageSaver.hpp:11
std::string udpPort
Definition: wrapperStructOutput.hpp:129
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="")
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 std::string &cameraParameterPath="models/cameraParameters/", const bool undistortImage=true, const unsigned int imageDirectoryStereo=-1)
Definition: wVerbosePrinter.hpp:11
std::string udpHost
Definition: wrapperStructOutput.hpp:124
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:119
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:112
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