OpenPose  1.0.0rc2
OpenPose: A Real-Time Multi-Person Key-Point Detection And Multi-Threading C++ Library
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Macros
nmsCaffe.hpp
Go to the documentation of this file.
1 #ifdef USE_CAFFE
2 #ifndef OPENPOSE_CORE_NMS_CAFFE_HPP
3 #define OPENPOSE_CORE_NMS_CAFFE_HPP
4 
5 #include <caffe/blob.hpp>
7 
8 namespace op
9 {
10  // It mostly follows the Caffe::layer implementation, so Caffe users can easily use it. However, in order to keep the compatibility with any generic Caffe version,
11  // we keep this 'layer' inside our library rather than in the Caffe code.
12  template <typename T>
13  class OP_API NmsCaffe
14  {
15  public:
16  explicit NmsCaffe();
17 
18  virtual void LayerSetUp(const std::vector<caffe::Blob<T>*>& bottom, const std::vector<caffe::Blob<T>*>& top);
19 
20  virtual void Reshape(const std::vector<caffe::Blob<T>*>& bottom, const std::vector<caffe::Blob<T>*>& top, const int maxPeaks);
21 
22  virtual inline const char* type() const { return "Nms"; }
23 
24  void setThreshold(const T threshold);
25 
26  virtual void Forward_cpu(const std::vector<caffe::Blob<T>*>& bottom, const std::vector<caffe::Blob<T>*>& top);
27 
28  virtual void Forward_gpu(const std::vector<caffe::Blob<T>*>& bottom, const std::vector<caffe::Blob<T>*>& top);
29 
30  virtual void Backward_cpu(const std::vector<caffe::Blob<T>*>& top, const std::vector<bool>& propagate_down, const std::vector<caffe::Blob<T>*>& bottom);
31 
32  virtual void Backward_gpu(const std::vector<caffe::Blob<T>*>& top, const std::vector<bool>& propagate_down, const std::vector<caffe::Blob<T>*>& bottom);
33 
34  private:
35  T mThreshold;
36  caffe::Blob<int> mKernelBlob;
37  std::array<int, 4> mBottomSize;
38  std::array<int, 4> mTopSize;
39  };
40 }
41 
42 #endif // OPENPOSE_CORE_NMS_CAFFE_HPP
43 #endif
#define OP_API
Definition: macros.hpp:5