From 03e0ce2ba0dd7df4e185eb94f61a3548acbf2af7 Mon Sep 17 00:00:00 2001 From: gineshidalgo99 Date: Thu, 10 Jan 2019 11:40:10 -0500 Subject: [PATCH] Added prototxt_path and caffemodel_path flags --- CMakeLists.txt | 4 +- doc/demo_overview.md | 2 + doc/release_notes.md | 1 + examples/openpose/openpose.cpp | 2 +- .../1_custom_post_processing.cpp | 2 +- .../3_keypoints_from_image_configurable.cpp | 2 +- ...nchronous_loop_custom_input_and_output.cpp | 2 +- .../5_asynchronous_loop_custom_output.cpp | 2 +- .../6_synchronous_custom_postprocessing.cpp | 2 +- .../7_synchronous_custom_input.cpp | 2 +- .../8_synchronous_custom_output.cpp | 2 +- .../9_synchronous_custom_all.cpp | 2 +- include/openpose/flags.hpp | 4 ++ include/openpose/pose/poseExtractorCaffe.hpp | 13 ++--- .../openpose/utilities/pointerContainer.hpp | 12 ++--- include/openpose/wrapper/wrapperAuxiliary.hpp | 1 + .../openpose/wrapper/wrapperStructPose.hpp | 17 ++++++- src/openpose/pose/poseExtractorCaffe.cpp | 49 ++++++++++++------- src/openpose/wrapper/wrapperStructPose.cpp | 4 +- 19 files changed, 81 insertions(+), 44 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index cf8d6922..cf81a741 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -713,7 +713,7 @@ if (UNIX OR APPLE) -DCPU_ONLY=${CAFFE_CPU_ONLY} -DCMAKE_BUILD_TYPE=Release -DBUILD_docs=OFF - -DBUILD_python=OFF + -DBUILD_python=${BUILD_PYTHON} -DBUILD_python_layer=OFF -DUSE_LEVELDB=OFF -DUSE_LMDB=OFF @@ -731,7 +731,7 @@ if (UNIX OR APPLE) -DCPU_ONLY=${CAFFE_CPU_ONLY} -DCMAKE_BUILD_TYPE=Release -DBUILD_docs=OFF - -DBUILD_python=OFF + -DBUILD_python=${BUILD_PYTHON} -DBUILD_python_layer=OFF -DUSE_LEVELDB=OFF -DUSE_LMDB=OFF diff --git a/doc/demo_overview.md b/doc/demo_overview.md index 13e4719d..4b5f819f 100644 --- a/doc/demo_overview.md +++ b/doc/demo_overview.md @@ -155,6 +155,8 @@ Each flag is divided into flag name, default value, and description. 3. OpenPose - DEFINE_string(model_folder, "models/", "Folder path (absolute or relative) where the models (pose, face, ...) are located."); +- DEFINE_string(prototxt_path, "", "The combination `--model_folder` + `--prototxt_path` represents the whole path to the prototxt file. If empty, it will use the default OpenPose ProtoTxt file."); +- DEFINE_string(caffemodel_path, "", "The combination `--model_folder` + `--caffemodel_path` represents the whole path to the caffemodel file. If empty, it will use the default OpenPose CaffeModel file."); - DEFINE_string(output_resolution, "-1x-1", "The image resolution (display and output). Use \"-1x-1\" to force the program to use the input image resolution."); - DEFINE_int32(num_gpu, -1, "The number of GPU devices to use. If negative, it will use all the available GPUs in your machine."); - DEFINE_int32(num_gpu_start, 0, "GPU device start number."); diff --git a/doc/release_notes.md b/doc/release_notes.md index 9cc66c43..adcf7e5d 100644 --- a/doc/release_notes.md +++ b/doc/release_notes.md @@ -303,6 +303,7 @@ OpenPose Library - Release Notes 29. Added documentation for Nvidia TX2 with JetPack 3.3. 30. Added Travis build check for several configurations: Ubuntu (14/16)/Mac/Windows and CPU/CUDA/OpenCL and with/without Python. 31. Assigned 755 access to all sh scripts (some of them were only 644). + 32. Added the flags `--prototxt_path` and `--caffemodel_path` to allow custom ProtoTxt and CaffeModel paths. 2. Functions or parameters renamed: 1. By default, python example `tutorial_developer/python_2_pose_from_heatmaps.py` was using 2 scales starting at -1x736, changed to 1 scale at -1x368. 2. WrapperStructPose default parameters changed to match those of the OpenPose demo binary. diff --git a/examples/openpose/openpose.cpp b/examples/openpose/openpose.cpp index 17ef3da5..9422aec0 100755 --- a/examples/openpose/openpose.cpp +++ b/examples/openpose/openpose.cpp @@ -73,7 +73,7 @@ int openPoseDemo() poseModel, !FLAGS_disable_blending, (float)FLAGS_alpha_pose, (float)FLAGS_alpha_heatmap, FLAGS_part_to_show, FLAGS_model_folder, heatMapTypes, heatMapScale, FLAGS_part_candidates, (float)FLAGS_render_threshold, FLAGS_number_people_max, FLAGS_maximize_positives, FLAGS_fps_max, - enableGoogleLogging}; + FLAGS_prototxt_path, FLAGS_caffemodel_path, enableGoogleLogging}; opWrapper.configure(wrapperStructPose); // Face configuration (use op::WrapperStructFace{} to disable it) const op::WrapperStructFace wrapperStructFace{ diff --git a/examples/tutorial_add_module/1_custom_post_processing.cpp b/examples/tutorial_add_module/1_custom_post_processing.cpp index c428c941..0f605a8a 100644 --- a/examples/tutorial_add_module/1_custom_post_processing.cpp +++ b/examples/tutorial_add_module/1_custom_post_processing.cpp @@ -86,7 +86,7 @@ int tutorialAddModule1() poseModel, !FLAGS_disable_blending, (float)FLAGS_alpha_pose, (float)FLAGS_alpha_heatmap, FLAGS_part_to_show, FLAGS_model_folder, heatMapTypes, heatMapScale, FLAGS_part_candidates, (float)FLAGS_render_threshold, FLAGS_number_people_max, FLAGS_maximize_positives, FLAGS_fps_max, - enableGoogleLogging}; + FLAGS_prototxt_path, FLAGS_caffemodel_path, enableGoogleLogging}; opWrapperT.configure(wrapperStructPose); // Face configuration (use op::WrapperStructFace{} to disable it) const op::WrapperStructFace wrapperStructFace{ diff --git a/examples/tutorial_api_cpp/3_keypoints_from_image_configurable.cpp b/examples/tutorial_api_cpp/3_keypoints_from_image_configurable.cpp index c1285fbc..7da9454a 100644 --- a/examples/tutorial_api_cpp/3_keypoints_from_image_configurable.cpp +++ b/examples/tutorial_api_cpp/3_keypoints_from_image_configurable.cpp @@ -92,7 +92,7 @@ int tutorialApiCpp3() poseModel, !FLAGS_disable_blending, (float)FLAGS_alpha_pose, (float)FLAGS_alpha_heatmap, FLAGS_part_to_show, FLAGS_model_folder, heatMapTypes, heatMapScale, FLAGS_part_candidates, (float)FLAGS_render_threshold, FLAGS_number_people_max, FLAGS_maximize_positives, FLAGS_fps_max, - enableGoogleLogging}; + FLAGS_prototxt_path, FLAGS_caffemodel_path, enableGoogleLogging}; opWrapper.configure(wrapperStructPose); // Face configuration (use op::WrapperStructFace{} to disable it) const op::WrapperStructFace wrapperStructFace{ diff --git a/examples/tutorial_api_cpp/4_asynchronous_loop_custom_input_and_output.cpp b/examples/tutorial_api_cpp/4_asynchronous_loop_custom_input_and_output.cpp index 01df7594..4a80bc5d 100644 --- a/examples/tutorial_api_cpp/4_asynchronous_loop_custom_input_and_output.cpp +++ b/examples/tutorial_api_cpp/4_asynchronous_loop_custom_input_and_output.cpp @@ -227,7 +227,7 @@ int tutorialApiCpp4() poseModel, !FLAGS_disable_blending, (float)FLAGS_alpha_pose, (float)FLAGS_alpha_heatmap, FLAGS_part_to_show, FLAGS_model_folder, heatMapTypes, heatMapScale, FLAGS_part_candidates, (float)FLAGS_render_threshold, FLAGS_number_people_max, FLAGS_maximize_positives, FLAGS_fps_max, - enableGoogleLogging}; + FLAGS_prototxt_path, FLAGS_caffemodel_path, enableGoogleLogging}; opWrapperT.configure(wrapperStructPose); // Face configuration (use op::WrapperStructFace{} to disable it) const op::WrapperStructFace wrapperStructFace{ diff --git a/examples/tutorial_api_cpp/5_asynchronous_loop_custom_output.cpp b/examples/tutorial_api_cpp/5_asynchronous_loop_custom_output.cpp index 34636217..c7b891d1 100644 --- a/examples/tutorial_api_cpp/5_asynchronous_loop_custom_output.cpp +++ b/examples/tutorial_api_cpp/5_asynchronous_loop_custom_output.cpp @@ -169,7 +169,7 @@ int tutorialApiCpp5() poseModel, !FLAGS_disable_blending, (float)FLAGS_alpha_pose, (float)FLAGS_alpha_heatmap, FLAGS_part_to_show, FLAGS_model_folder, heatMapTypes, heatMapScale, FLAGS_part_candidates, (float)FLAGS_render_threshold, FLAGS_number_people_max, FLAGS_maximize_positives, FLAGS_fps_max, - enableGoogleLogging}; + FLAGS_prototxt_path, FLAGS_caffemodel_path, enableGoogleLogging}; opWrapperT.configure(wrapperStructPose); // Face configuration (use op::WrapperStructFace{} to disable it) const op::WrapperStructFace wrapperStructFace{ diff --git a/examples/tutorial_api_cpp/6_synchronous_custom_postprocessing.cpp b/examples/tutorial_api_cpp/6_synchronous_custom_postprocessing.cpp index 5b235ab5..9134c21a 100644 --- a/examples/tutorial_api_cpp/6_synchronous_custom_postprocessing.cpp +++ b/examples/tutorial_api_cpp/6_synchronous_custom_postprocessing.cpp @@ -137,7 +137,7 @@ int tutorialApiCpp6() poseModel, !FLAGS_disable_blending, (float)FLAGS_alpha_pose, (float)FLAGS_alpha_heatmap, FLAGS_part_to_show, FLAGS_model_folder, heatMapTypes, heatMapScale, FLAGS_part_candidates, (float)FLAGS_render_threshold, FLAGS_number_people_max, FLAGS_maximize_positives, FLAGS_fps_max, - enableGoogleLogging}; + FLAGS_prototxt_path, FLAGS_caffemodel_path, enableGoogleLogging}; opWrapperT.configure(wrapperStructPose); // Face configuration (use op::WrapperStructFace{} to disable it) const op::WrapperStructFace wrapperStructFace{ diff --git a/examples/tutorial_api_cpp/7_synchronous_custom_input.cpp b/examples/tutorial_api_cpp/7_synchronous_custom_input.cpp index 6adfeb24..4aa16f3b 100644 --- a/examples/tutorial_api_cpp/7_synchronous_custom_input.cpp +++ b/examples/tutorial_api_cpp/7_synchronous_custom_input.cpp @@ -173,7 +173,7 @@ int tutorialApiCpp7() poseModel, !FLAGS_disable_blending, (float)FLAGS_alpha_pose, (float)FLAGS_alpha_heatmap, FLAGS_part_to_show, FLAGS_model_folder, heatMapTypes, heatMapScale, FLAGS_part_candidates, (float)FLAGS_render_threshold, FLAGS_number_people_max, FLAGS_maximize_positives, FLAGS_fps_max, - enableGoogleLogging}; + FLAGS_prototxt_path, FLAGS_caffemodel_path, enableGoogleLogging}; opWrapperT.configure(wrapperStructPose); // Face configuration (use op::WrapperStructFace{} to disable it) const op::WrapperStructFace wrapperStructFace{ diff --git a/examples/tutorial_api_cpp/8_synchronous_custom_output.cpp b/examples/tutorial_api_cpp/8_synchronous_custom_output.cpp index 40afd846..984a6d74 100644 --- a/examples/tutorial_api_cpp/8_synchronous_custom_output.cpp +++ b/examples/tutorial_api_cpp/8_synchronous_custom_output.cpp @@ -185,7 +185,7 @@ int tutorialApiCpp8() poseModel, !FLAGS_disable_blending, (float)FLAGS_alpha_pose, (float)FLAGS_alpha_heatmap, FLAGS_part_to_show, FLAGS_model_folder, heatMapTypes, heatMapScale, FLAGS_part_candidates, (float)FLAGS_render_threshold, FLAGS_number_people_max, FLAGS_maximize_positives, FLAGS_fps_max, - enableGoogleLogging}; + FLAGS_prototxt_path, FLAGS_caffemodel_path, enableGoogleLogging}; opWrapperT.configure(wrapperStructPose); // Face configuration (use op::WrapperStructFace{} to disable it) const op::WrapperStructFace wrapperStructFace{ diff --git a/examples/tutorial_api_cpp/9_synchronous_custom_all.cpp b/examples/tutorial_api_cpp/9_synchronous_custom_all.cpp index 1e7ba28e..8d070cfe 100644 --- a/examples/tutorial_api_cpp/9_synchronous_custom_all.cpp +++ b/examples/tutorial_api_cpp/9_synchronous_custom_all.cpp @@ -284,7 +284,7 @@ int tutorialApiCpp9() poseModel, !FLAGS_disable_blending, (float)FLAGS_alpha_pose, (float)FLAGS_alpha_heatmap, FLAGS_part_to_show, FLAGS_model_folder, heatMapTypes, heatMapScale, FLAGS_part_candidates, (float)FLAGS_render_threshold, FLAGS_number_people_max, FLAGS_maximize_positives, FLAGS_fps_max, - enableGoogleLogging}; + FLAGS_prototxt_path, FLAGS_caffemodel_path, enableGoogleLogging}; opWrapperT.configure(wrapperStructPose); // Face configuration (use op::WrapperStructFace{} to disable it) const op::WrapperStructFace wrapperStructFace{ diff --git a/include/openpose/flags.hpp b/include/openpose/flags.hpp index 9f517310..6f7387e6 100644 --- a/include/openpose/flags.hpp +++ b/include/openpose/flags.hpp @@ -60,6 +60,10 @@ DEFINE_bool(frame_undistort, false, "If false (default), it #endif // OPENPOSE_FLAGS_DISABLE_PRODUCER // OpenPose DEFINE_string(model_folder, "models/", "Folder path (absolute or relative) where the models (pose, face, ...) are located."); +DEFINE_string(prototxt_path, "", "The combination `--model_folder` + `--prototxt_path` represents the whole path to the" + " prototxt file. If empty, it will use the default OpenPose ProtoTxt file."); +DEFINE_string(caffemodel_path, "", "The combination `--model_folder` + `--caffemodel_path` represents the whole path to the" + " caffemodel file. If empty, it will use the default OpenPose CaffeModel file."); DEFINE_string(output_resolution, "-1x-1", "The image resolution (display and output). Use \"-1x-1\" to force the program to use the" " input image resolution."); DEFINE_int32(num_gpu, -1, "The number of GPU devices to use. If negative, it will use all the available GPUs in your" diff --git a/include/openpose/pose/poseExtractorCaffe.hpp b/include/openpose/pose/poseExtractorCaffe.hpp index 091764c9..a44fff3b 100644 --- a/include/openpose/pose/poseExtractorCaffe.hpp +++ b/include/openpose/pose/poseExtractorCaffe.hpp @@ -10,12 +10,13 @@ namespace op class OP_API PoseExtractorCaffe : public PoseExtractorNet { public: - PoseExtractorCaffe(const PoseModel poseModel, const std::string& modelFolder, const int gpuId, - const std::vector& heatMapTypes = {}, - const ScaleMode heatMapScale = ScaleMode::ZeroToOne, - const bool addPartCandidates = false, - const bool maximizePositives = false, - const bool enableGoogleLogging = true); + PoseExtractorCaffe( + const PoseModel poseModel, const std::string& modelFolder, const int gpuId, + const std::vector& heatMapTypes = {}, + const ScaleMode heatMapScale = ScaleMode::ZeroToOne, + const bool addPartCandidates = false, const bool maximizePositives = false, + const std::string& protoTxtPath = "", const std::string& caffeModelPath = "", + const bool enableGoogleLogging = true); virtual ~PoseExtractorCaffe(); diff --git a/include/openpose/utilities/pointerContainer.hpp b/include/openpose/utilities/pointerContainer.hpp index 0505f5fa..5e063978 100644 --- a/include/openpose/utilities/pointerContainer.hpp +++ b/include/openpose/utilities/pointerContainer.hpp @@ -9,33 +9,33 @@ namespace op return (tPointerContainer != nullptr && tPointerContainer->size() > 0); } - template + template class PointerContainerGreater { public: - bool operator() (TDatums& a, TDatums& b) + bool operator() (const TDatumsSP& a, const TDatumsSP& b) { if (!b || b->empty()) return true; else if (!a || a->empty()) return false; else - return (*a)[0] > (*b)[0]; + return *(*a)[0] > *(*b)[0]; } }; - template + template class PointerContainerLess { public: - bool operator() (TDatums& a, TDatums& b) + bool operator() (const TDatumsSP& a, const TDatumsSP& b) { if (!b || b->empty()) return false; else if (!a || a->empty()) return true; else - return (*a)[0] < (*b)[0]; + return *(*a)[0] < *(*b)[0]; } }; } diff --git a/include/openpose/wrapper/wrapperAuxiliary.hpp b/include/openpose/wrapper/wrapperAuxiliary.hpp index 209b8cfc..8f5f2b0e 100644 --- a/include/openpose/wrapper/wrapperAuxiliary.hpp +++ b/include/openpose/wrapper/wrapperAuxiliary.hpp @@ -263,6 +263,7 @@ namespace op wrapperStructPose.poseModel, modelFolder, gpuId + gpuNumberStart, wrapperStructPose.heatMapTypes, wrapperStructPose.heatMapScale, wrapperStructPose.addPartCandidates, wrapperStructPose.maximizePositives, + wrapperStructPose.protoTxtPath, wrapperStructPose.caffeModelPath, wrapperStructPose.enableGoogleLogging )); diff --git a/include/openpose/wrapper/wrapperStructPose.hpp b/include/openpose/wrapper/wrapperStructPose.hpp index 41e462ca..78585b34 100644 --- a/include/openpose/wrapper/wrapperStructPose.hpp +++ b/include/openpose/wrapper/wrapperStructPose.hpp @@ -173,6 +173,20 @@ namespace op */ double fpsMax; + /** + * Final path where the pose Caffe ProtoTxt file is located. + * The combination modelFolder + protoTxtPath represents the whole path to the prototxt file. + * If empty, it will use the default OpenPose ProtoTxt file. + */ + std::string protoTxtPath; + + /** + * Final path where the pose Caffe CaffeModel is located. + * The combination modelFolder + caffeModelPath represents the whole path to the caffemodel file. + * If empty, it will use the default OpenPose CaffeModel file. + */ + std::string caffeModelPath; + /** * Whether to internally enable Google Logging. * This option is only applicable if Caffe is used. @@ -198,7 +212,8 @@ namespace op const std::string& modelFolder = "models/", const std::vector& heatMapTypes = {}, const ScaleMode heatMapScale = ScaleMode::ZeroToOne, const bool addPartCandidates = false, const float renderThreshold = 0.05f, const int numberPeopleMax = -1, const bool maximizePositives = false, - const double fpsMax = -1., const bool enableGoogleLogging = true); + const double fpsMax = -1., const std::string& protoTxtPath = "", + const std::string& caffeModelPath = "", const bool enableGoogleLogging = true); }; } diff --git a/src/openpose/pose/poseExtractorCaffe.cpp b/src/openpose/pose/poseExtractorCaffe.cpp index 582d95a0..698edf7a 100644 --- a/src/openpose/pose/poseExtractorCaffe.cpp +++ b/src/openpose/pose/poseExtractorCaffe.cpp @@ -32,6 +32,8 @@ namespace op const PoseModel mPoseModel; const int mGpuId; const std::string mModelFolder; + const std::string mProtoTxtPath; + const std::string mCaffeModelPath; const bool mEnableGoogleLogging; // General parameters std::vector> spNets; @@ -47,11 +49,15 @@ namespace op std::shared_ptr> spPeaksBlob; std::shared_ptr> spMaximumPeaksBlob; - ImplPoseExtractorCaffe(const PoseModel poseModel, const int gpuId, - const std::string& modelFolder, const bool enableGoogleLogging) : + ImplPoseExtractorCaffe( + const PoseModel poseModel, const int gpuId, const std::string& modelFolder, + const std::string& protoTxtPath, const std::string& caffeModelPath, + const bool enableGoogleLogging) : mPoseModel{poseModel}, mGpuId{gpuId}, mModelFolder{modelFolder}, + mProtoTxtPath{protoTxtPath}, + mCaffeModelPath{caffeModelPath}, mEnableGoogleLogging{enableGoogleLogging}, spResizeAndMergeCaffe{std::make_shared>()}, spNmsCaffe{std::make_shared>()}, @@ -119,23 +125,24 @@ namespace op } } - void addCaffeNetOnThread(std::vector>& net, - std::vector>>& caffeNetOutputBlob, - const PoseModel poseModel, const int gpuId, - const std::string& modelFolder, const bool enableGoogleLogging) + void addCaffeNetOnThread( + std::vector>& net, + std::vector>>& caffeNetOutputBlob, + const PoseModel poseModel, const int gpuId, const std::string& modelFolder, + const std::string& protoTxtPath, const std::string& caffeModelPath, const bool enableGoogleLogging) { try { // Add Caffe Net net.emplace_back( std::make_shared( - modelFolder + getPoseProtoTxt(poseModel), - modelFolder + getPoseTrainedModel(poseModel), + modelFolder + (protoTxtPath.empty() ? getPoseProtoTxt(poseModel) : protoTxtPath), + modelFolder + (caffeModelPath.empty() ? getPoseTrainedModel(poseModel) : caffeModelPath), gpuId, enableGoogleLogging)); // net.emplace_back( // std::make_shared( - // modelFolder + getPoseProtoTxt(poseModel), - // modelFolder + getPoseTrainedModel(poseModel), + // modelFolder + (protoTxtPath.empty() ? getPoseProtoTxt(poseModel) : protoTxtPath), + // modelFolder + (caffeModelPath.empty() ? getPoseTrainedModel(poseModel) : caffeModelPath), // gpuId)); // UNUSED(enableGoogleLogging); // Initializing them on the thread @@ -157,13 +164,15 @@ namespace op } #endif - PoseExtractorCaffe::PoseExtractorCaffe(const PoseModel poseModel, const std::string& modelFolder, - const int gpuId, const std::vector& heatMapTypes, - const ScaleMode heatMapScale, const bool addPartCandidates, - const bool maximizePositives, const bool enableGoogleLogging) : + PoseExtractorCaffe::PoseExtractorCaffe( + const PoseModel poseModel, const std::string& modelFolder, const int gpuId, + const std::vector& heatMapTypes, const ScaleMode heatMapScale, const bool addPartCandidates, + const bool maximizePositives, const std::string& protoTxtPath, const std::string& caffeModelPath, + const bool enableGoogleLogging) : PoseExtractorNet{poseModel, heatMapTypes, heatMapScale, addPartCandidates, maximizePositives} #ifdef USE_CAFFE - , upImpl{new ImplPoseExtractorCaffe{poseModel, gpuId, modelFolder, enableGoogleLogging}} + , upImpl{new ImplPoseExtractorCaffe{poseModel, gpuId, modelFolder, protoTxtPath, caffeModelPath, + enableGoogleLogging}} #endif { try @@ -201,8 +210,9 @@ namespace op // Logging log("Starting initialization on thread.", Priority::Low, __LINE__, __FUNCTION__, __FILE__); // Initialize Caffe net - addCaffeNetOnThread(upImpl->spNets, upImpl->spCaffeNetOutputBlobs, upImpl->mPoseModel, - upImpl->mGpuId, upImpl->mModelFolder, upImpl->mEnableGoogleLogging); + addCaffeNetOnThread( + upImpl->spNets, upImpl->spCaffeNetOutputBlobs, upImpl->mPoseModel, upImpl->mGpuId, + upImpl->mModelFolder, upImpl->mProtoTxtPath, upImpl->mCaffeModelPath, upImpl->mEnableGoogleLogging); #ifdef USE_CUDA cudaCheck(__LINE__, __FUNCTION__, __FILE__); #endif @@ -245,8 +255,9 @@ namespace op const auto numberScales = inputNetData.size(); upImpl->mNetInput4DSizes.resize(numberScales); while (upImpl->spNets.size() < numberScales) - addCaffeNetOnThread(upImpl->spNets, upImpl->spCaffeNetOutputBlobs, upImpl->mPoseModel, - upImpl->mGpuId, upImpl->mModelFolder, false); + addCaffeNetOnThread( + upImpl->spNets, upImpl->spCaffeNetOutputBlobs, upImpl->mPoseModel, upImpl->mGpuId, + upImpl->mModelFolder, upImpl->mProtoTxtPath, upImpl->mCaffeModelPath, false); // Process each image for (auto i = 0u ; i < inputNetData.size(); i++) diff --git a/src/openpose/wrapper/wrapperStructPose.cpp b/src/openpose/wrapper/wrapperStructPose.cpp index 317077d8..0121764d 100644 --- a/src/openpose/wrapper/wrapperStructPose.cpp +++ b/src/openpose/wrapper/wrapperStructPose.cpp @@ -10,7 +10,7 @@ namespace op const int defaultPartToRender_, const std::string& modelFolder_, const std::vector& heatMapTypes_, const ScaleMode heatMapScale_, const bool addPartCandidates_, const float renderThreshold_, const int numberPeopleMax_, const bool maximizePositives_, const double fpsMax_, - const bool enableGoogleLogging_) : + const std::string& protoTxtPath_, const std::string& caffeModelPath_, const bool enableGoogleLogging_) : enable{enable_}, netInputSize{netInputSize_}, outputSize{outputSize_}, @@ -33,6 +33,8 @@ namespace op numberPeopleMax{numberPeopleMax_}, maximizePositives{maximizePositives_}, fpsMax{fpsMax_}, + protoTxtPath{protoTxtPath_}, + caffeModelPath{caffeModelPath_}, enableGoogleLogging{enableGoogleLogging_} { } -- GitLab