OpenPose
1.0.0rc2
OpenPose: A Real-Time Multi-Person Key-Point Detection And Multi-Threading C++ Library
|
#include <wrapperStructPose.hpp>
Public Member Functions | |
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 double fpsMax=-1., const bool enableGoogleLogging=true) | |
Public Attributes | |
bool | enable |
Point< int > | netInputSize |
Point< int > | outputSize |
ScaleMode | keypointScale |
int | gpuNumber |
int | gpuNumberStart |
int | scalesNumber |
float | scaleGap |
RenderMode | renderMode |
PoseModel | poseModel |
bool | blendOriginalFrame |
float | alphaKeypoint |
float | alphaHeatMap |
int | defaultPartToRender |
std::string | modelFolder |
std::vector< HeatMapType > | heatMapTypes |
ScaleMode | heatMapScale |
bool | addPartCandidates |
float | renderThreshold |
int | numberPeopleMax |
bool | maximizePositives |
double | fpsMax |
bool | enableGoogleLogging |
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.
op::WrapperStructPose::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 double | fpsMax = -1. , |
||
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.
bool op::WrapperStructPose::addPartCandidates |
Whether to add the body part candidates. Candidates refer to all the detected body parts, before being assembled into people.
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.
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.
bool op::WrapperStructPose::blendOriginalFrame |
Whether to blend the final results on top of the original image, or just render them on a flat background.
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.
bool op::WrapperStructPose::enable |
Whether to extract body. It might be optionally disabled if only face keypoint detection is required. Otherwise, it must be always true.
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.
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.
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).
int op::WrapperStructPose::gpuNumberStart |
First GPU device. Such as the GPUs used will be the ones in the range: [gpuNumberStart, gpuNumberStart + gpuNumber].
ScaleMode op::WrapperStructPose::heatMapScale |
Scale of the Datum.heatmaps. Select ScaleMode::ZeroToOne for range [0,1], ScaleMode::PlusMinusOne for [-1,1] and ScaleMode::UnsignedChar for [0, 255]. If heatMapTypes.empty(), then this parameters makes no effect.
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.
ScaleMode op::WrapperStructPose::keypointScale |
Final scale of the Array<float> Datum.poseKeypoints and the writen 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), and -1 to 1 (ScaleMode::PlusMinusOne).
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.
std::string op::WrapperStructPose::modelFolder |
Folder where the pose Caffe models are located.
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.
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.
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 keypointScale
is set to ScaleMode::OutputResolution, even if the rendering is disabled.
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..
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.
float op::WrapperStructPose::renderThreshold |
Rendering threshold. Only estimated keypoints whose score confidences are higher than this value will be rendered. 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).
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.
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.