diff --git a/doc/demo_not_quick_start.md b/doc/demo_not_quick_start.md index bb9a6afccfaf869b200c739e592afd1167bda883..c03fa97bad613c84a62ebe5d3b6338fc65d11def 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 db77f9190b3e9a2bda7a08a76f8ef1a3aabb465f..ec9b4cd5825dd3838576ce5a10559be8ddb94b14 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 210e040e45c3ff0f3c5b29979b9f680bc6226f4a..12bfd618ddffc4220fa8d058dc9dcb0c372983b6 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 c6a2eaa31a1615679186d65bfd5beb71e326cbcd..be060ea0213dc21fa524b92d2795beb5d93e7d11 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 1dcacc349c1920afb635eb5316153c84139da19d..466e22bb7efc90c30cd92226aac734f6dc413253 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 67ea5d6a4c5cc16d42d5429325ce1d7f94c23929..051598e1d2042fa152d8029bb1684227fe62e181 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 aa7537ac71f54f3d0b5d0a6551c3d7cb39882a20..bbb4a463a96453a560cc37e2283ecaaaba950068 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 c094021622021babfc62d9db9a34058283d174cd..c121060d0c2487dd10bac8d9f8bed89e8d223a25 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 d114e6ce56724fa08d8328b0b67befe949178f79..96187f9611ea24dd05519769dbddea462f66f7ce 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 b5dc52eed661a534d0c8b49f24cec48a5e5a4a31..1d13e9a72a267c37cd5ab8b106c63c209bde48e5 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 11e63f69cfe7c211ac736fb2b6f501e04b9cc70a..411fa5199d16b6184ec0d094385ff9d320e96629 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 87a206b52d0f5883b612e243845043f9696f11b2..64cd91dfc3d60e1732e441324627107b1f1ee6e2 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 a09e657f83a0d8b4fdb9cc6db76190ed2952e128..10942b1e4576c65a717208fa501b77dd36c31992 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 5aa7276e97f3c4d76e8e35d941f8d3fad7266022..8a7e7ba1b84d595c43a290d4fd5a4f729e27aa12 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 4e086794b6ee0555233434aff7474fb8a6fb34a9..17894a0edd89c9753423428f32c03ef13e9024c2 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 a0c105b4726d8437d767da9824e745e6aa91b64f..087c170047747ec44fdc7785c381d530ab4aaba9 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 a9656c47b742dd2042633cdc68c5d1a837acb167..3cadbe6ab6146a55313675f2fea45cc80d69bfe2 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 eeaed2efc9502caf877b77f81110cc238c127be7..b760a3417aa2aec1d457d6854beca59ea83917b7 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 68e3c42a6b44357227a93ba916b5916094db4431..c5406bed5892a78a8e910237d0f44f8b11ad6644 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 76d4efea22c4582178d9d46b2184b2348e1d80e2..6956f63a4fd33faec2def41fcf514adeecd74170 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 1ef25659b05126acca96a482e92f49a319ca317c..cace5a29086a4c445f56cb7d8a6b8ffbc0d3156b 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 fdc8337825e814a92b4f38e294333781ac76c142..04f045d54bf47acf31c5eb2b99946620cf5c66a2 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 079f690892b3df0f722dfe917364518f25adf2ee..1b45d4b494bdbb31cb98209a58c6429c926a5157 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 9119c9eaf9525680122445e06fc4494d0fca0d59..6cd6f3a3d223997f7494d4c3856b6abed218e167 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 b31d6802c9243389d73a645d3d2f353be87e515b..d41c5267da10e635cd81ac90558d81391936c1d4 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 6c7529b729d11872080d206e9af46e8115a05b9f..8c09a79186704c828b29a23ca48ae89be5ad3437 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 26150bda9d19da95a0de280226fb251d2ae488b6..3c3ab0dc71af6fcb37a2feb34973051c94ed73c8 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 d5a1ead468657f6e86ceb64c1b24fc4c944210b1..0bc17c56efac29758a317310c3231cf4d473f06d 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 2be0a60829e090aeb5b87df132447ea1ccb3d275..26ad9af4fd3c597cb6b0f69c74199a6b3f153cf0 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 ea7a900bab9956b698e56e32f892cb073d5f1581..2290663e0b2e184b97dcaf976b6fa3e45d6edbd7 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 65f829fce7bb05d7eb40a03f2b664d20944cbf83..9be0e654c2e166647164608620bcf2d062fd54c2 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_},