| #ifndef OPENPOSE_NET_NMS_CAFFE_HPP |
| #define OPENPOSE_NET_NMS_CAFFE_HPP |
|
|
| #include <openpose/core/common.hpp> |
|
|
| namespace op |
| { |
| |
| |
| |
| template <typename T> |
| class NmsCaffe |
| { |
| public: |
| explicit NmsCaffe(); |
|
|
| virtual ~NmsCaffe(); |
|
|
| virtual void LayerSetUp(const std::vector<ArrayCpuGpu<T>*>& bottom, const std::vector<ArrayCpuGpu<T>*>& top); |
|
|
| virtual void Reshape(const std::vector<ArrayCpuGpu<T>*>& bottom, const std::vector<ArrayCpuGpu<T>*>& top, |
| const int maxPeaks, const int outputChannels = -1, const int gpuID = 0); |
|
|
| virtual inline const char* type() const { return "Nms"; } |
|
|
| void setThreshold(const T threshold); |
|
|
| |
| void setOffset(const Point<T>& offset); |
|
|
| virtual void Forward(const std::vector<ArrayCpuGpu<T>*>& bottom, const std::vector<ArrayCpuGpu<T>*>& top); |
|
|
| virtual void Forward_cpu(const std::vector<ArrayCpuGpu<T>*>& bottom, const std::vector<ArrayCpuGpu<T>*>& top); |
|
|
| virtual void Forward_gpu(const std::vector<ArrayCpuGpu<T>*>& bottom, const std::vector<ArrayCpuGpu<T>*>& top); |
|
|
| virtual void Forward_ocl(const std::vector<ArrayCpuGpu<T>*>& bottom, const std::vector<ArrayCpuGpu<T>*>& top); |
|
|
| virtual void Backward_cpu(const std::vector<ArrayCpuGpu<T>*>& top, const std::vector<bool>& propagate_down, |
| const std::vector<ArrayCpuGpu<T>*>& bottom); |
|
|
| virtual void Backward_gpu(const std::vector<ArrayCpuGpu<T>*>& top, const std::vector<bool>& propagate_down, |
| const std::vector<ArrayCpuGpu<T>*>& bottom); |
|
|
| private: |
| T mThreshold; |
| Point<T> mOffset; |
| int mGpuID; |
|
|
| |
| |
| struct ImplNmsCaffe; |
| std::unique_ptr<ImplNmsCaffe> upImpl; |
|
|
| |
| |
| DELETE_COPY(NmsCaffe); |
| }; |
| } |
|
|
| #endif |
|
|