OpenPose  1.7.0
The first real-time multi-person system to jointly detect human body, hand, facial, and foot keypoints
handExtractorNet.hpp
Go to the documentation of this file.
1 #ifndef OPENPOSE_HAND_HAND_EXTRACTOR_HPP
2 #define OPENPOSE_HAND_HAND_EXTRACTOR_HPP
3 
4 #include <atomic>
7 
8 namespace op
9 {
14  {
15  public:
24  explicit HandExtractorNet(const Point<int>& netInputSize, const Point<int>& netOutputSize,
25  const int numberScales = 1, const float rangeScales = 0.4f,
26  const std::vector<HeatMapType>& heatMapTypes = {},
27  const ScaleMode heatMapScaleMode = ScaleMode::ZeroToOneFixedAspect);
28 
33  virtual ~HandExtractorNet();
34 
40 
50  virtual void forwardPass(const std::vector<std::array<Rectangle<float>, 2>> handRectangles,
51  const Matrix& cvInputData) = 0;
52 
53  std::array<Array<float>, 2> getHeatMaps() const;
54 
62  std::array<Array<float>, 2> getHandKeypoints() const;
63 
64  bool getEnabled() const;
65 
66  void setEnabled(const bool enabled);
67 
68  protected:
69  const std::pair<int, float> mMultiScaleNumberAndRange;
72  std::array<Array<float>, 2> mHandKeypoints;
73  // HeatMaps parameters
75  const std::vector<HeatMapType> mHeatMapTypes;
76  std::array<Array<float>, 2> mHeatMaps;
77  // Temporarily disable it
78  std::atomic<bool> mEnabled;
79 
80  virtual void netInitializationOnThread() = 0;
81 
82  private:
83  // Init with thread
84  std::thread::id mThreadId;
85 
86  void checkThread() const;
87 
89  };
90 }
91 
92 #endif // OPENPOSE_HAND_HAND_EXTRACTOR_HPP
Array< float > mHandImageCrop
virtual void forwardPass(const std::vector< std::array< Rectangle< float >, 2 >> handRectangles, const Matrix &cvInputData)=0
const std::pair< int, float > mMultiScaleNumberAndRange
std::atomic< bool > mEnabled
virtual ~HandExtractorNet()
std::array< Array< float >, 2 > mHeatMaps
std::array< Array< float >, 2 > mHandKeypoints
std::array< Array< float >, 2 > getHeatMaps() const
HandExtractorNet(const Point< int > &netInputSize, const Point< int > &netOutputSize, const int numberScales=1, const float rangeScales=0.4f, const std::vector< HeatMapType > &heatMapTypes={}, const ScaleMode heatMapScaleMode=ScaleMode::ZeroToOneFixedAspect)
virtual void netInitializationOnThread()=0
const std::vector< HeatMapType > mHeatMapTypes
void setEnabled(const bool enabled)
const Point< int > mNetOutputSize
std::array< Array< float >, 2 > getHandKeypoints() const
const ScaleMode mHeatMapScaleMode
bool getEnabled() const
#define OP_API
Definition: macros.hpp:18
#define DELETE_COPY(className)
Definition: macros.hpp:32
ScaleMode
Definition: enumClasses.hpp:7