All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
poseExtractorNet.hpp
Go to the documentation of this file.
#ifndef OPENPOSE_POSE_POSE_EXTRACTOR_NET_HPP
#define OPENPOSE_POSE_POSE_EXTRACTOR_NET_HPP
#include <atomic>
#include <openpose/core/common.hpp>
#include <openpose/core/enumClasses.hpp>
#include <openpose/pose/poseParameters.hpp>
namespace op
{
class OP_API PoseExtractorNet
{
public:
PoseExtractorNet(const PoseModel poseModel,
const std::vector<HeatMapType>& heatMapTypes = {},
const ScaleMode heatMapScale = ScaleMode::ZeroToOne,
const bool addPartCandidates = false);
virtual ~PoseExtractorNet();
void initializationOnThread();
virtual void forwardPass(const std::vector<Array<float>>& inputNetData, const Point<int>& inputDataSize,
const std::vector<double>& scaleRatios = {1.f}) = 0;
virtual const float* getCandidatesCpuConstPtr() const = 0;
virtual const float* getCandidatesGpuConstPtr() const = 0;
virtual const float* getHeatMapCpuConstPtr() const = 0;
virtual const float* getHeatMapGpuConstPtr() const = 0;
virtual std::vector<int> getHeatMapSize() const = 0;
Array<float> getHeatMapsCopy() const;
std::vector<std::vector<std::array<float,3>>> getCandidatesCopy() const;
virtual const float* getPoseGpuConstPtr() const = 0;
Array<float> getPoseKeypoints() const;
Array<float> getPoseScores() const;
float getScaleNetToOutput() const;
double get(const PoseProperty property) const;
void set(const PoseProperty property, const double value);
void increase(const PoseProperty property, const double value);
void clear();
protected:
const PoseModel mPoseModel;
Point<int> mNetOutputSize;
Array<float> mPoseKeypoints;
Array<float> mPoseScores;
float mScaleNetToOutput;
void checkThread() const;
virtual void netInitializationOnThread() = 0;
private:
const std::vector<HeatMapType> mHeatMapTypes;
const ScaleMode mHeatMapScaleMode;
const bool mAddPartCandidates;
std::array<std::atomic<double>, (int)PoseProperty::Size> mProperties;
std::thread::id mThreadId;
DELETE_COPY(PoseExtractorNet);
};
}
#endif // OPENPOSE_POSE_POSE_EXTRACTOR_NET_HPP
op::PoseExtractorNet::mPoseKeypoints
Array< float > mPoseKeypoints
Definition: poseExtractorNet.hpp:59
DELETE_COPY
#define DELETE_COPY(className)
Definition: macros.hpp:34
op::PoseExtractorNet::mNetOutputSize
Point< int > mNetOutputSize
Definition: poseExtractorNet.hpp:58
op::PoseExtractorNet::mScaleNetToOutput
float mScaleNetToOutput
Definition: poseExtractorNet.hpp:61
poseParameters.hpp
op::PoseModel
PoseModel
Definition: enumClasses.hpp:9
op::PoseProperty::Size
op::Point< int >
op::PoseExtractorNet::mPoseScores
Array< float > mPoseScores
Definition: poseExtractorNet.hpp:60
common.hpp
op::ScaleMode::ZeroToOne
op::PoseExtractorNet::mPoseModel
const PoseModel mPoseModel
Definition: poseExtractorNet.hpp:57
op::PoseProperty
PoseProperty
Definition: enumClasses.hpp:32
op::ScaleMode
ScaleMode
Definition: enumClasses.hpp:6
op::Array< float >
cl::vector
std::vector< T, Alloc > vector
Definition: cl2.hpp:567
OP_API
#define OP_API
Definition: macros.hpp:19
enumClasses.hpp
op::PoseExtractorNet
Definition: poseExtractorNet.hpp:11