diff --git a/CMakeLists.txt b/CMakeLists.txt index cf8d692261472bc7673a22d820dd8d0bcf35212a..cf81a7417c49857bcf52674d2c2685a807f7c795 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 13e4719da0afb1d70ee58599d8454f3c3c92a83e..4b5f819f11efbe52c54fac9b351105bbc55b3317 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 9cc66c436c294252201c65872c74271d0338bed2..adcf7e5d04b28a3df4ca977377c957cb71bbb321 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 17ef3da5eb4abf6d4ef2e2d365bfd51212c1cea1..9422aec039b0c304b26acbd64dff325201ab966d 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 c428c941e3422248e92a8e4c5b30b544a929bcd6..0f605a8a030c66a4c556e92518b088ebb42e01fd 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 c1285fbc1e1ae2c01805b2f9d5027f3487a5bb78..7da9454ae54a973488cf73cb28898055430ebafb 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 01df7594ab8e35b6510a9e559137979498a11d24..4a80bc5d4d93c68740aed1484ea7cec7a9053167 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 34636217cb81a01826acfa8f0034911f5ca95a1a..c7b891d19c0425348776b296c56c33c7a2d10e0d 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 5b235ab5696b441312859079599f8088e2be02dc..9134c21a2f9f4220de26a45a34de11f74ed71256 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 6adfeb24dad3826b6208d159560846c350381717..4aa16f3b9d39bfb48919adc17481b6127f8bb11f 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 40afd846c1e5f0af834bfec8bb5221123198b4ef..984a6d74b50546c2ae9a214b0d1605b33fd73af4 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 1e7ba28e553969c44ffb91ef0e2f5e8708a52982..8d070cfe91c72e8b6d464c2d921edba9e5e354da 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 9f517310f5e2e50456402821acbbe0513f6aa7a9..6f7387e6cd83d49656cf2a3b59ea73119e6b575f 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 091764c9575e6f28961c360ac3c7f87cbdbd4231..a44fff3b223b2d80c1309bde93adcbd693e5e7a5 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 0505f5faec60432af57ff269f6ac3f7a2bb64dd9..5e063978b70683b52e29dc4aa4040b133138eba8 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 209b8cfcbaa8822d86989510120b9083e21e5dc3..8f5f2b0ebc591856d65f2e12c39ea87337bf5f97 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 41e462ca0546269b9061498982c6d0aacea13896..78585b342a67c5c8540058106fb095dfc47ecb58 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 582d95a079b83d6a548aaa55faa573878e875c7a..698edf7a5f78d657050f3c34ea8d64e11f21d53c 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 317077d81b63edcff609ce738aa4d43f4ed2841b..0121764d3c6c77edb19aa2f414a3652efa47c4e5 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_} { }