OpenPose 1.0.0rc2 OpenPose: A Real-Time Multi-Person Key-Point Detection And Multi-Threading C++ Library

- Main Page
- Namespaces
- Classes
- Files

- File List
- File Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
resizeAndMergeCaffe.hpp
Go to the documentation of this file.
1 #ifndef OPENPOSE_NET_RESIZE_AND_MERGE_CAFFE_HPP
2 #define OPENPOSE_NET_RESIZE_AND_MERGE_CAFFE_HPP
3
4 #include <openpose/core/common.hpp>
5
6 namespace op
7 {
8 // It mostly follows the Caffe::layer implementation, so Caffe users can easily use it. However, in order to keep
9 // the compatibility with any generic Caffe version, we keep this 'layer' inside our library rather than in the
10 // Caffe code.
11 template <typename T>
12 class ResizeAndMergeCaffe
13 {
14 public:
15 explicit ResizeAndMergeCaffe();
16
17 virtual ~ResizeAndMergeCaffe();
18
19 virtual void LayerSetUp(const std::vector<caffe::Blob<T>*>& bottom, const std::vector<caffe::Blob<T>*>& top);
20
21 virtual void Reshape(const std::vector<caffe::Blob<T>*>& bottom, const std::vector<caffe::Blob<T>*>& top,
22 const T netFactor, const T scaleFactor, const bool mergeFirstDimension = true,
23 const int gpuID = 0);
24
25 virtual inline const char* type() const { return "ResizeAndMerge"; }
26
27 void setScaleRatios(const std::vector<T>& scaleRatios);
28
29 virtual void Forward(const std::vector<caffe::Blob<T>*>& bottom, const std::vector<caffe::Blob<T>*>& top);
30
31 virtual void Forward_cpu(const std::vector<caffe::Blob<T>*>& bottom, const std::vector<caffe::Blob<T>*>& top);
32
33 virtual void Forward_gpu(const std::vector<caffe::Blob<T>*>& bottom, const std::vector<caffe::Blob<T>*>& top);
34
35 virtual void Forward_ocl(const std::vector<caffe::Blob<T>*>& bottom, const std::vector<caffe::Blob<T>*>& top);
36
37 virtual void Backward_cpu(const std::vector<caffe::Blob<T>*>& top, const std::vector<bool>& propagate_down,
38 const std::vector<caffe::Blob<T>*>& bottom);
39
40 virtual void Backward_gpu(const std::vector<caffe::Blob<T>*>& top, const std::vector<bool>& propagate_down,
41 const std::vector<caffe::Blob<T>*>& bottom);
42
43 private:
44 std::vector<T*> mTempGPUData;
45 std::vector<T> mScaleRatios;
46 std::vector<std::array<int, 4>> mBottomSizes;
47 std::array<int, 4> mTopSize;
48 int mGpuID;
49
50 DELETE_COPY(ResizeAndMergeCaffe);
51 };
52 }
53
54 #endif // OPENPOSE_NET_RESIZE_AND_MERGE_CAFFE_HPP
op::ResizeAndMergeCaffe::setScaleRatios
void setScaleRatios(const std::vector< T > &scaleRatios)
op::ResizeAndMergeCaffe::Backward_gpu
virtual void Backward_gpu(const std::vector< caffe::Blob< T > * > &top, const std::vector< bool > &propagate_down, const std::vector< caffe::Blob< T > * > &bottom)
op::ResizeAndMergeCaffe::~ResizeAndMergeCaffe
virtual ~ResizeAndMergeCaffe()
op::ResizeAndMergeCaffe::Forward_cpu
virtual void Forward_cpu(const std::vector< caffe::Blob< T > * > &bottom, const std::vector< caffe::Blob< T > * > &top)
op::ResizeAndMergeCaffe
Definition: resizeAndMergeCaffe.hpp:12
common.hpp
op::ResizeAndMergeCaffe::Reshape
virtual void Reshape(const std::vector< caffe::Blob< T > * > &bottom, const std::vector< caffe::Blob< T > * > &top, const T netFactor, const T scaleFactor, const bool mergeFirstDimension=true, const int gpuID=0)
op::ResizeAndMergeCaffe::type
virtual const char * type() const
Definition: resizeAndMergeCaffe.hpp:25
op::ResizeAndMergeCaffe::Forward_ocl
virtual void Forward_ocl(const std::vector< caffe::Blob< T > * > &bottom, const std::vector< caffe::Blob< T > * > &top)
caffe::Blob
Definition: macros.hpp:81
op::ResizeAndMergeCaffe::ResizeAndMergeCaffe
ResizeAndMergeCaffe()
op::ResizeAndMergeCaffe::Backward_cpu
virtual void Backward_cpu(const std::vector< caffe::Blob< T > * > &top, const std::vector< bool > &propagate_down, const std::vector< caffe::Blob< T > * > &bottom)
op::ResizeAndMergeCaffe::LayerSetUp
virtual void LayerSetUp(const std::vector< caffe::Blob< T > * > &bottom, const std::vector< caffe::Blob< T > * > &top)
cl::vector
std::vector< T, Alloc > vector
Definition: cl2.hpp:567
op::ResizeAndMergeCaffe::Forward_gpu
virtual void Forward_gpu(const std::vector< caffe::Blob< T > * > &bottom, const std::vector< caffe::Blob< T > * > &top)
op::ResizeAndMergeCaffe::Forward
virtual void Forward(const std::vector< caffe::Blob< T > * > &bottom, const std::vector< caffe::Blob< T > * > &top)