提交 dcc0c513 编写于 作者: G gineshidalgo99

WrapperStructOutput split into Output and Gui

上级 d2dc9963
......@@ -294,6 +294,8 @@ OpenPose Library - Release Notes
3. WrapperT.configure() changed from 1 function that requries all arguments to individual functions that take 1 argument each.
4. Added `Forward` to all net classes that automatically selects between CUDA, OpenCL, or CPU-only version depending on the defines.
5. Previously hardcoded `COCO_CHALLENGE` variable turned into user configurable flag `--maximize_positives`.
6. Removed old COCO 2014 validation scripts.
7. WrapperStructOutput split into WrapperStructOutput and WrapperStructGui.
3. Main bugs fixed:
1. CMake-GUI was forcing to Release mode, allowed Debug modes too.
2. NMS returns in index 0 the number of found peaks. However, while the number of peaks was truncated to a maximum of 127, this index 0 was saving the real number instead of the truncated one.
......
......@@ -96,14 +96,17 @@ int openPoseDemo()
cameraSize, FLAGS_camera_fps, FLAGS_camera_parameter_folder, !FLAGS_frame_keep_distortion,
(unsigned int) FLAGS_3d_views};
opWrapper.configure(wrapperStructInput);
// Consumer (comment or use default argument to disable any output)
// Output (comment or use default argument to disable any output)
const op::WrapperStructOutput wrapperStructOutput{
op::flagsToDisplayMode(FLAGS_display, FLAGS_3d), !FLAGS_no_gui_verbose, FLAGS_fullscreen,
FLAGS_write_keypoint, op::stringToDataFormat(FLAGS_write_keypoint_format), FLAGS_write_json,
FLAGS_write_coco_json, FLAGS_write_coco_foot_json, FLAGS_write_coco_json_variant, FLAGS_write_images,
FLAGS_write_images_format, FLAGS_write_video, FLAGS_camera_fps, FLAGS_write_heatmaps,
FLAGS_write_heatmaps_format, FLAGS_write_video_adam, FLAGS_write_bvh, FLAGS_udp_host, FLAGS_udp_port};
opWrapper.configure(wrapperStructOutput);
// GUI (comment or use default argument to disable any visual output)
const op::WrapperStructGui wrapperStructGui{
op::flagsToDisplayMode(FLAGS_display, FLAGS_3d), !FLAGS_no_gui_verbose, FLAGS_fullscreen};
opWrapper.configure(wrapperStructGui);
// Set to single-thread (for sequential processing and/or debugging and/or reducing latency)
if (FLAGS_disable_multi_thread)
opWrapper.disableMultiThreading();
......
......@@ -2,13 +2,13 @@
# USAGE EXAMPLE
# clear && clear && make all -j`nproc` && bash ./examples/tests/pose_accuracy_coco_test_dev.sh
# Script for internal use. We might completely change it continuously and we will not answer questions about it.
clear && clear
# USAGE EXAMPLE
# See ./examples/tests/pose_accuracy_coco_test.sh
# Parameters
IMAGE_FOLDER=/media/posefs3b/Users/gines/openpose_train/dataset/COCO/cocoapi/images/test2017_dev/
JSON_FOLDER=../evaluation/coco_val_jsons/
......@@ -16,6 +16,8 @@ OP_BIN=./build/examples/openpose/openpose.bin
# # 1 scale
# $OP_BIN --image_dir $IMAGE_FOLDER --write_coco_json ${JSON_FOLDER}1_test.json --display 0 --render_pose 0
# $OP_BIN --image_dir $IMAGE_FOLDER --write_coco_json ${JSON_FOLDER}1_test_max.json --display 0 --render_pose 0 --maximize_positives
# 4 scales
$OP_BIN --image_dir $IMAGE_FOLDER --write_coco_json ${JSON_FOLDER}1_4_test.json --display 0 --render_pose 0 --scale_number 4 --scale_gap 0.25 --net_resolution "1312x736"
# $OP_BIN --image_dir $IMAGE_FOLDER --write_coco_json ${JSON_FOLDER}1_4_test.json --display 0 --render_pose 0 --scale_number 4 --scale_gap 0.25 --net_resolution "1312x736"
$OP_BIN --image_dir $IMAGE_FOLDER --write_coco_json ${JSON_FOLDER}1_4_test_max.json --display 0 --render_pose 0 --scale_number 4 --scale_gap 0.25 --net_resolution "1312x736" --maximize_positives
......@@ -2,24 +2,15 @@
# Script for internal use. We might completely change it continuously and we will not answer questions about it.
clear && clear
# USAGE EXAMPLE
# clear && clear && make all -j`nproc` && bash ./examples/tests/pose_accuracy_coco_test.sh
# # Go back to main folder
# cd ../../
# clear && clear && make all -j`nproc` && bash ./examples/tests/pose_accuracy_coco_val.sh
# Script for internal use. We might completely change it continuously and we will not answer questions about it.
# Write COCO-format JSON
# Last id:
# ID 20671 <--> #frames = 1471 --> ~ 1.5 min at 15fps
# ID 50006 <--> #frames = 3559 --> ~ 4 min at 15fps
clear && clear
# Parameters
IMAGE_FOLDER=/home/gines/devel/images/val2017/
IMAGE_FOLDER=~/devel/images/val2017/
JSON_FOLDER=../evaluation/coco_val_jsons/
OP_BIN=./build/examples/openpose/openpose.bin
......
#!/bin/bash
# Script for internal use. We might completely change it continuously and we will not answer questions about it.
clear && clear
# USAGE EXAMPLE
# clear && clear && make all -j`nproc` && bash ./examples/tests/pose_accuracy_coco_test.sh
# # Go back to main folder
# cd ../../
# Write COCO-format JSON
# Note: `--frame_last 3558` --> total = 3559 frames
# Last id:
# ID 20671 <--> #frames = 1471 --> ~ 1.5 min at 15fps
# ID 50006 <--> #frames = 3559 --> ~ 4 min at 15fps
# Parameters
IMAGE_FOLDER=/home/gines/devel/images/val2014/
JSON_FOLDER=../evaluation/coco_val_jsons/
OP_BIN=./build/examples/openpose/openpose.bin
# 1 scale
$OP_BIN --image_dir $IMAGE_FOLDER --write_coco_json ${JSON_FOLDER}1.json --display 0 --render_pose 0 --frame_last 3558
# 1 scale - Debugging
# $OP_BIN --image_dir $IMAGE_FOLDER --write_coco_json ${JSON_FOLDER}1.json --display 0 --frame_last 3558 --write_images ~/Desktop/CppValidation/
# # 3 scales
# $OP_BIN --image_dir $IMAGE_FOLDER --write_coco_json ${JSON_FOLDER}1_3.json --display 0 --render_pose 0 --scale_number 3 --scale_gap 0.25 --frame_last 3558
# # 4 scales
# $OP_BIN --num_gpu 1 --image_dir $IMAGE_FOLDER --write_coco_json ${JSON_FOLDER}1_4.json --display 0 --render_pose 0 --scale_number 4 --scale_gap 0.25 --net_resolution "1312x736" --frame_last 3558
# # Debugging - Rendered frames saved
# $OP_BIN --image_dir $IMAGE_FOLDER --write_images ${JSON_FOLDER}frameOutput --display 0
#!/bin/bash
# Script for internal use. We might completely change it continuously and we will not answer questions about it.
clear && clear
# USAGE EXAMPLE
# See ./examples/tests/pose_accuracy_coco_test.sh
# Parameters
IMAGE_FOLDER=/home/gines/devel/images/val2017/
JSON_FOLDER=../evaluation/coco_val_jsons/
OP_BIN=./build/examples/openpose/openpose.bin
# 1 scale
$OP_BIN --image_dir $IMAGE_FOLDER --write_coco_json ${JSON_FOLDER}1.json --display 0 --render_pose 0
# 3 scales
$OP_BIN --image_dir $IMAGE_FOLDER --write_coco_json ${JSON_FOLDER}1_3.json --display 0 --render_pose 0 --scale_number 3 --scale_gap 0.25
# 4 scales
$OP_BIN --image_dir $IMAGE_FOLDER --write_coco_json ${JSON_FOLDER}1_4.json --display 0 --render_pose 0 --scale_number 4 --scale_gap 0.25 --net_resolution "1312x736"
#!/bin/bash
# Script for internal use. We might completely change it continuously and we will not answer questions about it.
clear && clear
# USAGE EXAMPLE
# See ./examples/tests/pose_accuracy_coco_test.sh
# Parameters
IMAGE_FOLDER=/home/gines/devel/images/val2014/
JSON_FOLDER=../evaluation/coco_val_jsons/
OP_BIN=./build/examples/openpose/openpose.bin
# 1 scale
$OP_BIN --image_dir $IMAGE_FOLDER --write_coco_json ${JSON_FOLDER}1.json --display 0 --render_pose 0 --frame_last 3558
# 3 scales
$OP_BIN --image_dir $IMAGE_FOLDER --write_coco_json ${JSON_FOLDER}1_3.json --display 0 --render_pose 0 --scale_number 3 --scale_gap 0.25 --frame_last 3558
# 4 scales
$OP_BIN --image_dir $IMAGE_FOLDER --write_coco_json ${JSON_FOLDER}1_4.json --display 0 --render_pose 0 --scale_number 4 --scale_gap 0.25 --net_resolution "1312x736" --frame_last 3558
......@@ -109,14 +109,17 @@ int tutorialAddModule1()
cameraSize, FLAGS_camera_fps, FLAGS_camera_parameter_folder, !FLAGS_frame_keep_distortion,
(unsigned int) FLAGS_3d_views};
opWrapperT.configure(wrapperStructInput);
// Consumer (comment or use default argument to disable any output)
// Output (comment or use default argument to disable any output)
const op::WrapperStructOutput wrapperStructOutput{
op::flagsToDisplayMode(FLAGS_display, FLAGS_3d), !FLAGS_no_gui_verbose, FLAGS_fullscreen,
FLAGS_write_keypoint, op::stringToDataFormat(FLAGS_write_keypoint_format), FLAGS_write_json,
FLAGS_write_coco_json, FLAGS_write_coco_foot_json, FLAGS_write_coco_json_variant, FLAGS_write_images,
FLAGS_write_images_format, FLAGS_write_video, FLAGS_camera_fps, FLAGS_write_heatmaps,
FLAGS_write_heatmaps_format, FLAGS_write_video_adam, FLAGS_write_bvh, FLAGS_udp_host, FLAGS_udp_port};
opWrapperT.configure(wrapperStructOutput);
// GUI (comment or use default argument to disable any visual output)
const op::WrapperStructGui wrapperStructGui{
op::flagsToDisplayMode(FLAGS_display, FLAGS_3d), !FLAGS_no_gui_verbose, FLAGS_fullscreen};
opWrapperT.configure(wrapperStructGui);
// Custom post-processing
auto userPostProcessing = std::make_shared<op::UserPostProcessing>(/* Your class arguments here */);
......
......@@ -108,17 +108,14 @@ int tutorialApiCpp3()
const op::WrapperStructExtra wrapperStructExtra{
FLAGS_3d, FLAGS_3d_min_views, FLAGS_identification, FLAGS_tracking, FLAGS_ik_threads};
opWrapper.configure(wrapperStructExtra);
// Consumer (comment or use default argument to disable any output)
const auto displayMode = op::DisplayMode::NoDisplay;
const bool guiVerbose = false;
const bool fullScreen = false;
// Output (comment or use default argument to disable any output)
const op::WrapperStructOutput wrapperStructOutput{
displayMode, guiVerbose, fullScreen, FLAGS_write_keypoint,
op::stringToDataFormat(FLAGS_write_keypoint_format), FLAGS_write_json, FLAGS_write_coco_json,
FLAGS_write_coco_foot_json, FLAGS_write_coco_json_variant, FLAGS_write_images, FLAGS_write_images_format,
FLAGS_write_video, FLAGS_camera_fps, FLAGS_write_heatmaps, FLAGS_write_heatmaps_format,
FLAGS_write_video_adam, FLAGS_write_bvh, FLAGS_udp_host, FLAGS_udp_port};
FLAGS_write_keypoint, op::stringToDataFormat(FLAGS_write_keypoint_format), FLAGS_write_json,
FLAGS_write_coco_json, FLAGS_write_coco_foot_json, FLAGS_write_coco_json_variant, FLAGS_write_images,
FLAGS_write_images_format, FLAGS_write_video, FLAGS_camera_fps, FLAGS_write_heatmaps,
FLAGS_write_heatmaps_format, FLAGS_write_video_adam, FLAGS_write_bvh, FLAGS_udp_host, FLAGS_udp_port};
opWrapper.configure(wrapperStructOutput);
// No GUI. Equivalent to: opWrapper.configure(op::WrapperStructGui{});
// Set to single-thread (for sequential processing and/or debugging and/or reducing latency)
if (FLAGS_disable_multi_thread)
opWrapper.disableMultiThreading();
......
......@@ -241,17 +241,14 @@ int tutorialApiCpp4()
const op::WrapperStructExtra wrapperStructExtra{
FLAGS_3d, FLAGS_3d_min_views, FLAGS_identification, FLAGS_tracking, FLAGS_ik_threads};
opWrapperT.configure(wrapperStructExtra);
// Consumer (comment or use default argument to disable any output)
const auto displayMode = op::DisplayMode::NoDisplay;
const bool guiVerbose = false;
const bool fullScreen = false;
// Output (comment or use default argument to disable any output)
const op::WrapperStructOutput wrapperStructOutput{
displayMode, guiVerbose, fullScreen, FLAGS_write_keypoint,
op::stringToDataFormat(FLAGS_write_keypoint_format), FLAGS_write_json, FLAGS_write_coco_json,
FLAGS_write_coco_foot_json, FLAGS_write_coco_json_variant, FLAGS_write_images, FLAGS_write_images_format,
FLAGS_write_video, FLAGS_camera_fps, FLAGS_write_heatmaps, FLAGS_write_heatmaps_format,
FLAGS_write_video_adam, FLAGS_write_bvh, FLAGS_udp_host, FLAGS_udp_port};
FLAGS_write_keypoint, op::stringToDataFormat(FLAGS_write_keypoint_format), FLAGS_write_json,
FLAGS_write_coco_json, FLAGS_write_coco_foot_json, FLAGS_write_coco_json_variant, FLAGS_write_images,
FLAGS_write_images_format, FLAGS_write_video, FLAGS_camera_fps, FLAGS_write_heatmaps,
FLAGS_write_heatmaps_format, FLAGS_write_video_adam, FLAGS_write_bvh, FLAGS_udp_host, FLAGS_udp_port};
opWrapperT.configure(wrapperStructOutput);
// No GUI. Equivalent to: opWrapper.configure(op::WrapperStructGui{});
// Set to single-thread (for sequential processing and/or debugging and/or reducing latency)
if (FLAGS_disable_multi_thread)
opWrapperT.disableMultiThreading();
......
......@@ -191,17 +191,14 @@ int tutorialApiCpp5()
cameraSize, FLAGS_camera_fps, FLAGS_camera_parameter_folder, !FLAGS_frame_keep_distortion,
(unsigned int) FLAGS_3d_views};
opWrapperT.configure(wrapperStructInput);
// Consumer (comment or use default argument to disable any output)
const auto displayMode = op::DisplayMode::NoDisplay;
const bool guiVerbose = false;
const bool fullScreen = false;
// Output (comment or use default argument to disable any output)
const op::WrapperStructOutput wrapperStructOutput{
displayMode, guiVerbose, fullScreen, FLAGS_write_keypoint,
op::stringToDataFormat(FLAGS_write_keypoint_format), FLAGS_write_json, FLAGS_write_coco_json,
FLAGS_write_coco_foot_json, FLAGS_write_coco_json_variant, FLAGS_write_images, FLAGS_write_images_format,
FLAGS_write_video, FLAGS_camera_fps, FLAGS_write_heatmaps, FLAGS_write_heatmaps_format,
FLAGS_write_video_adam, FLAGS_write_bvh, FLAGS_udp_host, FLAGS_udp_port};
FLAGS_write_keypoint, op::stringToDataFormat(FLAGS_write_keypoint_format), FLAGS_write_json,
FLAGS_write_coco_json, FLAGS_write_coco_foot_json, FLAGS_write_coco_json_variant, FLAGS_write_images,
FLAGS_write_images_format, FLAGS_write_video, FLAGS_camera_fps, FLAGS_write_heatmaps,
FLAGS_write_heatmaps_format, FLAGS_write_video_adam, FLAGS_write_bvh, FLAGS_udp_host, FLAGS_udp_port};
opWrapperT.configure(wrapperStructOutput);
// No GUI. Equivalent to: opWrapper.configure(op::WrapperStructGui{});
// Set to single-thread (for sequential processing and/or debugging and/or reducing latency)
if (FLAGS_disable_multi_thread)
opWrapperT.disableMultiThreading();
......
......@@ -159,14 +159,17 @@ int tutorialApiCpp6()
cameraSize, FLAGS_camera_fps, FLAGS_camera_parameter_folder, !FLAGS_frame_keep_distortion,
(unsigned int) FLAGS_3d_views};
opWrapperT.configure(wrapperStructInput);
// Consumer (comment or use default argument to disable any output)
// Output (comment or use default argument to disable any output)
const op::WrapperStructOutput wrapperStructOutput{
op::flagsToDisplayMode(FLAGS_display, FLAGS_3d), !FLAGS_no_gui_verbose, FLAGS_fullscreen,
FLAGS_write_keypoint, op::stringToDataFormat(FLAGS_write_keypoint_format), FLAGS_write_json,
FLAGS_write_coco_json, FLAGS_write_coco_foot_json, FLAGS_write_coco_json_variant, FLAGS_write_images,
FLAGS_write_images_format, FLAGS_write_video, FLAGS_camera_fps, FLAGS_write_heatmaps,
FLAGS_write_heatmaps_format, FLAGS_write_video_adam, FLAGS_write_bvh, FLAGS_udp_host, FLAGS_udp_port};
opWrapperT.configure(wrapperStructOutput);
// GUI (comment or use default argument to disable any visual output)
const op::WrapperStructGui wrapperStructGui{
op::flagsToDisplayMode(FLAGS_display, FLAGS_3d), !FLAGS_no_gui_verbose, FLAGS_fullscreen};
opWrapperT.configure(wrapperStructGui);
// Set to single-thread (for sequential processing and/or debugging and/or reducing latency)
if (FLAGS_disable_multi_thread)
opWrapperT.disableMultiThreading();
......
......@@ -192,14 +192,17 @@ int tutorialApiCpp7()
const op::WrapperStructExtra wrapperStructExtra{
FLAGS_3d, FLAGS_3d_min_views, FLAGS_identification, FLAGS_tracking, FLAGS_ik_threads};
opWrapperT.configure(wrapperStructExtra);
// Consumer (comment or use default argument to disable any output)
// Output (comment or use default argument to disable any output)
const op::WrapperStructOutput wrapperStructOutput{
op::flagsToDisplayMode(FLAGS_display, FLAGS_3d), !FLAGS_no_gui_verbose, FLAGS_fullscreen,
FLAGS_write_keypoint, op::stringToDataFormat(FLAGS_write_keypoint_format), FLAGS_write_json,
FLAGS_write_coco_json, FLAGS_write_coco_foot_json, FLAGS_write_coco_json_variant, FLAGS_write_images,
FLAGS_write_images_format, FLAGS_write_video, FLAGS_camera_fps, FLAGS_write_heatmaps,
FLAGS_write_heatmaps_format, FLAGS_write_video_adam, FLAGS_write_bvh, FLAGS_udp_host, FLAGS_udp_port};
opWrapperT.configure(wrapperStructOutput);
// GUI (comment or use default argument to disable any visual output)
const op::WrapperStructGui wrapperStructGui{
op::flagsToDisplayMode(FLAGS_display, FLAGS_3d), !FLAGS_no_gui_verbose, FLAGS_fullscreen};
opWrapperT.configure(wrapperStructGui);
// Set to single-thread (for sequential processing and/or debugging and/or reducing latency)
if (FLAGS_disable_multi_thread)
opWrapperT.disableMultiThreading();
......
......@@ -206,17 +206,14 @@ int tutorialApiCpp8()
cameraSize, FLAGS_camera_fps, FLAGS_camera_parameter_folder, !FLAGS_frame_keep_distortion,
(unsigned int) FLAGS_3d_views};
opWrapperT.configure(wrapperStructInput);
// Consumer (comment or use default argument to disable any output)
const auto displayMode = op::DisplayMode::NoDisplay;
const bool guiVerbose = false;
const bool fullScreen = false;
// Output (comment or use default argument to disable any output)
const op::WrapperStructOutput wrapperStructOutput{
displayMode, guiVerbose, fullScreen, FLAGS_write_keypoint,
op::stringToDataFormat(FLAGS_write_keypoint_format), FLAGS_write_json, FLAGS_write_coco_json,
FLAGS_write_coco_foot_json, FLAGS_write_coco_json_variant, FLAGS_write_images, FLAGS_write_images_format,
FLAGS_write_video, FLAGS_camera_fps, FLAGS_write_heatmaps, FLAGS_write_heatmaps_format,
FLAGS_write_video_adam, FLAGS_write_bvh, FLAGS_udp_host, FLAGS_udp_port};
FLAGS_write_keypoint, op::stringToDataFormat(FLAGS_write_keypoint_format), FLAGS_write_json,
FLAGS_write_coco_json, FLAGS_write_coco_foot_json, FLAGS_write_coco_json_variant, FLAGS_write_images,
FLAGS_write_images_format, FLAGS_write_video, FLAGS_camera_fps, FLAGS_write_heatmaps,
FLAGS_write_heatmaps_format, FLAGS_write_video_adam, FLAGS_write_bvh, FLAGS_udp_host, FLAGS_udp_port};
opWrapperT.configure(wrapperStructOutput);
// No GUI. Equivalent to: opWrapper.configure(op::WrapperStructGui{});
// Set to single-thread (for sequential processing and/or debugging and/or reducing latency)
if (FLAGS_disable_multi_thread)
opWrapperT.disableMultiThreading();
......
......@@ -298,17 +298,14 @@ int tutorialApiCpp9()
const op::WrapperStructExtra wrapperStructExtra{
FLAGS_3d, FLAGS_3d_min_views, FLAGS_identification, FLAGS_tracking, FLAGS_ik_threads};
opWrapperT.configure(wrapperStructExtra);
// Consumer (comment or use default argument to disable any output)
const auto displayMode = op::DisplayMode::NoDisplay;
const bool guiVerbose = false;
const bool fullScreen = false;
// Output (comment or use default argument to disable any output)
const op::WrapperStructOutput wrapperStructOutput{
displayMode, guiVerbose, fullScreen, FLAGS_write_keypoint,
op::stringToDataFormat(FLAGS_write_keypoint_format), FLAGS_write_json, FLAGS_write_coco_json,
FLAGS_write_coco_foot_json, FLAGS_write_coco_json_variant, FLAGS_write_images, FLAGS_write_images_format,
FLAGS_write_video, FLAGS_camera_fps, FLAGS_write_heatmaps, FLAGS_write_heatmaps_format,
FLAGS_write_video_adam, FLAGS_write_bvh, FLAGS_udp_host, FLAGS_udp_port};
FLAGS_write_keypoint, op::stringToDataFormat(FLAGS_write_keypoint_format), FLAGS_write_json,
FLAGS_write_coco_json, FLAGS_write_coco_foot_json, FLAGS_write_coco_json_variant, FLAGS_write_images,
FLAGS_write_images_format, FLAGS_write_video, FLAGS_camera_fps, FLAGS_write_heatmaps,
FLAGS_write_heatmaps_format, FLAGS_write_video_adam, FLAGS_write_bvh, FLAGS_udp_host, FLAGS_udp_port};
opWrapperT.configure(wrapperStructOutput);
// No GUI. Equivalent to: opWrapper.configure(op::WrapperStructGui{});
// Set to single-thread (for sequential processing and/or debugging and/or reducing latency)
if (FLAGS_disable_multi_thread)
opWrapperT.disableMultiThreading();
......
......@@ -20,7 +20,7 @@ namespace op
OP_API unsigned int getPoseNumberBodyParts(const PoseModel poseModel);
OP_API const std::vector<unsigned int>& getPosePartPairs(const PoseModel poseModel);
OP_API const std::vector<unsigned int>& getPoseMapIndex(const PoseModel poseModel);
OP_API unsigned int getPoseMaxPeaks(const PoseModel poseModel);
OP_API unsigned int getPoseMaxPeaks();
OP_API float getPoseNetDecreaseFactor(const PoseModel poseModel);
OP_API unsigned int poseBodyPartMapStringToKey(const PoseModel poseModel, const std::string& string);
OP_API unsigned int poseBodyPartMapStringToKey(const PoseModel poseModel, const std::vector<std::string>& strings);
......
......@@ -6,6 +6,7 @@
#include <openpose/wrapper/wrapper.hpp>
#include <openpose/wrapper/wrapperAuxiliary.hpp>
#include <openpose/wrapper/wrapperStructFace.hpp>
#include <openpose/wrapper/wrapperStructGui.hpp>
#include <openpose/wrapper/wrapperStructHand.hpp>
#include <openpose/wrapper/wrapperStructInput.hpp>
#include <openpose/wrapper/wrapperStructOutput.hpp>
......
......@@ -6,6 +6,7 @@
#include <openpose/wrapper/enumClasses.hpp>
#include <openpose/wrapper/wrapperStructExtra.hpp>
#include <openpose/wrapper/wrapperStructFace.hpp>
#include <openpose/wrapper/wrapperStructGui.hpp>
#include <openpose/wrapper/wrapperStructHand.hpp>
#include <openpose/wrapper/wrapperStructInput.hpp>
#include <openpose/wrapper/wrapperStructOutput.hpp>
......@@ -71,30 +72,35 @@ namespace op
void configure(const WrapperStructPose& wrapperStructPose);
/**
* Analogous to configure() but applied to only pose (WrapperStructFace)
* Analogous to configure(WrapperStructPose) but applied to face (WrapperStructFace)
*/
void configure(const WrapperStructFace& wrapperStructFace);
/**
* Analogous to configure() but applied to only pose (WrapperStructHand)
* Analogous to configure() but applied to hand (WrapperStructHand)
*/
void configure(const WrapperStructHand& wrapperStructHand);
/**
* Analogous to configure() but applied to only pose (WrapperStructExtra)
* Analogous to configure() but applied to the extra options (WrapperStructExtra)
*/
void configure(const WrapperStructExtra& wrapperStructExtra);
/**
* Analogous to configure() but applied to only pose (WrapperStructInput)
* Analogous to configure() but applied to the input (WrapperStructInput)
*/
void configure(const WrapperStructInput& wrapperStructInput);
/**
* Analogous to configure() but applied to only pose (WrapperStructInput)
* Analogous to configure() but applied to the output (WrapperStructOutput)
*/
void configure(const WrapperStructOutput& wrapperStructOutput);
/**
* Analogous to configure() but applied to the GUI (WrapperStructGui)
*/
void configure(const WrapperStructGui& wrapperStructGui);
/**
* Function to start multi-threading.
* Similar to start(), but exec() blocks the thread that calls the function (it saves 1 thread). Use exec()
......@@ -201,6 +207,7 @@ namespace op
WrapperStructExtra mWrapperStructExtra;
WrapperStructInput mWrapperStructInput;
WrapperStructOutput mWrapperStructOutput;
WrapperStructGui mWrapperStructGui;
// User configurable workers
std::array<bool, int(WorkerType::Size)> mUserWsOnNewThread;
std::array<std::vector<TWorker>, int(WorkerType::Size)> mUserWs;
......@@ -357,6 +364,19 @@ namespace op
}
}
template<typename TDatums, typename TDatumsSP, typename TWorker>
void WrapperT<TDatums, TDatumsSP, TWorker>::configure(const WrapperStructGui& wrapperStructGui)
{
try
{
mWrapperStructGui = wrapperStructGui;
}
catch (const std::exception& e)
{
error(e.what(), __LINE__, __FUNCTION__, __FILE__);
}
}
template<typename TDatums, typename TDatumsSP, typename TWorker>
void WrapperT<TDatums, TDatumsSP, TWorker>::exec()
{
......@@ -364,7 +384,7 @@ namespace op
{
configureThreadManager<TDatums, TDatumsSP, TWorker>(
mThreadManager, mMultiThreadEnabled, mThreadManagerMode, mWrapperStructPose, mWrapperStructFace,
mWrapperStructHand, mWrapperStructExtra, mWrapperStructInput, mWrapperStructOutput,
mWrapperStructHand, mWrapperStructExtra, mWrapperStructInput, mWrapperStructOutput, mWrapperStructGui,
mUserWs, mUserWsOnNewThread);
log("", Priority::Low, __LINE__, __FUNCTION__, __FILE__);
mThreadManager.exec();
......@@ -382,7 +402,7 @@ namespace op
{
configureThreadManager<TDatums, TDatumsSP, TWorker>(
mThreadManager, mMultiThreadEnabled, mThreadManagerMode, mWrapperStructPose, mWrapperStructFace,
mWrapperStructHand, mWrapperStructExtra, mWrapperStructInput, mWrapperStructOutput,
mWrapperStructHand, mWrapperStructExtra, mWrapperStructInput, mWrapperStructOutput, mWrapperStructGui,
mUserWs, mUserWsOnNewThread);
log("", Priority::Low, __LINE__, __FUNCTION__, __FILE__);
mThreadManager.start();
......
......@@ -5,6 +5,7 @@
#include <openpose/wrapper/enumClasses.hpp>
#include <openpose/wrapper/wrapperStructExtra.hpp>
#include <openpose/wrapper/wrapperStructFace.hpp>
#include <openpose/wrapper/wrapperStructGui.hpp>
#include <openpose/wrapper/wrapperStructHand.hpp>
#include <openpose/wrapper/wrapperStructInput.hpp>
#include <openpose/wrapper/wrapperStructOutput.hpp>
......@@ -29,8 +30,8 @@ namespace op
WrapperStructPose& wrapperStructPose, const WrapperStructFace& wrapperStructFace,
const WrapperStructHand& wrapperStructHand, const WrapperStructExtra& wrapperStructExtra,
const WrapperStructInput& wrapperStructInput, const WrapperStructOutput& wrapperStructOutput,
const bool renderOutput, const bool userOutputWsEmpty, const std::shared_ptr<Producer>& producerSharedPtr,
const ThreadManagerMode threadManagerMode);
const WrapperStructGui& wrapperStructGui, const bool renderOutput, const bool userOutputWsEmpty,
const std::shared_ptr<Producer>& producerSharedPtr, const ThreadManagerMode threadManagerMode);
/**
* Thread ID increase (private internal function).
......@@ -56,7 +57,7 @@ namespace op
const ThreadManagerMode threadManagerMode, const WrapperStructPose& wrapperStructPose,
const WrapperStructFace& wrapperStructFace, const WrapperStructHand& wrapperStructHand,
const WrapperStructExtra& wrapperStructExtra, const WrapperStructInput& wrapperStructInput,
const WrapperStructOutput& wrapperStructOutput,
const WrapperStructOutput& wrapperStructOutput, const WrapperStructGui& wrapperStructGui,
const std::array<std::vector<TWorker>, int(WorkerType::Size)>& userWs,
const std::array<bool, int(WorkerType::Size)>& userWsOnNewThread);
}
......@@ -86,7 +87,7 @@ namespace op
const ThreadManagerMode threadManagerMode, const WrapperStructPose& wrapperStructPoseTemp,
const WrapperStructFace& wrapperStructFace, const WrapperStructHand& wrapperStructHand,
const WrapperStructExtra& wrapperStructExtra, const WrapperStructInput& wrapperStructInput,
const WrapperStructOutput& wrapperStructOutput,
const WrapperStructOutput& wrapperStructOutput, const WrapperStructGui& wrapperStructGui,
const std::array<std::vector<TWorker>, int(WorkerType::Size)>& userWs,
const std::array<bool, int(WorkerType::Size)>& userWsOnNewThread)
{
......@@ -146,7 +147,8 @@ namespace op
const auto userOutputWsEmpty = userOutputWs.empty();
wrapperConfigureSanityChecks(
wrapperStructPose, wrapperStructFace, wrapperStructHand, wrapperStructExtra, wrapperStructInput,
wrapperStructOutput, renderOutput, userOutputWsEmpty, producerSharedPtr, threadManagerMode);
wrapperStructOutput, wrapperStructGui, renderOutput, userOutputWsEmpty, producerSharedPtr,
threadManagerMode);
// Get number threads
auto numberThreads = wrapperStructPose.gpuNumber;
......@@ -562,8 +564,8 @@ namespace op
}
// IK/Adam
const auto displayAdam = wrapperStructOutput.displayMode == DisplayMode::DisplayAdam
|| (wrapperStructOutput.displayMode == DisplayMode::DisplayAll
const auto displayAdam = wrapperStructGui.displayMode == DisplayMode::DisplayAdam
|| (wrapperStructGui.displayMode == DisplayMode::DisplayAll
&& wrapperStructExtra.ikThreads > 0);
jointAngleEstimationsWs.clear();
#ifdef USE_3D_ADAM_MODEL
......@@ -676,12 +678,12 @@ namespace op
outputWs.emplace_back(std::make_shared<WHeatMapSaver<TDatumsSP>>(heatMapSaver));
}
// Add frame information for GUI
const bool guiEnabled = (wrapperStructOutput.displayMode != DisplayMode::NoDisplay);
const bool guiEnabled = (wrapperStructGui.displayMode != DisplayMode::NoDisplay);
// If this WGuiInfoAdder instance is placed before the WImageSaver or WVideoSaver, then the resulting
// recorded frames will look exactly as the final displayed image by the GUI
if (wrapperStructOutput.guiVerbose && (guiEnabled || !userOutputWs.empty()
|| threadManagerMode == ThreadManagerMode::Asynchronous
|| threadManagerMode == ThreadManagerMode::AsynchronousOut))
if (wrapperStructGui.guiVerbose && (guiEnabled || !userOutputWs.empty()
|| threadManagerMode == ThreadManagerMode::Asynchronous
|| threadManagerMode == ThreadManagerMode::AsynchronousOut))
{
const auto guiInfoAdder = std::make_shared<GuiInfoAdder>(numberThreads, guiEnabled);
outputWs.emplace_back(std::make_shared<WGuiInfoAdder<TDatumsSP>>(guiInfoAdder));
......@@ -704,9 +706,9 @@ namespace op
#ifdef USE_3D_ADAM_MODEL
// Gui
const auto gui = std::make_shared<GuiAdam>(
finalOutputSize, wrapperStructOutput.fullScreen, threadManager.getIsRunningSharedPtr(),
finalOutputSize, wrapperStructGui.fullScreen, threadManager.getIsRunningSharedPtr(),
spVideoSeek, poseExtractorNets, faceExtractorNets, handExtractorNets, renderers,
wrapperStructOutput.displayMode, JointAngleEstimation::getTotalModel(),
wrapperStructGui.displayMode, JointAngleEstimation::getTotalModel(),
wrapperStructOutput.writeVideoAdam
);
// WGui
......@@ -714,24 +716,24 @@ namespace op
#endif
}
// 3-D (+2-D) display
else if (wrapperStructOutput.displayMode == DisplayMode::Display3D
|| wrapperStructOutput.displayMode == DisplayMode::DisplayAll)
else if (wrapperStructGui.displayMode == DisplayMode::Display3D
|| wrapperStructGui.displayMode == DisplayMode::DisplayAll)
{
// Gui
const auto gui = std::make_shared<Gui3D>(
finalOutputSize, wrapperStructOutput.fullScreen, threadManager.getIsRunningSharedPtr(),
finalOutputSize, wrapperStructGui.fullScreen, threadManager.getIsRunningSharedPtr(),
spVideoSeek, poseExtractorNets, faceExtractorNets, handExtractorNets, renderers,
wrapperStructPose.poseModel, wrapperStructOutput.displayMode
wrapperStructPose.poseModel, wrapperStructGui.displayMode
);
// WGui
guiW = {std::make_shared<WGui3D<TDatumsSP>>(gui)};
}
// 2-D display
else if (wrapperStructOutput.displayMode == DisplayMode::Display2D)
else if (wrapperStructGui.displayMode == DisplayMode::Display2D)
{
// Gui
const auto gui = std::make_shared<Gui>(
finalOutputSize, wrapperStructOutput.fullScreen, threadManager.getIsRunningSharedPtr(),
finalOutputSize, wrapperStructGui.fullScreen, threadManager.getIsRunningSharedPtr(),
spVideoSeek, poseExtractorNets, faceExtractorNets, handExtractorNets, renderers
);
// WGui
......
......@@ -50,9 +50,9 @@ namespace op
* It has the recommended and default values we recommend for each element of the struct.
* Since all the elements of the struct are public, they can also be manually filled.
*/
WrapperStructExtra(const bool reconstruct3d = false, const int minViews3d = -1,
const bool identification = false, const int tracking = -1,
const int ikThreads = 0);
WrapperStructExtra(
const bool reconstruct3d = false, const int minViews3d = -1, const bool identification = false,
const int tracking = -1, const int ikThreads = 0);
};
}
......
......@@ -58,11 +58,10 @@ namespace op
* It has the recommended and default values we recommend for each element of the struct.
* Since all the elements of the struct are public, they can also be manually filled.
*/
WrapperStructFace(const bool enable = false, const Point<int>& netInputSize = Point<int>{368, 368},
const RenderMode renderMode = RenderMode::Gpu,
const float alphaKeypoint = FACE_DEFAULT_ALPHA_KEYPOINT,
const float alphaHeatMap = FACE_DEFAULT_ALPHA_HEAT_MAP,
const float renderThreshold = 0.4f);
WrapperStructFace(
const bool enable = false, const Point<int>& netInputSize = Point<int>{368, 368},
const RenderMode renderMode = RenderMode::Gpu, const float alphaKeypoint = FACE_DEFAULT_ALPHA_KEYPOINT,
const float alphaHeatMap = FACE_DEFAULT_ALPHA_HEAT_MAP, const float renderThreshold = 0.4f);
};
}
......
#ifndef OPENPOSE_WRAPPER_WRAPPER_STRUCT_GUI_HPP
#define OPENPOSE_WRAPPER_WRAPPER_STRUCT_GUI_HPP
#include <openpose/core/common.hpp>
#include <openpose/gui/enumClasses.hpp>
namespace op
{
/**
* WrapperStructGui: It controls a small GUI for quick visualization.
*/
struct OP_API WrapperStructGui
{
/**
* Display mode
* a) -1 for automatic selection.
* b) 0 for no display. Useful if there is no X server and/or to slightly speed up the processing if visual
* output is not required.
* c) 2 for 2-D display in the OpenPose small integrated GUI.
* d) 3 for 3-D display, if `--3d` was enabled.
* e) 1 for both 2-D and 3-D display.
*/
DisplayMode displayMode;
/**
* Whether to add some information to the frame (number of frame, number people detected, etc.) after it is
* saved on disk and before it is displayed and/or returned to the user.
*/
bool guiVerbose;
/**
* Whether to display the OpenPose small integrated GUI on fullscreen mode. It can be changed by interacting
* with the GUI itself.
*/
bool fullScreen;
/**
* Constructor of the struct.
* It has the recommended and default values we recommend for each element of the struct.
* Since all the elements of the struct are public, they can also be manually filled.
*/
WrapperStructGui(
const DisplayMode displayMode = DisplayMode::NoDisplay, const bool guiVerbose = false,
const bool fullScreen = false);
};
}
#endif // OPENPOSE_WRAPPER_WRAPPER_STRUCT_GUI_HPP
......@@ -80,12 +80,11 @@ namespace op
* It has the recommended and default values we recommend for each element of the struct.
* Since all the elements of the struct are public, they can also be manually filled.
*/
WrapperStructHand(const bool enable = false, const Point<int>& netInputSize = Point<int>{368, 368},
const int scalesNumber = 1, const float scaleRange = 0.4f,
const bool tracking = false, const RenderMode renderMode = RenderMode::Gpu,
const float alphaKeypoint = HAND_DEFAULT_ALPHA_KEYPOINT,
const float alphaHeatMap = HAND_DEFAULT_ALPHA_HEAT_MAP,
const float renderThreshold = 0.2f);
WrapperStructHand(
const bool enable = false, const Point<int>& netInputSize = Point<int>{368, 368},
const int scalesNumber = 1, const float scaleRange = 0.4f, const bool tracking = false,
const RenderMode renderMode = RenderMode::Gpu, const float alphaKeypoint = HAND_DEFAULT_ALPHA_KEYPOINT,
const float alphaHeatMap = HAND_DEFAULT_ALPHA_HEAT_MAP, const float renderThreshold = 0.2f);
};
}
......
......@@ -96,15 +96,14 @@ namespace op
* It has the recommended and default values we recommend for each element of the struct.
* Since all the elements of the struct are public, they can also be manually filled.
*/
WrapperStructInput(const ProducerType producerType = ProducerType::None,
const std::string& producerString = "", const unsigned long long frameFirst = 0,
const unsigned long long frameStep = 1,
const unsigned long long frameLast = std::numeric_limits<unsigned long long>::max(),
const bool realTimeProcessing = false, const bool frameFlip = false,
const int frameRotate = 0, const bool framesRepeat = false,
const Point<int>& cameraResolution = Point<int>{-1,-1}, const double webcamFps = 30.,
const std::string& cameraParameterPath = "models/cameraParameters/",
const bool undistortImage = true, const unsigned int imageDirectoryStereo = 1);
WrapperStructInput(
const ProducerType producerType = ProducerType::None, const std::string& producerString = "",
const unsigned long long frameFirst = 0, const unsigned long long frameStep = 1,
const unsigned long long frameLast = std::numeric_limits<unsigned long long>::max(),
const bool realTimeProcessing = false, const bool frameFlip = false, const int frameRotate = 0,
const bool framesRepeat = false, const Point<int>& cameraResolution = Point<int>{-1,-1},
const double webcamFps = 30., const std::string& cameraParameterPath = "models/cameraParameters/",
const bool undistortImage = true, const unsigned int imageDirectoryStereo = 1);
};
}
......
......@@ -8,34 +8,10 @@
namespace op
{
/**
* WrapperStructOutput: Output (small GUI, writing rendered results and/or pose data, etc.) configuration struct.
* WrapperStructOutput allows the user to set up the input frames generator.
* WrapperStructOutput: Output ( writing rendered results and/or pose data, etc.) configuration struct.
*/
struct OP_API WrapperStructOutput
{
/**
* Display mode
* a) -1 for automatic selection.
* b) 0 for no display. Useful if there is no X server and/or to slightly speed up the processing if visual
* output is not required.
* c) 2 for 2-D display in the OpenPose small integrated GUI.
* d) 3 for 3-D display, if `--3d` was enabled.
* e) 1 for both 2-D and 3-D display.
*/
DisplayMode displayMode;
/**
* Whether to add some information to the frame (number of frame, number people detected, etc.) after it is
* saved on disk and before it is displayed and/or returned to the user.
*/
bool guiVerbose;
/**
* Whether to display the OpenPose small integrated GUI on fullscreen mode. It can be changed by interacting
* with the GUI itself.
*/
bool fullScreen;
/**
* Pose (x, y, score) locations saving folder location.
* If it is empty (default), it is disabled.
......@@ -145,16 +121,15 @@ namespace op
* It has the recommended and default values we recommend for each element of the struct.
* Since all the elements of the struct are public, they can also be manually filled.
*/
WrapperStructOutput(const DisplayMode displayMode = DisplayMode::NoDisplay, const bool guiVerbose = false,
const bool fullScreen = false, const std::string& writeKeypoint = "",
const DataFormat writeKeypointFormat = DataFormat::Xml,
const std::string& writeJson = "", const std::string& writeCocoJson = "",
const std::string& writeCocoFootJson = "", const int writeCocoJsonVariant = 1,
const std::string& writeImages = "", const std::string& writeImagesFormat = "",
const std::string& writeVideo = "", const double writeVideoFps = 30.,
const std::string& writeHeatMaps = "", const std::string& writeHeatMapsFormat = "",
const std::string& writeVideoAdam = "", const std::string& writeBvh = "",
const std::string& udpHost = "", const std::string& udpPort = "");
WrapperStructOutput(
const std::string& writeKeypoint = "", const DataFormat writeKeypointFormat = DataFormat::Xml,
const std::string& writeJson = "", const std::string& writeCocoJson = "",
const std::string& writeCocoFootJson = "", const int writeCocoJsonVariant = 1,
const std::string& writeImages = "", const std::string& writeImagesFormat = "",
const std::string& writeVideo = "", const double writeVideoFps = 30.,
const std::string& writeHeatMaps = "", const std::string& writeHeatMapsFormat = "",
const std::string& writeVideoAdam = "", const std::string& writeBvh = "",
const std::string& udpHost = "", const std::string& udpPort = "");
};
}
......
......@@ -179,19 +179,18 @@ namespace op
* It has the recommended and default values we recommend for each element of the struct.
* Since all the elements of the struct are public, they can also be manually filled.
*/
WrapperStructPose(const bool enable = true, const Point<int>& netInputSize = Point<int>{656, 368},
const Point<int>& outputSize = Point<int>{-1, -1},
const ScaleMode keypointScale = ScaleMode::InputResolution,
const int gpuNumber = -1, const int gpuNumberStart = 0, const int scalesNumber = 1,
const float scaleGap = 0.15f, const RenderMode renderMode = RenderMode::Gpu,
const PoseModel poseModel = PoseModel::BODY_25, const bool blendOriginalFrame = true,
const float alphaKeypoint = POSE_DEFAULT_ALPHA_KEYPOINT,
const float alphaHeatMap = POSE_DEFAULT_ALPHA_HEAT_MAP,
const int defaultPartToRender = 0, const std::string& modelFolder = "models/",
const std::vector<HeatMapType>& heatMapTypes = {},
const ScaleMode heatMapScale = ScaleMode::ZeroToOne, const bool addPartCandidates = false,
const float renderThreshold = 0.05f, const int numberPeopleMax = -1,
const bool maximizePositives = false, const bool enableGoogleLogging = true);
WrapperStructPose(
const bool enable = true, const Point<int>& netInputSize = Point<int>{656, 368},
const Point<int>& outputSize = Point<int>{-1, -1},
const ScaleMode keypointScale = ScaleMode::InputResolution, const int gpuNumber = -1,
const int gpuNumberStart = 0, const int scalesNumber = 1, const float scaleGap = 0.15f,
const RenderMode renderMode = RenderMode::Gpu, const PoseModel poseModel = PoseModel::BODY_25,
const bool blendOriginalFrame = true, const float alphaKeypoint = POSE_DEFAULT_ALPHA_KEYPOINT,
const float alphaHeatMap = POSE_DEFAULT_ALPHA_HEAT_MAP, const int defaultPartToRender = 0,
const std::string& modelFolder = "models/", const std::vector<HeatMapType>& heatMapTypes = {},
const ScaleMode heatMapScale = ScaleMode::ZeroToOne, const bool addPartCandidates = false,
const float renderThreshold = 0.05f, const int numberPeopleMax = -1, const bool maximizePositives = false,
const bool enableGoogleLogging = true);
};
}
......
......@@ -98,7 +98,7 @@ namespace op
getPoseNetDecreaseFactor(poseModel), 1.f/scaleInputToNetInput, true,
gpuID);
// Pose extractor blob and layer
nmsCaffe->Reshape({heatMapsBlob.get()}, {peaksBlob.get()}, getPoseMaxPeaks(poseModel),
nmsCaffe->Reshape({heatMapsBlob.get()}, {peaksBlob.get()}, getPoseMaxPeaks(),
getPoseNumberBodyParts(poseModel), gpuID);
// Pose extractor blob and layer
bodyPartConnectorCaffe->Reshape({heatMapsBlob.get(), peaksBlob.get()});
......
......@@ -448,23 +448,6 @@ namespace op
16,18,17,18,16,19,17,19, 0,7,3,17,6,12,16,14, 6,21,7,20,3,21,20,14
},
};
const std::array<unsigned int, (int)PoseModel::Size> POSE_MAX_PEAKS{
POSE_MAX_PEOPLE, // BODY_25
POSE_MAX_PEOPLE, // COCO
POSE_MAX_PEOPLE, // MPI_15
POSE_MAX_PEOPLE, // MPI_15_4
POSE_MAX_PEOPLE, // BODY_19
POSE_MAX_PEOPLE, // BODY_19_X2
POSE_MAX_PEOPLE, // BODY_59
POSE_MAX_PEOPLE, // BODY_19N
POSE_MAX_PEOPLE, // BODY_25E
POSE_MAX_PEOPLE, // BODY_25_19
POSE_MAX_PEOPLE, // BODY_65
POSE_MAX_PEOPLE, // CAR_12
POSE_MAX_PEOPLE, // BODY_25D
POSE_MAX_PEOPLE, // BODY_23
POSE_MAX_PEOPLE, // CAR_22
};
const std::array<float, (int)PoseModel::Size> POSE_CCN_DECREASE_FACTOR{
8.f, // BODY_25
8.f, // COCO
......@@ -561,11 +544,11 @@ namespace op
}
}
unsigned int getPoseMaxPeaks(const PoseModel poseModel)
unsigned int getPoseMaxPeaks()
{
try
{
return POSE_MAX_PEAKS.at((int)poseModel);
return POSE_MAX_PEOPLE;
}
catch (const std::exception& e)
{
......
......@@ -3,6 +3,7 @@ set(SOURCES_OP_WRAPPER
wrapperAuxiliary.cpp
wrapperStructExtra.cpp
wrapperStructFace.cpp
wrapperStructGui.cpp
wrapperStructHand.cpp
wrapperStructInput.cpp
wrapperStructOutput.cpp
......
......@@ -10,6 +10,7 @@ namespace op
const WrapperStructExtra& wrapperStructExtra,
const WrapperStructInput& wrapperStructInput,
const WrapperStructOutput& wrapperStructOutput,
const WrapperStructGui& wrapperStructGui,
const bool renderOutput,
const bool userOutputWsEmpty,
const std::shared_ptr<Producer>& producerSharedPtr,
......@@ -66,7 +67,7 @@ namespace op
const auto savingCvOutput = (
!wrapperStructOutput.writeImages.empty() || !wrapperStructOutput.writeVideo.empty()
);
const bool guiEnabled = (wrapperStructOutput.displayMode != DisplayMode::NoDisplay);
const bool guiEnabled = (wrapperStructGui.displayMode != DisplayMode::NoDisplay);
if (!guiEnabled && !savingCvOutput && renderOutput)
{
const auto message = "GUI is not enabled and you are not saving the output frames. You should then"
......@@ -89,7 +90,7 @@ namespace op
error(message, __LINE__, __FUNCTION__, __FILE__);
}
// Warnings
if (guiEnabled && wrapperStructOutput.guiVerbose && !renderOutput)
if (guiEnabled && wrapperStructGui.guiVerbose && !renderOutput)
{
const auto message = "No render is enabled (e.g., `--render_pose 0`), so you might also want to"
" remove the display (set `--display 0` or `--no_gui_verbose`). If you"
......
#include <openpose/wrapper/wrapperStructGui.hpp>
namespace op
{
WrapperStructGui::WrapperStructGui(
const DisplayMode displayMode_, const bool guiVerbose_, const bool fullScreen_) :
displayMode{displayMode_},
guiVerbose{guiVerbose_},
fullScreen{fullScreen_}
{
}
}
......@@ -3,16 +3,12 @@
namespace op
{
WrapperStructOutput::WrapperStructOutput(
const DisplayMode displayMode_, const bool guiVerbose_, const bool fullScreen_,
const std::string& writeKeypoint_, const DataFormat writeKeypointFormat_, const std::string& writeJson_,
const std::string& writeCocoJson_, const std::string& writeCocoFootJson_, const int writeCocoJsonVariant_,
const std::string& writeImages_, const std::string& writeImagesFormat_, const std::string& writeVideo_,
const double writeVideoFps_, const std::string& writeHeatMaps_, const std::string& writeHeatMapsFormat_,
const std::string& writeVideoAdam_, const std::string& writeBvh_, const std::string& udpHost_,
const std::string& udpPort_) :
displayMode{displayMode_},
guiVerbose{guiVerbose_},
fullScreen{fullScreen_},
writeKeypoint{writeKeypoint_},
writeKeypointFormat{writeKeypointFormat_},
writeJson{writeJson_},
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册