From 5badd2b6c67f0b04e68162bdac9ec73c0a295ea7 Mon Sep 17 00:00:00 2001 From: Gines Hidalgo Date: Sun, 10 Jan 2021 23:21:51 -0500 Subject: [PATCH] Fixed out of GPU memories: Added net_resolution_dynamic Signed-off-by: Gines Hidalgo --- doc/demo_not_quick_start.md | 1 + doc/release_notes.md | 13 ++++---- ...rial_add_module_custom_post_processing.cpp | 14 ++++----- examples/openpose/openpose.cpp | 14 ++++----- .../03_keypoints_from_image.cpp | 14 ++++----- .../04_keypoints_from_images.cpp | 14 ++++----- .../05_keypoints_from_images_multi_gpu.cpp | 14 ++++----- .../tutorial_api_cpp/06_face_from_image.cpp | 14 ++++----- .../tutorial_api_cpp/07_hand_from_image.cpp | 14 ++++----- .../08_heatmaps_from_image.cpp | 14 ++++----- .../09_keypoints_from_heatmaps.cpp | 14 ++++----- .../10_asynchronous_custom_input.cpp | 14 ++++----- ...asynchronous_custom_input_multi_camera.cpp | 14 ++++----- .../12_asynchronous_custom_output.cpp | 14 ++++----- ...chronous_custom_input_output_and_datum.cpp | 14 ++++----- .../14_synchronous_custom_input.cpp | 14 ++++----- .../15_synchronous_custom_preprocessing.cpp | 14 ++++----- .../16_synchronous_custom_postprocessing.cpp | 14 ++++----- .../17_synchronous_custom_output.cpp | 14 ++++----- .../18_synchronous_custom_all_and_datum.cpp | 14 ++++----- .../openpose/core/scaleAndSizeExtractor.hpp | 5 +-- include/openpose/flags.hpp | 7 +++++ .../openpose/utilities/flagsToOpenPose.hpp | 6 +++- include/openpose/wrapper/wrapperAuxiliary.hpp | 4 +-- .../openpose/wrapper/wrapperStructPose.hpp | 10 ++++++ scripts/tests/pose_accuracy_all_val.sh | 2 +- scripts/tests/pose_accuracy_coco_test_dev.sh | 6 ++-- scripts/tests/pose_accuracy_coco_val.sh | 4 +-- src/openpose/core/scaleAndSizeExtractor.cpp | 31 +++++++++++++------ src/openpose/wrapper/wrapperAuxiliary.cpp | 8 +++++ src/openpose/wrapper/wrapperStructPose.cpp | 19 ++++++------ 31 files changed, 206 insertions(+), 162 deletions(-) diff --git a/doc/demo_not_quick_start.md b/doc/demo_not_quick_start.md index bb9a6afc..c03fa97b 100644 --- a/doc/demo_not_quick_start.md +++ b/doc/demo_not_quick_start.md @@ -140,6 +140,7 @@ Now that you are more familiar with OpenPose, this is a list with all the availa - DEFINE_int32(body, 1, "Select 0 to disable body keypoint detection (e.g., for faster but less accurate face keypoint detection, custom hand detector, etc.), 1 (default) for body keypoint estimation, and 2 to disable its internal body pose estimation network but still still run the greedy association parsing algorithm"); - DEFINE_string(model_pose, "BODY_25", "Model to be used. E.g., `BODY_25` (fastest for CUDA version, most accurate, and includes foot keypoints), `COCO` (18 keypoints), `MPI` (15 keypoints, least accurate model but fastest on CPU), `MPI_4_layers` (15 keypoints, even faster but less accurate)."); - DEFINE_string(net_resolution, "-1x368", "Multiples of 16. If it is increased, the accuracy potentially increases. If it is decreased, the speed increases. For maximum speed-accuracy balance, it should keep the closest aspect ratio possible to the images or videos to be processed. Using `-1` in any of the dimensions, OP will choose the optimal aspect ratio depending on the user's input value. E.g., the default `-1x368` is equivalent to `656x368` in 16:9 resolutions, e.g., full HD (1980x1080) and HD (1280x720) resolutions."); +- DEFINE_double(net_resolution_dynamic, 1., "This flag only applies to images or custom inputs (not to video or webcam). If it is zero or a negativevalue, it means that using `-1` in `net_resolution` will behave as explained in its description. Otherwise, and to avoid out of memory errors, the `-1` in `net_resolution` will clip to this value times the default 16/9 aspect ratio value (which is 656 width for a 368 height). E.g., `net_resolution_dynamic 10 net_resolution -1x368` will clip to 6560x368 (10 x 656). Recommended 1 for small GPUs (to avoid out of memory errors but maximize speed) and 0 for big GPUs (for maximum accuracy and speed)."); - DEFINE_int32(scale_number, 1, "Number of scales to average."); - DEFINE_double(scale_gap, 0.25, "Scale gap between scales. No effect unless scale_number > 1. Initial scale is always 1. If you want to change the initial scale, you actually want to multiply the `net_resolution` by your desired initial scale."); - DEFINE_double(upsampling_ratio, 0., "Upsampling ratio between the `net_resolution` and the output net results. A value less or equal than 0 (default) will use the network default value (recommended)."); diff --git a/doc/release_notes.md b/doc/release_notes.md index db77f919..ec9b4cd5 100644 --- a/doc/release_notes.md +++ b/doc/release_notes.md @@ -433,18 +433,19 @@ OpenPose - Release Notes ## Current version - Future OpenPose 1.7.1 1. Main improvements: - 1. Webcam speed boosted on Windows (by updating OpenCV). - 2. Third party versions updated: + 1. (For images and custom inputs only): Flag `--net_resolution_dynamic` added to avoid out of memory errors in low GPUs (set by default to 1). It also allows maintaining the maximum possible accuracy (for big GPUs), which was the previous default until OpenPose v1.7.0. + 2. Webcam speed boosted on Windows (by updating OpenCV). + 3. Third party versions updated: 1. OpenCV (Windows): From 4.2 to 4.5. 2. Eigen: From 3.3.4 to 3.3.8. 3. `wget` (Windows): From 1.19.1 to 1.20.3. - 3. AppVeyor now tests the actual OpenPoseDemo.exe example (Windows). - 4. Documentation improvements: + 4. AppVeyor now tests the actual OpenPoseDemo.exe example (Windows). + 5. Documentation improvements: 1. Highly simplified README.md. 2. Highly simplified doc, restructured to improve simplicity and now divided into subdirectories (`advanced`, `deprecated`, `installation`, etc). 3. More examples added to the demo quick start documentation. - 5. Calibration doc links to included chessboard pdf. - 6. Deprecated examples directories `tutorial_add_module` and `tutorial_api_thread` (and renamed as `deprecated`). They still compile, but we no longer support them. + 6. Calibration doc links to included chessboard pdf. + 7. Deprecated examples directories `tutorial_add_module` and `tutorial_api_thread` (and renamed as `deprecated`). They still compile, but we no longer support them. 2. Functions or parameters renamed: 3. Main bugs fixed: 1. Eigen working again on Windows. diff --git a/examples/deprecated/tutorial_add_module_custom_post_processing.cpp b/examples/deprecated/tutorial_add_module_custom_post_processing.cpp index 210e040e..12bfd618 100644 --- a/examples/deprecated/tutorial_add_module_custom_post_processing.cpp +++ b/examples/deprecated/tutorial_add_module_custom_post_processing.cpp @@ -85,13 +85,13 @@ void configureWrapper(op::WrapperT& opWrapperT) // Pose configuration (use WrapperStructPose{} for default and recommended configuration) const op::WrapperStructPose wrapperStructPose{ - poseMode, netInputSize, outputSize, keypointScaleMode, FLAGS_num_gpu, FLAGS_num_gpu_start, - FLAGS_scale_number, (float)FLAGS_scale_gap, op::flagsToRenderMode(FLAGS_render_pose, multipleView), - poseModel, !FLAGS_disable_blending, (float)FLAGS_alpha_pose, (float)FLAGS_alpha_heatmap, - FLAGS_part_to_show, op::String(FLAGS_model_folder), heatMapTypes, heatMapScaleMode, FLAGS_part_candidates, - (float)FLAGS_render_threshold, FLAGS_number_people_max, FLAGS_maximize_positives, FLAGS_fps_max, - op::String(FLAGS_prototxt_path), op::String(FLAGS_caffemodel_path), - (float)FLAGS_upsampling_ratio, enableGoogleLogging}; + poseMode, netInputSize, FLAGS_net_resolution_dynamic, outputSize, keypointScaleMode, FLAGS_num_gpu, + FLAGS_num_gpu_start, FLAGS_scale_number, (float)FLAGS_scale_gap, + op::flagsToRenderMode(FLAGS_render_pose, multipleView), poseModel, !FLAGS_disable_blending, + (float)FLAGS_alpha_pose, (float)FLAGS_alpha_heatmap, FLAGS_part_to_show, op::String(FLAGS_model_folder), + heatMapTypes, heatMapScaleMode, FLAGS_part_candidates, (float)FLAGS_render_threshold, + FLAGS_number_people_max, FLAGS_maximize_positives, FLAGS_fps_max, op::String(FLAGS_prototxt_path), + op::String(FLAGS_caffemodel_path), (float)FLAGS_upsampling_ratio, enableGoogleLogging}; opWrapperT.configure(wrapperStructPose); // Face configuration (use op::WrapperStructFace{} to disable it) const op::WrapperStructFace wrapperStructFace{ diff --git a/examples/openpose/openpose.cpp b/examples/openpose/openpose.cpp index c6a2eaa3..be060ea0 100755 --- a/examples/openpose/openpose.cpp +++ b/examples/openpose/openpose.cpp @@ -67,13 +67,13 @@ void configureWrapper(op::Wrapper& opWrapper) // Pose configuration (use WrapperStructPose{} for default and recommended configuration) const op::WrapperStructPose wrapperStructPose{ - poseMode, netInputSize, outputSize, keypointScaleMode, FLAGS_num_gpu, FLAGS_num_gpu_start, - FLAGS_scale_number, (float)FLAGS_scale_gap, op::flagsToRenderMode(FLAGS_render_pose, multipleView), - poseModel, !FLAGS_disable_blending, (float)FLAGS_alpha_pose, (float)FLAGS_alpha_heatmap, - FLAGS_part_to_show, op::String(FLAGS_model_folder), heatMapTypes, heatMapScaleMode, FLAGS_part_candidates, - (float)FLAGS_render_threshold, FLAGS_number_people_max, FLAGS_maximize_positives, FLAGS_fps_max, - op::String(FLAGS_prototxt_path), op::String(FLAGS_caffemodel_path), - (float)FLAGS_upsampling_ratio, enableGoogleLogging}; + poseMode, netInputSize, FLAGS_net_resolution_dynamic, outputSize, keypointScaleMode, FLAGS_num_gpu, + FLAGS_num_gpu_start, FLAGS_scale_number, (float)FLAGS_scale_gap, + op::flagsToRenderMode(FLAGS_render_pose, multipleView), poseModel, !FLAGS_disable_blending, + (float)FLAGS_alpha_pose, (float)FLAGS_alpha_heatmap, FLAGS_part_to_show, op::String(FLAGS_model_folder), + heatMapTypes, heatMapScaleMode, FLAGS_part_candidates, (float)FLAGS_render_threshold, + FLAGS_number_people_max, FLAGS_maximize_positives, FLAGS_fps_max, op::String(FLAGS_prototxt_path), + op::String(FLAGS_caffemodel_path), (float)FLAGS_upsampling_ratio, enableGoogleLogging}; opWrapper.configure(wrapperStructPose); // Face configuration (use op::WrapperStructFace{} to disable it) const op::WrapperStructFace wrapperStructFace{ diff --git a/examples/tutorial_api_cpp/03_keypoints_from_image.cpp b/examples/tutorial_api_cpp/03_keypoints_from_image.cpp index 1dcacc34..466e22bb 100644 --- a/examples/tutorial_api_cpp/03_keypoints_from_image.cpp +++ b/examples/tutorial_api_cpp/03_keypoints_from_image.cpp @@ -116,13 +116,13 @@ void configureWrapper(op::Wrapper& opWrapper) // Pose configuration (use WrapperStructPose{} for default and recommended configuration) const op::WrapperStructPose wrapperStructPose{ - poseMode, netInputSize, outputSize, keypointScaleMode, FLAGS_num_gpu, FLAGS_num_gpu_start, - FLAGS_scale_number, (float)FLAGS_scale_gap, op::flagsToRenderMode(FLAGS_render_pose, multipleView), - poseModel, !FLAGS_disable_blending, (float)FLAGS_alpha_pose, (float)FLAGS_alpha_heatmap, - FLAGS_part_to_show, op::String(FLAGS_model_folder), heatMapTypes, heatMapScaleMode, FLAGS_part_candidates, - (float)FLAGS_render_threshold, FLAGS_number_people_max, FLAGS_maximize_positives, FLAGS_fps_max, - op::String(FLAGS_prototxt_path), op::String(FLAGS_caffemodel_path), - (float)FLAGS_upsampling_ratio, enableGoogleLogging}; + poseMode, netInputSize, FLAGS_net_resolution_dynamic, outputSize, keypointScaleMode, FLAGS_num_gpu, + FLAGS_num_gpu_start, FLAGS_scale_number, (float)FLAGS_scale_gap, + op::flagsToRenderMode(FLAGS_render_pose, multipleView), poseModel, !FLAGS_disable_blending, + (float)FLAGS_alpha_pose, (float)FLAGS_alpha_heatmap, FLAGS_part_to_show, op::String(FLAGS_model_folder), + heatMapTypes, heatMapScaleMode, FLAGS_part_candidates, (float)FLAGS_render_threshold, + FLAGS_number_people_max, FLAGS_maximize_positives, FLAGS_fps_max, op::String(FLAGS_prototxt_path), + op::String(FLAGS_caffemodel_path), (float)FLAGS_upsampling_ratio, enableGoogleLogging}; opWrapper.configure(wrapperStructPose); // Face configuration (use op::WrapperStructFace{} to disable it) const op::WrapperStructFace wrapperStructFace{ diff --git a/examples/tutorial_api_cpp/04_keypoints_from_images.cpp b/examples/tutorial_api_cpp/04_keypoints_from_images.cpp index 67ea5d6a..051598e1 100644 --- a/examples/tutorial_api_cpp/04_keypoints_from_images.cpp +++ b/examples/tutorial_api_cpp/04_keypoints_from_images.cpp @@ -116,13 +116,13 @@ void configureWrapper(op::Wrapper& opWrapper) // Pose configuration (use WrapperStructPose{} for default and recommended configuration) const op::WrapperStructPose wrapperStructPose{ - poseMode, netInputSize, outputSize, keypointScaleMode, FLAGS_num_gpu, FLAGS_num_gpu_start, - FLAGS_scale_number, (float)FLAGS_scale_gap, op::flagsToRenderMode(FLAGS_render_pose, multipleView), - poseModel, !FLAGS_disable_blending, (float)FLAGS_alpha_pose, (float)FLAGS_alpha_heatmap, - FLAGS_part_to_show, op::String(FLAGS_model_folder), heatMapTypes, heatMapScaleMode, FLAGS_part_candidates, - (float)FLAGS_render_threshold, FLAGS_number_people_max, FLAGS_maximize_positives, FLAGS_fps_max, - op::String(FLAGS_prototxt_path), op::String(FLAGS_caffemodel_path), - (float)FLAGS_upsampling_ratio, enableGoogleLogging}; + poseMode, netInputSize, FLAGS_net_resolution_dynamic, outputSize, keypointScaleMode, FLAGS_num_gpu, + FLAGS_num_gpu_start, FLAGS_scale_number, (float)FLAGS_scale_gap, + op::flagsToRenderMode(FLAGS_render_pose, multipleView), poseModel, !FLAGS_disable_blending, + (float)FLAGS_alpha_pose, (float)FLAGS_alpha_heatmap, FLAGS_part_to_show, op::String(FLAGS_model_folder), + heatMapTypes, heatMapScaleMode, FLAGS_part_candidates, (float)FLAGS_render_threshold, + FLAGS_number_people_max, FLAGS_maximize_positives, FLAGS_fps_max, op::String(FLAGS_prototxt_path), + op::String(FLAGS_caffemodel_path), (float)FLAGS_upsampling_ratio, enableGoogleLogging}; opWrapper.configure(wrapperStructPose); // Face configuration (use op::WrapperStructFace{} to disable it) const op::WrapperStructFace wrapperStructFace{ diff --git a/examples/tutorial_api_cpp/05_keypoints_from_images_multi_gpu.cpp b/examples/tutorial_api_cpp/05_keypoints_from_images_multi_gpu.cpp index aa7537ac..bbb4a463 100644 --- a/examples/tutorial_api_cpp/05_keypoints_from_images_multi_gpu.cpp +++ b/examples/tutorial_api_cpp/05_keypoints_from_images_multi_gpu.cpp @@ -122,13 +122,13 @@ void configureWrapper(op::Wrapper& opWrapper) // Pose configuration (use WrapperStructPose{} for default and recommended configuration) const op::WrapperStructPose wrapperStructPose{ - poseMode, netInputSize, outputSize, keypointScaleMode, FLAGS_num_gpu, FLAGS_num_gpu_start, - FLAGS_scale_number, (float)FLAGS_scale_gap, op::flagsToRenderMode(FLAGS_render_pose, multipleView), - poseModel, !FLAGS_disable_blending, (float)FLAGS_alpha_pose, (float)FLAGS_alpha_heatmap, - FLAGS_part_to_show, op::String(FLAGS_model_folder), heatMapTypes, heatMapScaleMode, FLAGS_part_candidates, - (float)FLAGS_render_threshold, FLAGS_number_people_max, FLAGS_maximize_positives, FLAGS_fps_max, - op::String(FLAGS_prototxt_path), op::String(FLAGS_caffemodel_path), - (float)FLAGS_upsampling_ratio, enableGoogleLogging}; + poseMode, netInputSize, FLAGS_net_resolution_dynamic, outputSize, keypointScaleMode, FLAGS_num_gpu, + FLAGS_num_gpu_start, FLAGS_scale_number, (float)FLAGS_scale_gap, + op::flagsToRenderMode(FLAGS_render_pose, multipleView), poseModel, !FLAGS_disable_blending, + (float)FLAGS_alpha_pose, (float)FLAGS_alpha_heatmap, FLAGS_part_to_show, op::String(FLAGS_model_folder), + heatMapTypes, heatMapScaleMode, FLAGS_part_candidates, (float)FLAGS_render_threshold, + FLAGS_number_people_max, FLAGS_maximize_positives, FLAGS_fps_max, op::String(FLAGS_prototxt_path), + op::String(FLAGS_caffemodel_path), (float)FLAGS_upsampling_ratio, enableGoogleLogging}; opWrapper.configure(wrapperStructPose); // Face configuration (use op::WrapperStructFace{} to disable it) const op::WrapperStructFace wrapperStructFace{ diff --git a/examples/tutorial_api_cpp/06_face_from_image.cpp b/examples/tutorial_api_cpp/06_face_from_image.cpp index c0940216..c121060d 100644 --- a/examples/tutorial_api_cpp/06_face_from_image.cpp +++ b/examples/tutorial_api_cpp/06_face_from_image.cpp @@ -119,13 +119,13 @@ void configureWrapper(op::Wrapper& opWrapper) // Pose configuration (use WrapperStructPose{} for default and recommended configuration) const op::WrapperStructPose wrapperStructPose{ - poseMode, netInputSize, outputSize, keypointScaleMode, FLAGS_num_gpu, FLAGS_num_gpu_start, - FLAGS_scale_number, (float)FLAGS_scale_gap, op::flagsToRenderMode(FLAGS_render_pose, multipleView), - poseModel, !FLAGS_disable_blending, (float)FLAGS_alpha_pose, (float)FLAGS_alpha_heatmap, - FLAGS_part_to_show, op::String(FLAGS_model_folder), heatMapTypes, heatMapScaleMode, FLAGS_part_candidates, - (float)FLAGS_render_threshold, FLAGS_number_people_max, FLAGS_maximize_positives, FLAGS_fps_max, - op::String(FLAGS_prototxt_path), op::String(FLAGS_caffemodel_path), - (float)FLAGS_upsampling_ratio, enableGoogleLogging}; + poseMode, netInputSize, FLAGS_net_resolution_dynamic, outputSize, keypointScaleMode, FLAGS_num_gpu, + FLAGS_num_gpu_start, FLAGS_scale_number, (float)FLAGS_scale_gap, + op::flagsToRenderMode(FLAGS_render_pose, multipleView), poseModel, !FLAGS_disable_blending, + (float)FLAGS_alpha_pose, (float)FLAGS_alpha_heatmap, FLAGS_part_to_show, op::String(FLAGS_model_folder), + heatMapTypes, heatMapScaleMode, FLAGS_part_candidates, (float)FLAGS_render_threshold, + FLAGS_number_people_max, FLAGS_maximize_positives, FLAGS_fps_max, op::String(FLAGS_prototxt_path), + op::String(FLAGS_caffemodel_path), (float)FLAGS_upsampling_ratio, enableGoogleLogging}; opWrapper.configure(wrapperStructPose); // Face configuration (use op::WrapperStructFace{} to disable it) const op::WrapperStructFace wrapperStructFace{ diff --git a/examples/tutorial_api_cpp/07_hand_from_image.cpp b/examples/tutorial_api_cpp/07_hand_from_image.cpp index d114e6ce..96187f96 100644 --- a/examples/tutorial_api_cpp/07_hand_from_image.cpp +++ b/examples/tutorial_api_cpp/07_hand_from_image.cpp @@ -119,13 +119,13 @@ void configureWrapper(op::Wrapper& opWrapper) // Pose configuration (use WrapperStructPose{} for default and recommended configuration) const op::WrapperStructPose wrapperStructPose{ - poseMode, netInputSize, outputSize, keypointScaleMode, FLAGS_num_gpu, FLAGS_num_gpu_start, - FLAGS_scale_number, (float)FLAGS_scale_gap, op::flagsToRenderMode(FLAGS_render_pose, multipleView), - poseModel, !FLAGS_disable_blending, (float)FLAGS_alpha_pose, (float)FLAGS_alpha_heatmap, - FLAGS_part_to_show, op::String(FLAGS_model_folder), heatMapTypes, heatMapScaleMode, FLAGS_part_candidates, - (float)FLAGS_render_threshold, FLAGS_number_people_max, FLAGS_maximize_positives, FLAGS_fps_max, - op::String(FLAGS_prototxt_path), op::String(FLAGS_caffemodel_path), - (float)FLAGS_upsampling_ratio, enableGoogleLogging}; + poseMode, netInputSize, FLAGS_net_resolution_dynamic, outputSize, keypointScaleMode, FLAGS_num_gpu, + FLAGS_num_gpu_start, FLAGS_scale_number, (float)FLAGS_scale_gap, + op::flagsToRenderMode(FLAGS_render_pose, multipleView), poseModel, !FLAGS_disable_blending, + (float)FLAGS_alpha_pose, (float)FLAGS_alpha_heatmap, FLAGS_part_to_show, op::String(FLAGS_model_folder), + heatMapTypes, heatMapScaleMode, FLAGS_part_candidates, (float)FLAGS_render_threshold, + FLAGS_number_people_max, FLAGS_maximize_positives, FLAGS_fps_max, op::String(FLAGS_prototxt_path), + op::String(FLAGS_caffemodel_path), (float)FLAGS_upsampling_ratio, enableGoogleLogging}; opWrapper.configure(wrapperStructPose); // Face configuration (use op::WrapperStructFace{} to disable it) const op::WrapperStructFace wrapperStructFace{ diff --git a/examples/tutorial_api_cpp/08_heatmaps_from_image.cpp b/examples/tutorial_api_cpp/08_heatmaps_from_image.cpp index b5dc52ee..1d13e9a7 100644 --- a/examples/tutorial_api_cpp/08_heatmaps_from_image.cpp +++ b/examples/tutorial_api_cpp/08_heatmaps_from_image.cpp @@ -145,13 +145,13 @@ void configureWrapper(op::Wrapper& opWrapper) // Pose configuration (use WrapperStructPose{} for default and recommended configuration) const op::WrapperStructPose wrapperStructPose{ - poseMode, netInputSize, outputSize, keypointScaleMode, FLAGS_num_gpu, FLAGS_num_gpu_start, - FLAGS_scale_number, (float)FLAGS_scale_gap, op::flagsToRenderMode(FLAGS_render_pose, multipleView), - poseModel, !FLAGS_disable_blending, (float)FLAGS_alpha_pose, (float)FLAGS_alpha_heatmap, - FLAGS_part_to_show, op::String(FLAGS_model_folder), heatMapTypes, heatMapScaleMode, FLAGS_part_candidates, - (float)FLAGS_render_threshold, FLAGS_number_people_max, FLAGS_maximize_positives, FLAGS_fps_max, - op::String(FLAGS_prototxt_path), op::String(FLAGS_caffemodel_path), - (float)FLAGS_upsampling_ratio, enableGoogleLogging}; + poseMode, netInputSize, FLAGS_net_resolution_dynamic, outputSize, keypointScaleMode, FLAGS_num_gpu, + FLAGS_num_gpu_start, FLAGS_scale_number, (float)FLAGS_scale_gap, + op::flagsToRenderMode(FLAGS_render_pose, multipleView), poseModel, !FLAGS_disable_blending, + (float)FLAGS_alpha_pose, (float)FLAGS_alpha_heatmap, FLAGS_part_to_show, op::String(FLAGS_model_folder), + heatMapTypes, heatMapScaleMode, FLAGS_part_candidates, (float)FLAGS_render_threshold, + FLAGS_number_people_max, FLAGS_maximize_positives, FLAGS_fps_max, op::String(FLAGS_prototxt_path), + op::String(FLAGS_caffemodel_path), (float)FLAGS_upsampling_ratio, enableGoogleLogging}; opWrapper.configure(wrapperStructPose); // Face configuration (use op::WrapperStructFace{} to disable it) const op::WrapperStructFace wrapperStructFace{ diff --git a/examples/tutorial_api_cpp/09_keypoints_from_heatmaps.cpp b/examples/tutorial_api_cpp/09_keypoints_from_heatmaps.cpp index 11e63f69..411fa519 100644 --- a/examples/tutorial_api_cpp/09_keypoints_from_heatmaps.cpp +++ b/examples/tutorial_api_cpp/09_keypoints_from_heatmaps.cpp @@ -119,13 +119,13 @@ void configureWrapper(op::Wrapper& opWrapper) // Pose configuration (use WrapperStructPose{} for default and recommended configuration) const op::WrapperStructPose wrapperStructPose{ - poseMode, netInputSize, outputSize, keypointScaleMode, FLAGS_num_gpu, FLAGS_num_gpu_start, - FLAGS_scale_number, (float)FLAGS_scale_gap, op::flagsToRenderMode(FLAGS_render_pose, multipleView), - poseModel, !FLAGS_disable_blending, (float)FLAGS_alpha_pose, (float)FLAGS_alpha_heatmap, - FLAGS_part_to_show, op::String(FLAGS_model_folder), heatMapTypes, heatMapScaleMode, FLAGS_part_candidates, - (float)FLAGS_render_threshold, FLAGS_number_people_max, FLAGS_maximize_positives, FLAGS_fps_max, - op::String(FLAGS_prototxt_path), op::String(FLAGS_caffemodel_path), - (float)FLAGS_upsampling_ratio, enableGoogleLogging}; + poseMode, netInputSize, FLAGS_net_resolution_dynamic, outputSize, keypointScaleMode, FLAGS_num_gpu, + FLAGS_num_gpu_start, FLAGS_scale_number, (float)FLAGS_scale_gap, + op::flagsToRenderMode(FLAGS_render_pose, multipleView), poseModel, !FLAGS_disable_blending, + (float)FLAGS_alpha_pose, (float)FLAGS_alpha_heatmap, FLAGS_part_to_show, op::String(FLAGS_model_folder), + heatMapTypes, heatMapScaleMode, FLAGS_part_candidates, (float)FLAGS_render_threshold, + FLAGS_number_people_max, FLAGS_maximize_positives, FLAGS_fps_max, op::String(FLAGS_prototxt_path), + op::String(FLAGS_caffemodel_path), (float)FLAGS_upsampling_ratio, enableGoogleLogging}; opWrapper.configure(wrapperStructPose); // Face configuration (use op::WrapperStructFace{} to disable it) const op::WrapperStructFace wrapperStructFace{ diff --git a/examples/tutorial_api_cpp/10_asynchronous_custom_input.cpp b/examples/tutorial_api_cpp/10_asynchronous_custom_input.cpp index 87a206b5..64cd91df 100644 --- a/examples/tutorial_api_cpp/10_asynchronous_custom_input.cpp +++ b/examples/tutorial_api_cpp/10_asynchronous_custom_input.cpp @@ -125,13 +125,13 @@ void configureWrapper(op::Wrapper& opWrapper) // Pose configuration (use WrapperStructPose{} for default and recommended configuration) const op::WrapperStructPose wrapperStructPose{ - poseMode, netInputSize, outputSize, keypointScaleMode, FLAGS_num_gpu, FLAGS_num_gpu_start, - FLAGS_scale_number, (float)FLAGS_scale_gap, op::flagsToRenderMode(FLAGS_render_pose, multipleView), - poseModel, !FLAGS_disable_blending, (float)FLAGS_alpha_pose, (float)FLAGS_alpha_heatmap, - FLAGS_part_to_show, op::String(FLAGS_model_folder), heatMapTypes, heatMapScaleMode, FLAGS_part_candidates, - (float)FLAGS_render_threshold, FLAGS_number_people_max, FLAGS_maximize_positives, FLAGS_fps_max, - op::String(FLAGS_prototxt_path), op::String(FLAGS_caffemodel_path), - (float)FLAGS_upsampling_ratio, enableGoogleLogging}; + poseMode, netInputSize, FLAGS_net_resolution_dynamic, outputSize, keypointScaleMode, FLAGS_num_gpu, + FLAGS_num_gpu_start, FLAGS_scale_number, (float)FLAGS_scale_gap, + op::flagsToRenderMode(FLAGS_render_pose, multipleView), poseModel, !FLAGS_disable_blending, + (float)FLAGS_alpha_pose, (float)FLAGS_alpha_heatmap, FLAGS_part_to_show, op::String(FLAGS_model_folder), + heatMapTypes, heatMapScaleMode, FLAGS_part_candidates, (float)FLAGS_render_threshold, + FLAGS_number_people_max, FLAGS_maximize_positives, FLAGS_fps_max, op::String(FLAGS_prototxt_path), + op::String(FLAGS_caffemodel_path), (float)FLAGS_upsampling_ratio, enableGoogleLogging}; opWrapper.configure(wrapperStructPose); // Face configuration (use op::WrapperStructFace{} to disable it) const op::WrapperStructFace wrapperStructFace{ diff --git a/examples/tutorial_api_cpp/11_asynchronous_custom_input_multi_camera.cpp b/examples/tutorial_api_cpp/11_asynchronous_custom_input_multi_camera.cpp index a09e657f..10942b1e 100644 --- a/examples/tutorial_api_cpp/11_asynchronous_custom_input_multi_camera.cpp +++ b/examples/tutorial_api_cpp/11_asynchronous_custom_input_multi_camera.cpp @@ -124,13 +124,13 @@ void configureWrapper(op::Wrapper& opWrapper) // Pose configuration (use WrapperStructPose{} for default and recommended configuration) const op::WrapperStructPose wrapperStructPose{ - poseMode, netInputSize, outputSize, keypointScaleMode, FLAGS_num_gpu, FLAGS_num_gpu_start, - FLAGS_scale_number, (float)FLAGS_scale_gap, op::flagsToRenderMode(FLAGS_render_pose, multipleView), - poseModel, !FLAGS_disable_blending, (float)FLAGS_alpha_pose, (float)FLAGS_alpha_heatmap, - FLAGS_part_to_show, op::String(FLAGS_model_folder), heatMapTypes, heatMapScaleMode, FLAGS_part_candidates, - (float)FLAGS_render_threshold, FLAGS_number_people_max, FLAGS_maximize_positives, FLAGS_fps_max, - op::String(FLAGS_prototxt_path), op::String(FLAGS_caffemodel_path), - (float)FLAGS_upsampling_ratio, enableGoogleLogging}; + poseMode, netInputSize, FLAGS_net_resolution_dynamic, outputSize, keypointScaleMode, FLAGS_num_gpu, + FLAGS_num_gpu_start, FLAGS_scale_number, (float)FLAGS_scale_gap, + op::flagsToRenderMode(FLAGS_render_pose, multipleView), poseModel, !FLAGS_disable_blending, + (float)FLAGS_alpha_pose, (float)FLAGS_alpha_heatmap, FLAGS_part_to_show, op::String(FLAGS_model_folder), + heatMapTypes, heatMapScaleMode, FLAGS_part_candidates, (float)FLAGS_render_threshold, + FLAGS_number_people_max, FLAGS_maximize_positives, FLAGS_fps_max, op::String(FLAGS_prototxt_path), + op::String(FLAGS_caffemodel_path), (float)FLAGS_upsampling_ratio, enableGoogleLogging}; opWrapper.configure(wrapperStructPose); // Face configuration (use op::WrapperStructFace{} to disable it) const op::WrapperStructFace wrapperStructFace{ diff --git a/examples/tutorial_api_cpp/12_asynchronous_custom_output.cpp b/examples/tutorial_api_cpp/12_asynchronous_custom_output.cpp index 5aa7276e..8a7e7ba1 100644 --- a/examples/tutorial_api_cpp/12_asynchronous_custom_output.cpp +++ b/examples/tutorial_api_cpp/12_asynchronous_custom_output.cpp @@ -148,13 +148,13 @@ void configureWrapper(op::Wrapper& opWrapper) // Pose configuration (use WrapperStructPose{} for default and recommended configuration) const op::WrapperStructPose wrapperStructPose{ - poseMode, netInputSize, outputSize, keypointScaleMode, FLAGS_num_gpu, FLAGS_num_gpu_start, - FLAGS_scale_number, (float)FLAGS_scale_gap, op::flagsToRenderMode(FLAGS_render_pose, multipleView), - poseModel, !FLAGS_disable_blending, (float)FLAGS_alpha_pose, (float)FLAGS_alpha_heatmap, - FLAGS_part_to_show, op::String(FLAGS_model_folder), heatMapTypes, heatMapScaleMode, FLAGS_part_candidates, - (float)FLAGS_render_threshold, FLAGS_number_people_max, FLAGS_maximize_positives, FLAGS_fps_max, - op::String(FLAGS_prototxt_path), op::String(FLAGS_caffemodel_path), - (float)FLAGS_upsampling_ratio, enableGoogleLogging}; + poseMode, netInputSize, FLAGS_net_resolution_dynamic, outputSize, keypointScaleMode, FLAGS_num_gpu, + FLAGS_num_gpu_start, FLAGS_scale_number, (float)FLAGS_scale_gap, + op::flagsToRenderMode(FLAGS_render_pose, multipleView), poseModel, !FLAGS_disable_blending, + (float)FLAGS_alpha_pose, (float)FLAGS_alpha_heatmap, FLAGS_part_to_show, op::String(FLAGS_model_folder), + heatMapTypes, heatMapScaleMode, FLAGS_part_candidates, (float)FLAGS_render_threshold, + FLAGS_number_people_max, FLAGS_maximize_positives, FLAGS_fps_max, op::String(FLAGS_prototxt_path), + op::String(FLAGS_caffemodel_path), (float)FLAGS_upsampling_ratio, enableGoogleLogging}; opWrapper.configure(wrapperStructPose); // Face configuration (use op::WrapperStructFace{} to disable it) const op::WrapperStructFace wrapperStructFace{ diff --git a/examples/tutorial_api_cpp/13_asynchronous_custom_input_output_and_datum.cpp b/examples/tutorial_api_cpp/13_asynchronous_custom_input_output_and_datum.cpp index 4e086794..17894a0e 100644 --- a/examples/tutorial_api_cpp/13_asynchronous_custom_input_output_and_datum.cpp +++ b/examples/tutorial_api_cpp/13_asynchronous_custom_input_output_and_datum.cpp @@ -226,13 +226,13 @@ void configureWrapper(op::WrapperT& opWrapperT) // Pose configuration (use WrapperStructPose{} for default and recommended configuration) const op::WrapperStructPose wrapperStructPose{ - poseMode, netInputSize, outputSize, keypointScaleMode, FLAGS_num_gpu, FLAGS_num_gpu_start, - FLAGS_scale_number, (float)FLAGS_scale_gap, op::flagsToRenderMode(FLAGS_render_pose, multipleView), - poseModel, !FLAGS_disable_blending, (float)FLAGS_alpha_pose, (float)FLAGS_alpha_heatmap, - FLAGS_part_to_show, op::String(FLAGS_model_folder), heatMapTypes, heatMapScaleMode, FLAGS_part_candidates, - (float)FLAGS_render_threshold, FLAGS_number_people_max, FLAGS_maximize_positives, FLAGS_fps_max, - op::String(FLAGS_prototxt_path), op::String(FLAGS_caffemodel_path), - (float)FLAGS_upsampling_ratio, enableGoogleLogging}; + poseMode, netInputSize, FLAGS_net_resolution_dynamic, outputSize, keypointScaleMode, FLAGS_num_gpu, + FLAGS_num_gpu_start, FLAGS_scale_number, (float)FLAGS_scale_gap, + op::flagsToRenderMode(FLAGS_render_pose, multipleView), poseModel, !FLAGS_disable_blending, + (float)FLAGS_alpha_pose, (float)FLAGS_alpha_heatmap, FLAGS_part_to_show, op::String(FLAGS_model_folder), + heatMapTypes, heatMapScaleMode, FLAGS_part_candidates, (float)FLAGS_render_threshold, + FLAGS_number_people_max, FLAGS_maximize_positives, FLAGS_fps_max, op::String(FLAGS_prototxt_path), + op::String(FLAGS_caffemodel_path), (float)FLAGS_upsampling_ratio, enableGoogleLogging}; opWrapperT.configure(wrapperStructPose); // Face configuration (use op::WrapperStructFace{} to disable it) const op::WrapperStructFace wrapperStructFace{ diff --git a/examples/tutorial_api_cpp/14_synchronous_custom_input.cpp b/examples/tutorial_api_cpp/14_synchronous_custom_input.cpp index a0c105b4..087c1700 100644 --- a/examples/tutorial_api_cpp/14_synchronous_custom_input.cpp +++ b/examples/tutorial_api_cpp/14_synchronous_custom_input.cpp @@ -138,13 +138,13 @@ void configureWrapper(op::Wrapper& opWrapper) // Pose configuration (use WrapperStructPose{} for default and recommended configuration) const op::WrapperStructPose wrapperStructPose{ - poseMode, netInputSize, outputSize, keypointScaleMode, FLAGS_num_gpu, FLAGS_num_gpu_start, - FLAGS_scale_number, (float)FLAGS_scale_gap, op::flagsToRenderMode(FLAGS_render_pose, multipleView), - poseModel, !FLAGS_disable_blending, (float)FLAGS_alpha_pose, (float)FLAGS_alpha_heatmap, - FLAGS_part_to_show, op::String(FLAGS_model_folder), heatMapTypes, heatMapScaleMode, FLAGS_part_candidates, - (float)FLAGS_render_threshold, FLAGS_number_people_max, FLAGS_maximize_positives, FLAGS_fps_max, - op::String(FLAGS_prototxt_path), op::String(FLAGS_caffemodel_path), - (float)FLAGS_upsampling_ratio, enableGoogleLogging}; + poseMode, netInputSize, FLAGS_net_resolution_dynamic, outputSize, keypointScaleMode, FLAGS_num_gpu, + FLAGS_num_gpu_start, FLAGS_scale_number, (float)FLAGS_scale_gap, + op::flagsToRenderMode(FLAGS_render_pose, multipleView), poseModel, !FLAGS_disable_blending, + (float)FLAGS_alpha_pose, (float)FLAGS_alpha_heatmap, FLAGS_part_to_show, op::String(FLAGS_model_folder), + heatMapTypes, heatMapScaleMode, FLAGS_part_candidates, (float)FLAGS_render_threshold, + FLAGS_number_people_max, FLAGS_maximize_positives, FLAGS_fps_max, op::String(FLAGS_prototxt_path), + op::String(FLAGS_caffemodel_path), (float)FLAGS_upsampling_ratio, enableGoogleLogging}; opWrapper.configure(wrapperStructPose); // Face configuration (use op::WrapperStructFace{} to disable it) const op::WrapperStructFace wrapperStructFace{ diff --git a/examples/tutorial_api_cpp/15_synchronous_custom_preprocessing.cpp b/examples/tutorial_api_cpp/15_synchronous_custom_preprocessing.cpp index a9656c47..3cadbe6a 100644 --- a/examples/tutorial_api_cpp/15_synchronous_custom_preprocessing.cpp +++ b/examples/tutorial_api_cpp/15_synchronous_custom_preprocessing.cpp @@ -107,13 +107,13 @@ void configureWrapper(op::Wrapper& opWrapper) // Pose configuration (use WrapperStructPose{} for default and recommended configuration) const op::WrapperStructPose wrapperStructPose{ - poseMode, netInputSize, outputSize, keypointScaleMode, FLAGS_num_gpu, FLAGS_num_gpu_start, - FLAGS_scale_number, (float)FLAGS_scale_gap, op::flagsToRenderMode(FLAGS_render_pose, multipleView), - poseModel, !FLAGS_disable_blending, (float)FLAGS_alpha_pose, (float)FLAGS_alpha_heatmap, - FLAGS_part_to_show, op::String(FLAGS_model_folder), heatMapTypes, heatMapScaleMode, FLAGS_part_candidates, - (float)FLAGS_render_threshold, FLAGS_number_people_max, FLAGS_maximize_positives, FLAGS_fps_max, - op::String(FLAGS_prototxt_path), op::String(FLAGS_caffemodel_path), - (float)FLAGS_upsampling_ratio, enableGoogleLogging}; + poseMode, netInputSize, FLAGS_net_resolution_dynamic, outputSize, keypointScaleMode, FLAGS_num_gpu, + FLAGS_num_gpu_start, FLAGS_scale_number, (float)FLAGS_scale_gap, + op::flagsToRenderMode(FLAGS_render_pose, multipleView), poseModel, !FLAGS_disable_blending, + (float)FLAGS_alpha_pose, (float)FLAGS_alpha_heatmap, FLAGS_part_to_show, op::String(FLAGS_model_folder), + heatMapTypes, heatMapScaleMode, FLAGS_part_candidates, (float)FLAGS_render_threshold, + FLAGS_number_people_max, FLAGS_maximize_positives, FLAGS_fps_max, op::String(FLAGS_prototxt_path), + op::String(FLAGS_caffemodel_path), (float)FLAGS_upsampling_ratio, enableGoogleLogging}; opWrapper.configure(wrapperStructPose); // Face configuration (use op::WrapperStructFace{} to disable it) const op::WrapperStructFace wrapperStructFace{ diff --git a/examples/tutorial_api_cpp/16_synchronous_custom_postprocessing.cpp b/examples/tutorial_api_cpp/16_synchronous_custom_postprocessing.cpp index eeaed2ef..b760a341 100644 --- a/examples/tutorial_api_cpp/16_synchronous_custom_postprocessing.cpp +++ b/examples/tutorial_api_cpp/16_synchronous_custom_postprocessing.cpp @@ -108,13 +108,13 @@ void configureWrapper(op::Wrapper& opWrapper) // Pose configuration (use WrapperStructPose{} for default and recommended configuration) const op::WrapperStructPose wrapperStructPose{ - poseMode, netInputSize, outputSize, keypointScaleMode, FLAGS_num_gpu, FLAGS_num_gpu_start, - FLAGS_scale_number, (float)FLAGS_scale_gap, op::flagsToRenderMode(FLAGS_render_pose, multipleView), - poseModel, !FLAGS_disable_blending, (float)FLAGS_alpha_pose, (float)FLAGS_alpha_heatmap, - FLAGS_part_to_show, op::String(FLAGS_model_folder), heatMapTypes, heatMapScaleMode, FLAGS_part_candidates, - (float)FLAGS_render_threshold, FLAGS_number_people_max, FLAGS_maximize_positives, FLAGS_fps_max, - op::String(FLAGS_prototxt_path), op::String(FLAGS_caffemodel_path), - (float)FLAGS_upsampling_ratio, enableGoogleLogging}; + poseMode, netInputSize, FLAGS_net_resolution_dynamic, outputSize, keypointScaleMode, FLAGS_num_gpu, + FLAGS_num_gpu_start, FLAGS_scale_number, (float)FLAGS_scale_gap, + op::flagsToRenderMode(FLAGS_render_pose, multipleView), poseModel, !FLAGS_disable_blending, + (float)FLAGS_alpha_pose, (float)FLAGS_alpha_heatmap, FLAGS_part_to_show, op::String(FLAGS_model_folder), + heatMapTypes, heatMapScaleMode, FLAGS_part_candidates, (float)FLAGS_render_threshold, + FLAGS_number_people_max, FLAGS_maximize_positives, FLAGS_fps_max, op::String(FLAGS_prototxt_path), + op::String(FLAGS_caffemodel_path), (float)FLAGS_upsampling_ratio, enableGoogleLogging}; opWrapper.configure(wrapperStructPose); // Face configuration (use op::WrapperStructFace{} to disable it) const op::WrapperStructFace wrapperStructFace{ diff --git a/examples/tutorial_api_cpp/17_synchronous_custom_output.cpp b/examples/tutorial_api_cpp/17_synchronous_custom_output.cpp index 68e3c42a..c5406bed 100644 --- a/examples/tutorial_api_cpp/17_synchronous_custom_output.cpp +++ b/examples/tutorial_api_cpp/17_synchronous_custom_output.cpp @@ -165,13 +165,13 @@ void configureWrapper(op::Wrapper& opWrapper) // Pose configuration (use WrapperStructPose{} for default and recommended configuration) const op::WrapperStructPose wrapperStructPose{ - poseMode, netInputSize, outputSize, keypointScaleMode, FLAGS_num_gpu, FLAGS_num_gpu_start, - FLAGS_scale_number, (float)FLAGS_scale_gap, op::flagsToRenderMode(FLAGS_render_pose, multipleView), - poseModel, !FLAGS_disable_blending, (float)FLAGS_alpha_pose, (float)FLAGS_alpha_heatmap, - FLAGS_part_to_show, op::String(FLAGS_model_folder), heatMapTypes, heatMapScaleMode, FLAGS_part_candidates, - (float)FLAGS_render_threshold, FLAGS_number_people_max, FLAGS_maximize_positives, FLAGS_fps_max, - op::String(FLAGS_prototxt_path), op::String(FLAGS_caffemodel_path), - (float)FLAGS_upsampling_ratio, enableGoogleLogging}; + poseMode, netInputSize, FLAGS_net_resolution_dynamic, outputSize, keypointScaleMode, FLAGS_num_gpu, + FLAGS_num_gpu_start, FLAGS_scale_number, (float)FLAGS_scale_gap, + op::flagsToRenderMode(FLAGS_render_pose, multipleView), poseModel, !FLAGS_disable_blending, + (float)FLAGS_alpha_pose, (float)FLAGS_alpha_heatmap, FLAGS_part_to_show, op::String(FLAGS_model_folder), + heatMapTypes, heatMapScaleMode, FLAGS_part_candidates, (float)FLAGS_render_threshold, + FLAGS_number_people_max, FLAGS_maximize_positives, FLAGS_fps_max, op::String(FLAGS_prototxt_path), + op::String(FLAGS_caffemodel_path), (float)FLAGS_upsampling_ratio, enableGoogleLogging}; opWrapper.configure(wrapperStructPose); // Face configuration (use op::WrapperStructFace{} to disable it) const op::WrapperStructFace wrapperStructFace{ diff --git a/examples/tutorial_api_cpp/18_synchronous_custom_all_and_datum.cpp b/examples/tutorial_api_cpp/18_synchronous_custom_all_and_datum.cpp index 76d4efea..6956f63a 100644 --- a/examples/tutorial_api_cpp/18_synchronous_custom_all_and_datum.cpp +++ b/examples/tutorial_api_cpp/18_synchronous_custom_all_and_datum.cpp @@ -290,13 +290,13 @@ void configureWrapper(op::WrapperT& opWrapperT) // Pose configuration (use WrapperStructPose{} for default and recommended configuration) const op::WrapperStructPose wrapperStructPose{ - poseMode, netInputSize, outputSize, keypointScaleMode, FLAGS_num_gpu, FLAGS_num_gpu_start, - FLAGS_scale_number, (float)FLAGS_scale_gap, op::flagsToRenderMode(FLAGS_render_pose, multipleView), - poseModel, !FLAGS_disable_blending, (float)FLAGS_alpha_pose, (float)FLAGS_alpha_heatmap, - FLAGS_part_to_show, op::String(FLAGS_model_folder), heatMapTypes, heatMapScaleMode, FLAGS_part_candidates, - (float)FLAGS_render_threshold, FLAGS_number_people_max, FLAGS_maximize_positives, FLAGS_fps_max, - op::String(FLAGS_prototxt_path), op::String(FLAGS_caffemodel_path), - (float)FLAGS_upsampling_ratio, enableGoogleLogging}; + poseMode, netInputSize, FLAGS_net_resolution_dynamic, outputSize, keypointScaleMode, FLAGS_num_gpu, + FLAGS_num_gpu_start, FLAGS_scale_number, (float)FLAGS_scale_gap, + op::flagsToRenderMode(FLAGS_render_pose, multipleView), poseModel, !FLAGS_disable_blending, + (float)FLAGS_alpha_pose, (float)FLAGS_alpha_heatmap, FLAGS_part_to_show, op::String(FLAGS_model_folder), + heatMapTypes, heatMapScaleMode, FLAGS_part_candidates, (float)FLAGS_render_threshold, + FLAGS_number_people_max, FLAGS_maximize_positives, FLAGS_fps_max, op::String(FLAGS_prototxt_path), + op::String(FLAGS_caffemodel_path), (float)FLAGS_upsampling_ratio, enableGoogleLogging}; opWrapperT.configure(wrapperStructPose); // Face configuration (use op::WrapperStructFace{} to disable it) const op::WrapperStructFace wrapperStructFace{ diff --git a/include/openpose/core/scaleAndSizeExtractor.hpp b/include/openpose/core/scaleAndSizeExtractor.hpp index 1ef25659..cace5a29 100644 --- a/include/openpose/core/scaleAndSizeExtractor.hpp +++ b/include/openpose/core/scaleAndSizeExtractor.hpp @@ -9,8 +9,8 @@ namespace op class OP_API ScaleAndSizeExtractor { public: - ScaleAndSizeExtractor(const Point& netInputResolution, const Point& outputResolution, - const int scaleNumber = 1, const double scaleGap = 0.25); + ScaleAndSizeExtractor(const Point& netInputResolution, const float netInputResolutionDynamicBehavior, + const Point& outputResolution, const int scaleNumber = 1, const double scaleGap = 0.25); virtual ~ScaleAndSizeExtractor(); @@ -19,6 +19,7 @@ namespace op private: const Point mNetInputResolution; + const float mNetInputResolutionDynamicBehavior; const Point mOutputSize; const int mScaleNumber; const double mScaleGap; diff --git a/include/openpose/flags.hpp b/include/openpose/flags.hpp index fdc83378..04f045d5 100644 --- a/include/openpose/flags.hpp +++ b/include/openpose/flags.hpp @@ -102,6 +102,13 @@ DEFINE_string(net_resolution, "-1x368", "Multiples of 16. If it " any of the dimensions, OP will choose the optimal aspect ratio depending on the user's" " input value. E.g., the default `-1x368` is equivalent to `656x368` in 16:9 resolutions," " e.g., full HD (1980x1080) and HD (1280x720) resolutions."); +DEFINE_double(net_resolution_dynamic, 1., "This flag only applies to images or custom inputs (not to video or webcam). If it is zero" + " or a negative value, it means that using `-1` in `net_resolution` will behave as explained" + " in its description. Otherwise, and to avoid out of memory errors, the `-1` in" + " `net_resolution` will clip to this value times the default 16/9 aspect ratio value (which" + " is 656 width for a 368 height). E.g., `net_resolution_dynamic 10 net_resolution -1x368`" + " will clip to 6560x368 (10 x 656). Recommended 1 for small GPUs (to avoid out of memory" + " errors but maximize speed) and 0 for big GPUs (for maximum accuracy and speed)."); DEFINE_int32(scale_number, 1, "Number of scales to average."); DEFINE_double(scale_gap, 0.25, "Scale gap between scales. No effect unless scale_number > 1. Initial scale is always 1." " If you want to change the initial scale, you actually want to multiply the" diff --git a/include/openpose/utilities/flagsToOpenPose.hpp b/include/openpose/utilities/flagsToOpenPose.hpp index 079f6908..1b45d4b4 100644 --- a/include/openpose/utilities/flagsToOpenPose.hpp +++ b/include/openpose/utilities/flagsToOpenPose.hpp @@ -38,7 +38,11 @@ namespace op OP_API DisplayMode flagsToDisplayMode(const int display, const bool enabled3d); - OP_API Point flagsToPoint(const String& pointString, const String& pointExample = String("1280x720")); + /** + * E.g., const auto netInputSize = flagsToPoint(op::String(FLAGS_net_resolution), "-1x368"); + * E.g., const Point resolution = flagsToPoint(resolutionString, "-1280x720"); + */ + OP_API Point flagsToPoint(const String& pointString, const String& pointExample); } #endif // OPENPOSE_UTILITIES_FLAGS_TO_OPEN_POSE_HPP diff --git a/include/openpose/wrapper/wrapperAuxiliary.hpp b/include/openpose/wrapper/wrapperAuxiliary.hpp index 9119c9ea..6cd6f3a3 100644 --- a/include/openpose/wrapper/wrapperAuxiliary.hpp +++ b/include/openpose/wrapper/wrapperAuxiliary.hpp @@ -290,8 +290,8 @@ namespace op { // Get input scales and sizes const auto scaleAndSizeExtractor = std::make_shared( - wrapperStructPose.netInputSize, finalOutputSize, wrapperStructPose.scalesNumber, - wrapperStructPose.scaleGap + wrapperStructPose.netInputSize, (float)wrapperStructPose.netInputSizeDynamicBehavior, finalOutputSize, + wrapperStructPose.scalesNumber, wrapperStructPose.scaleGap ); scaleAndSizeExtractorW = std::make_shared>(scaleAndSizeExtractor); diff --git a/include/openpose/wrapper/wrapperStructPose.hpp b/include/openpose/wrapper/wrapperStructPose.hpp index b31d6802..d41c5267 100644 --- a/include/openpose/wrapper/wrapperStructPose.hpp +++ b/include/openpose/wrapper/wrapperStructPose.hpp @@ -31,6 +31,15 @@ namespace op */ Point netInputSize; + /** + * Zero or negative means that using `-1` in netInputSize will behave as explained in its flag description. + * Otherwise, and to avoid out of memory errors, the `-1` in netInputSize will clip to this value times the + * default 16/9 aspect ratio value (i.e., 656 width for a 368 height). E.g., netInputSizeDynamicBehavior = 10 + * and netInputSize = {-1x368} will clip to 6560x368 (10 x 656). Recommended 1 for small GPUs (to avoid out of + * memory errors but maximize speed) and 0 for big GPUs (for maximum accuracy and speed). + */ + double netInputSizeDynamicBehavior; + /** * Output size of the final rendered image. * It barely affects performance compared to netInputSize. @@ -211,6 +220,7 @@ namespace op */ WrapperStructPose( const PoseMode poseMode = PoseMode::Enabled, const Point& netInputSize = Point{-1, 368}, + const double netInputSizeDynamicBehavior = 1., const Point& outputSize = Point{-1, -1}, const ScaleMode keypointScaleMode = ScaleMode::InputResolution, const int gpuNumber = -1, const int gpuNumberStart = 0, const int scalesNumber = 1, const float scaleGap = 0.25f, diff --git a/scripts/tests/pose_accuracy_all_val.sh b/scripts/tests/pose_accuracy_all_val.sh index 6c7529b7..8c09a791 100644 --- a/scripts/tests/pose_accuracy_all_val.sh +++ b/scripts/tests/pose_accuracy_all_val.sh @@ -20,7 +20,7 @@ temporaryJsonFile1=~/Desktop/OpenPose_1.json temporaryJsonFile4=~/Desktop/OpenPose_4.json OP_COMAND="./build/examples/openpose/openpose.bin --face --hand --render_pose 0 --display 0 --cli_verbose 0.2" OP_COMAND_1SCALE="${OP_COMAND} --write_coco_json ${temporaryJsonFile1} --num_gpu_start 1" -OP_COMAND_4SCALES="${OP_COMAND} --maximize_positives --scale_number 4 --scale_gap 0.25 --write_coco_json ${temporaryJsonFile4} --num_gpu_start 1" +OP_COMAND_4SCALES="${OP_COMAND} --maximize_positives --net_resolution_dynamic -1 --scale_number 4 --scale_gap 0.25 --write_coco_json ${temporaryJsonFile4} --num_gpu_start 1" # NOTE: Uncomment those tests you are interested into. By default, all disabled. diff --git a/scripts/tests/pose_accuracy_coco_test_dev.sh b/scripts/tests/pose_accuracy_coco_test_dev.sh index 26150bda..3c3ab0dc 100755 --- a/scripts/tests/pose_accuracy_coco_test_dev.sh +++ b/scripts/tests/pose_accuracy_coco_test_dev.sh @@ -17,20 +17,20 @@ OP_BIN=./build/examples/openpose/openpose.bin # # 1 scale # $OP_BIN --image_dir $IMAGE_FOLDER --display 0 --render_pose 0 --cli_verbose 0.2 --write_coco_json ${JSON_FOLDER}1_test_max.json \ -# --scale_number 1 --scale_gap 0.25 --maximize_positives --model_pose BODY_25B +# --scale_number 1 --scale_gap 0.25 --maximize_positives --net_resolution_dynamic -1 --model_pose BODY_25B # zip ${JSON_FOLDER}1_test_max.zip ${JSON_FOLDER}1_test_max.json # 4 scales # $OP_BIN --image_dir $IMAGE_FOLDER --display 0 --render_pose 0 --cli_verbose 0.2 --write_coco_json ${JSON_FOLDER}1_4_test.json \ # --scale_number 4 --scale_gap 0.25 --net_resolution "1312x736" $OP_BIN --image_dir $IMAGE_FOLDER --display 0 --render_pose 0 --cli_verbose 0.2 --write_coco_json ${JSON_FOLDER}1_4_test_max.json \ - --scale_number 4 --scale_gap 0.25 --net_resolution "1312x736" --maximize_positives + --scale_number 4 --scale_gap 0.25 --net_resolution "1312x736" --maximize_positives --net_resolution_dynamic -1 zip ${JSON_FOLDER}1_4_test_max.zip ${JSON_FOLDER}1_4_test_max.json # Additional settings: # 1. For maximum accuracy: -# --write_coco_json ${JSON_FOLDER}1_4_max.json --maximize_positives +# --write_coco_json ${JSON_FOLDER}1_4_max.json --maximize_positives --net_resolution_dynamic -1 # 2. For custom models: # --model_pose BODY_25B/BODY_23 --model_folder ${JSON_FOLDER} diff --git a/scripts/tests/pose_accuracy_coco_val.sh b/scripts/tests/pose_accuracy_coco_val.sh index d5a1ead4..0bc17c56 100755 --- a/scripts/tests/pose_accuracy_coco_val.sh +++ b/scripts/tests/pose_accuracy_coco_val.sh @@ -19,7 +19,7 @@ OP_BIN=./build/examples/openpose/openpose.bin # 1 scale (body) $OP_BIN --image_dir $IMAGE_FOLDER --display 0 --render_pose 0 --cli_verbose 0.2 --write_coco_json ${JSON_FOLDER}1.json --write_coco_json_variants 1 # $OP_BIN --image_dir $IMAGE_FOLDER --display 0 --render_pose 0 --cli_verbose 0.2 --write_coco_json ${JSON_FOLDER}1_max.json --write_coco_json_variants 3 \ -# --maximize_positives +# --maximize_positives --net_resolution_dynamic -1 # 1 scale (foot) $OP_BIN --image_dir $IMAGE_FOOT_FOLDER --display 0 --render_pose 0 --cli_verbose 0.2 --write_coco_json ${JSON_FOLDER}1.json --write_coco_json_variants 2 @@ -32,6 +32,6 @@ $OP_BIN --image_dir $IMAGE_FOOT_FOLDER --display 0 --render_pose 0 --cli_verbose # Additional settings: # 1. For maximum accuracy: -# --write_coco_json ${JSON_FOLDER}1_4_max.json --maximize_positives +# --write_coco_json ${JSON_FOLDER}1_4_max.json --maximize_positives --net_resolution_dynamic -1 # 2. For custom models: # --model_pose BODY_25B/BODY_23 --model_folder ${JSON_FOLDER} diff --git a/src/openpose/core/scaleAndSizeExtractor.cpp b/src/openpose/core/scaleAndSizeExtractor.cpp index 2be0a608..26ad9af4 100644 --- a/src/openpose/core/scaleAndSizeExtractor.cpp +++ b/src/openpose/core/scaleAndSizeExtractor.cpp @@ -5,9 +5,10 @@ namespace op { ScaleAndSizeExtractor::ScaleAndSizeExtractor(const Point& netInputResolution, - const Point& outputResolution, const int scaleNumber, - const double scaleGap) : + const float netInputResolutionDynamicBehavior, const Point& outputResolution, const int scaleNumber, + const double scaleGap) : mNetInputResolution{netInputResolution}, + mNetInputResolutionDynamicBehavior{netInputResolutionDynamicBehavior}, mOutputSize{outputResolution}, mScaleNumber{scaleNumber}, mScaleGap{scaleGap} @@ -49,14 +50,24 @@ namespace op if (poseNetInputSize.x <= 0 && poseNetInputSize.y <= 0) error("Only 1 of the dimensions of net input resolution can be <= 0.", __LINE__, __FUNCTION__, __FILE__); - if (poseNetInputSize.x <= 0) - poseNetInputSize.x = 16 * positiveIntRound( - poseNetInputSize.y * inputResolution.x / (float) inputResolution.y / 16.f - ); - else // if (poseNetInputSize.y <= 0) - poseNetInputSize.y = 16 * positiveIntRound( - poseNetInputSize.x * inputResolution.y / (float) inputResolution.x / 16.f - ); + // mNetInputResolutionDynamicBehavior limiting maximum + if (mNetInputResolutionDynamicBehavior > 0) + { + if (poseNetInputSize.x <= 0) + poseNetInputSize.x = 16 * positiveIntRound(1 / 16.f * + fastMin(poseNetInputSize.y * mNetInputResolutionDynamicBehavior * 16.f / 9.f, poseNetInputSize.y * inputResolution.x / (float)inputResolution.y)); + else // if (poseNetInputSize.y <= 0) + poseNetInputSize.y = 16 * positiveIntRound(1 / 16.f * + fastMin(poseNetInputSize.x * mNetInputResolutionDynamicBehavior * 9.f / 16.f, poseNetInputSize.x * inputResolution.y / (float)inputResolution.x)); + poseNetInputSize.y = 16 * positiveIntRound(1 / 16.f * poseNetInputSize.x * inputResolution.y / (float)inputResolution.x); + } + else // No mNetInputResolutionDynamicBehavior behavior + { + if (poseNetInputSize.x <= 0) + poseNetInputSize.x = 16 * positiveIntRound(1 / 16.f * poseNetInputSize.y * inputResolution.x / (float)inputResolution.y); + else // if (poseNetInputSize.y <= 0) + poseNetInputSize.y = 16 * positiveIntRound(1 / 16.f * poseNetInputSize.x * inputResolution.y / (float)inputResolution.x); + } } // scaleInputToNetInputs & netInputSizes - Reescale keeping aspect ratio std::vector scaleInputToNetInputs(mScaleNumber, 1.f); diff --git a/src/openpose/wrapper/wrapperAuxiliary.cpp b/src/openpose/wrapper/wrapperAuxiliary.cpp index ea7a900b..2290663e 100644 --- a/src/openpose/wrapper/wrapperAuxiliary.cpp +++ b/src/openpose/wrapper/wrapperAuxiliary.cpp @@ -16,6 +16,14 @@ namespace op { opLog("", Priority::Low, __LINE__, __FUNCTION__, __FILE__); + // Disable netInputSizeDynamicBehavior if not images and not custom input + // (i.e., fixed resolution stream like webcam or video) + if (wrapperStructInput.producerType != ProducerType::ImageDirectory + && wrapperStructInput.producerType != ProducerType::None) + { + wrapperStructPose.netInputSizeDynamicBehavior = -1.f; + } + // Check no wrong/contradictory flags enabled if (wrapperStructPose.alphaKeypoint < 0. || wrapperStructPose.alphaKeypoint > 1. || wrapperStructFace.alphaHeatMap < 0. || wrapperStructFace.alphaHeatMap > 1. diff --git a/src/openpose/wrapper/wrapperStructPose.cpp b/src/openpose/wrapper/wrapperStructPose.cpp index 65f829fc..9be0e654 100644 --- a/src/openpose/wrapper/wrapperStructPose.cpp +++ b/src/openpose/wrapper/wrapperStructPose.cpp @@ -3,17 +3,18 @@ namespace op { WrapperStructPose::WrapperStructPose( - const PoseMode poseMode_, const Point& netInputSize_, const Point& outputSize_, - const ScaleMode keypointScaleMode_, const int gpuNumber_, const int gpuNumberStart_, const int scalesNumber_, - const float scaleGap_, const RenderMode renderMode_, const PoseModel poseModel_, - const bool blendOriginalFrame_, const float alphaKeypoint_, const float alphaHeatMap_, - const int defaultPartToRender_, const String& modelFolder_, const std::vector& heatMapTypes_, - const ScaleMode heatMapScaleMode_, const bool addPartCandidates_, const float renderThreshold_, - const int numberPeopleMax_, const bool maximizePositives_, const double fpsMax_, - const String& protoTxtPath_, const String& caffeModelPath_, const float upsamplingRatio_, - const bool enableGoogleLogging_) : + const PoseMode poseMode_, const Point& netInputSize_, const double netInputSizeDynamicBehavior_, + const Point& outputSize_, const ScaleMode keypointScaleMode_, const int gpuNumber_, + const int gpuNumberStart_, const int scalesNumber_, const float scaleGap_, const RenderMode renderMode_, + const PoseModel poseModel_, const bool blendOriginalFrame_, const float alphaKeypoint_, + const float alphaHeatMap_, const int defaultPartToRender_, const String& modelFolder_, + const std::vector& heatMapTypes_, const ScaleMode heatMapScaleMode_, + const bool addPartCandidates_, const float renderThreshold_, const int numberPeopleMax_, + const bool maximizePositives_, const double fpsMax_, const String& protoTxtPath_, + const String& caffeModelPath_, const float upsamplingRatio_, const bool enableGoogleLogging_) : poseMode{poseMode_}, netInputSize{netInputSize_}, + netInputSizeDynamicBehavior{netInputSizeDynamicBehavior_}, outputSize{outputSize_}, keypointScaleMode{keypointScaleMode_}, gpuNumber{gpuNumber_}, -- GitLab