OpenPose  1.7.0
The first real-time multi-person system to jointly detect human body, hand, facial, and foot keypoints
op::WrapperStructPose Struct Reference

#include <wrapperStructPose.hpp>

Public Member Functions

 WrapperStructPose (const PoseMode poseMode=PoseMode::Enabled, const Point< int > &netInputSize=Point< int >{-1, 368}, const double netInputSizeDynamicBehavior=1., const Point< int > &outputSize=Point< int >{-1, -1}, const ScaleMode keypointScaleMode=ScaleMode::InputResolution, const int gpuNumber=-1, const int gpuNumberStart=0, const int scalesNumber=1, const float scaleGap=0.25f, const RenderMode renderMode=RenderMode::Auto, 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 String &modelFolder="models/", const std::vector< HeatMapType > &heatMapTypes={}, const ScaleMode heatMapScaleMode=ScaleMode::UnsignedChar, const bool addPartCandidates=false, const float renderThreshold=0.05f, const int numberPeopleMax=-1, const bool maximizePositives=false, const double fpsMax=-1., const String &protoTxtPath="", const String &caffeModelPath="", const float upsamplingRatio=0.f, const bool enableGoogleLogging=true)
 

Public Attributes

PoseMode poseMode
 
Point< int > netInputSize
 
double netInputSizeDynamicBehavior
 
Point< int > outputSize
 
ScaleMode keypointScaleMode
 
int gpuNumber
 
int gpuNumberStart
 
int scalesNumber
 
float scaleGap
 
RenderMode renderMode
 
PoseModel poseModel
 
bool blendOriginalFrame
 
float alphaKeypoint
 
float alphaHeatMap
 
int defaultPartToRender
 
String modelFolder
 
std::vector< HeatMapTypeheatMapTypes
 
ScaleMode heatMapScaleMode
 
bool addPartCandidates
 
float renderThreshold
 
int numberPeopleMax
 
bool maximizePositives
 
double fpsMax
 
String protoTxtPath
 
String caffeModelPath
 
float upsamplingRatio
 
bool enableGoogleLogging
 

Detailed Description

WrapperStructPose: Pose estimation and rendering configuration struct. WrapperStructPose allows the user to set up the pose estimation and rendering parameters that will be used for the OpenPose WrapperT template and Wrapper class.

Definition at line 18 of file wrapperStructPose.hpp.

Constructor & Destructor Documentation

◆ WrapperStructPose()

op::WrapperStructPose::WrapperStructPose ( const PoseMode  poseMode = PoseMode::Enabled,
const Point< int > &  netInputSize = Point< int >{-1, 368},
const double  netInputSizeDynamicBehavior = 1.,
const Point< int > &  outputSize = Point< int >{-1, -1},
const ScaleMode  keypointScaleMode = ScaleMode::InputResolution,
const int  gpuNumber = -1,
const int  gpuNumberStart = 0,
const int  scalesNumber = 1,
const float  scaleGap = 0.25f,
const RenderMode  renderMode = RenderMode::Auto,
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 String modelFolder = "models/",
const std::vector< HeatMapType > &  heatMapTypes = {},
const ScaleMode  heatMapScaleMode = ScaleMode::UnsignedChar,
const bool  addPartCandidates = false,
const float  renderThreshold = 0.05f,
const int  numberPeopleMax = -1,
const bool  maximizePositives = false,
const double  fpsMax = -1.,
const String protoTxtPath = "",
const String caffeModelPath = "",
const float  upsamplingRatio = 0.f,
const bool  enableGoogleLogging = true 
)

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.

Member Data Documentation

◆ addPartCandidates

bool op::WrapperStructPose::addPartCandidates

Whether to add the body part candidates. Candidates refer to all the detected body parts, before being assembled into people.

Definition at line 151 of file wrapperStructPose.hpp.

◆ alphaHeatMap

float op::WrapperStructPose::alphaHeatMap

Rendering blending alpha value of the heat maps (body part, background or PAF) with respect to the background image. Value in the range [0, 1]. 0 will only render the background, 1 will only render the heat map.

Definition at line 116 of file wrapperStructPose.hpp.

◆ alphaKeypoint

float op::WrapperStructPose::alphaKeypoint

Rendering blending alpha value of the pose point locations with respect to the background image. Value in the range [0, 1]. 0 will only render the background, 1 will fully render the pose.

Definition at line 109 of file wrapperStructPose.hpp.

◆ blendOriginalFrame

bool op::WrapperStructPose::blendOriginalFrame

Whether to blend the final results on top of the original image, or just render them on a flat background.

Definition at line 103 of file wrapperStructPose.hpp.

◆ caffeModelPath

String op::WrapperStructPose::caffeModelPath

Final path where the pose Caffe CaffeModel is located. The combination modelFolder + caffeModelPath represents the whole path to the caffemodel file. If empty, it will use the default OpenPose CaffeModel file.

Definition at line 199 of file wrapperStructPose.hpp.

◆ defaultPartToRender

int op::WrapperStructPose::defaultPartToRender

Element to initially render. Set 0 for pose, [1, #body parts] for each body part following the order on POSE_BODY_PART_MAPPING on include/pose/poseParameters.hpp, #body parts+1 for background, #body parts+2 for all body parts overlapped, #body parts+3 for all PAFs, and [#body parts+4, #body parts+4+#pair pairs] for each PAF following the order on POSE_BODY_PART_PAIRS.

Definition at line 125 of file wrapperStructPose.hpp.

◆ enableGoogleLogging

bool op::WrapperStructPose::enableGoogleLogging

Whether to internally enable Google Logging. This option is only applicable if Caffe is used. Only disable it if the user is already calling google::InitGoogleLogging() in his code. If the user disables Google Logging and he does not call it by himself, then Caffe will start to pop up all the verbose messages.

Definition at line 214 of file wrapperStructPose.hpp.

◆ fpsMax

double op::WrapperStructPose::fpsMax

Maximum processing frame rate. By default (-1), OpenPose will process frames as fast as possible. Example usage: If OpenPose is displaying images too quickly, this can reduce the speed so the user can analyze better each frame from the GUI.

Definition at line 185 of file wrapperStructPose.hpp.

◆ gpuNumber

int op::WrapperStructPose::gpuNumber

Number of GPUs processing in parallel. The greater, the faster the algorithm will run, but potentially higher lag will appear (which only affects in real-time webcam scenarios).

Definition at line 64 of file wrapperStructPose.hpp.

◆ gpuNumberStart

int op::WrapperStructPose::gpuNumberStart

First GPU device. Such as the GPUs used will be the ones in the range: [gpuNumberStart, gpuNumberStart + gpuNumber].

Definition at line 70 of file wrapperStructPose.hpp.

◆ heatMapScaleMode

ScaleMode op::WrapperStructPose::heatMapScaleMode

Scale of the Datum.heatmaps. Select ScaleMode::ZeroToOne(FixedAspect) for range [0,1], ScaleMode::PlusMinusOne(FixedAspect) for [-1,1] and ScaleMode::UnsignedChar for [0, 255]. If heatMapTypes.empty(), then this parameters makes no effect.

Definition at line 145 of file wrapperStructPose.hpp.

◆ heatMapTypes

std::vector<HeatMapType> op::WrapperStructPose::heatMapTypes

Whether and which heat maps to save on the Array<float> Datum.heatmaps. Use HeatMapType::Parts for body parts, HeatMapType::Background for the background, and HeatMapType::PAFs for the Part Affinity Fields.

Definition at line 137 of file wrapperStructPose.hpp.

◆ keypointScaleMode

ScaleMode op::WrapperStructPose::keypointScaleMode

Final scale of the Array<float> Datum.poseKeypoints and the written pose data. The final Datum.poseKeypoints can be scaled with respect to input size (ScaleMode::InputResolution), net output size (ScaleMode::NetOutputResolution), output rendering size (ScaleMode::OutputResolution), from 0 to 1 (ScaleMode::ZeroToOne(FixedAspect)), and -1 to 1 (ScaleMode::PlusMinusOne(FixedAspect)).

Definition at line 57 of file wrapperStructPose.hpp.

◆ maximizePositives

bool op::WrapperStructPose::maximizePositives

Whether to maximize the number of positives. It reduces the thresholds to accept a person candidate. It highly increases both false and true positives. I.e., it maximizes average recall but could harm average precision.

Definition at line 177 of file wrapperStructPose.hpp.

◆ modelFolder

String op::WrapperStructPose::modelFolder

Folder where the pose Caffe models are located.

Definition at line 130 of file wrapperStructPose.hpp.

◆ netInputSize

Point<int> op::WrapperStructPose::netInputSize

CCN (Conv Net) input size. The greater, the slower and more memory it will be needed, but it will potentially increase accuracy. Both width and height must be divisible by 16.

Definition at line 32 of file wrapperStructPose.hpp.

◆ netInputSizeDynamicBehavior

double op::WrapperStructPose::netInputSizeDynamicBehavior

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).

Definition at line 41 of file wrapperStructPose.hpp.

◆ numberPeopleMax

int op::WrapperStructPose::numberPeopleMax

Maximum number of people to be detected. This parameter will limit the maximum number of people detected, by keeping the people with the numberPeopleMax top scores. Useful if you know the exact number of people in the scene, so it can remove false positives (if all the people have been detected. However, it might also include false negatives by removing very small or highly occluded people.

Definition at line 170 of file wrapperStructPose.hpp.

◆ outputSize

Point<int> op::WrapperStructPose::outputSize

Output size of the final rendered image. It barely affects performance compared to netInputSize. The final Datum.poseKeypoints can be scaled with respect to outputSize if keypointScaleMode is set to ScaleMode::OutputResolution, even if the rendering is disabled.

Definition at line 49 of file wrapperStructPose.hpp.

◆ poseMode

PoseMode op::WrapperStructPose::poseMode

Whether to extract body. It might be optionally disabled for very few cases (e.g., if only face keypoint detection is desired for speedup while reducing its accuracy). Otherwise, it must be always enabled.

Definition at line 25 of file wrapperStructPose.hpp.

◆ poseModel

PoseModel op::WrapperStructPose::poseModel

Pose model, it affects the number of body parts to render Select PoseModel::BODY_25 for 25 body-part COCO + foot model; PoseModel::COCO_18 for 18 body-part COCO; PoseModel::MPI_15 for 15 body-part MPI; PoseModel::MPI_15_4 for faster version of MPI; etc..

Definition at line 98 of file wrapperStructPose.hpp.

◆ protoTxtPath

String op::WrapperStructPose::protoTxtPath

Final path where the pose Caffe ProtoTxt file is located. The combination modelFolder + protoTxtPath represents the whole path to the prototxt file. If empty, it will use the default OpenPose ProtoTxt file.

Definition at line 192 of file wrapperStructPose.hpp.

◆ renderMode

RenderMode op::WrapperStructPose::renderMode

Whether to render the output (pose locations, body, background or PAF heat maps) with CPU or GPU. Select None for no rendering, Cpu or Gpu por CPU and GPU rendering respectively.

Definition at line 91 of file wrapperStructPose.hpp.

◆ renderThreshold

float op::WrapperStructPose::renderThreshold

Rendering threshold. Only estimated keypoints whose score confidences are higher than this value will be rendered. Note: Rendered refers only to visual display in the OpenPose basic GUI, not in the saved results. Generally, a high threshold (> 0.5) will only render very clear body parts; while small thresholds (~0.1) will also output guessed and occluded keypoints, but also more false positives (i.e., wrong detections).

Definition at line 160 of file wrapperStructPose.hpp.

◆ scaleGap

float op::WrapperStructPose::scaleGap

Gap between successive scales. The pose estimation will be estimation for the scales in the range [1, 1-scaleGap*scalesNumber], with a gap of scaleGap.

Definition at line 85 of file wrapperStructPose.hpp.

◆ scalesNumber

int op::WrapperStructPose::scalesNumber

Number of scales to process. The greater, the slower and more memory it will be needed, but it will potentially increase accuracy. This parameter is related with scaleGap, such as the final pose estimation will be an average of the predicted results for each scale.

Definition at line 78 of file wrapperStructPose.hpp.

◆ upsamplingRatio

float op::WrapperStructPose::upsamplingRatio

The image upsampling scale. 8 is the stride of the network, so the ideal value to maximize the speed/accuracy trade-off.

Definition at line 205 of file wrapperStructPose.hpp.


The documentation for this struct was generated from the following file: