1 #ifndef CAFFE_SPP_LAYER_HPP_ 2 #define CAFFE_SPP_LAYER_HPP_ 6 #include "caffe/blob.hpp" 7 #include "caffe/layer.hpp" 8 #include "caffe/proto/caffe.pb.h" 18 template <
typename Dtype>
21 explicit SPPLayer(
const LayerParameter& param)
28 virtual inline const char*
type()
const {
return "SPP"; }
36 const vector<bool>& propagate_down,
const vector<
Blob<Dtype>*>& bottom);
39 virtual LayerParameter GetPoolingParam(
const int pyramid_level,
40 const int bottom_h,
const int bottom_w,
const SPPParameter spp_param);
43 int bottom_h_, bottom_w_;
46 int kernel_h_, kernel_w_;
48 bool reshaped_first_time_;
76 #endif // CAFFE_SPP_LAYER_HPP_ An interface for the units of computation which can be composed into a Net.
Definition: layer.hpp:33
A layer factory that allows one to register layers. During runtime, registered layers can be called b...
Definition: blob.hpp:14
virtual void Backward_cpu(const vector< Blob< Dtype > *> &top, const vector< bool > &propagate_down, const vector< Blob< Dtype > *> &bottom)
Using the CPU device, compute the gradients for any parameters and for the bottom blobs if propagate_...
Definition: spp_layer.cpp:205
vector< shared_ptr< PoolingLayer< Dtype > > > pooling_layers_
the internal Pooling layers of different kernel sizes
Definition: spp_layer.hpp:57
virtual void Forward_cpu(const vector< Blob< Dtype > *> &bottom, const vector< Blob< Dtype > *> &top)
Using the CPU device, compute the layer output.
Definition: spp_layer.cpp:188
vector< vector< Blob< Dtype > * > * > flatten_top_vecs_
top vector holders used in call to the underlying FlattenLayer::Forward
Definition: spp_layer.hpp:65
vector< vector< Blob< Dtype > * > * > pooling_top_vecs_
top vector holders used in call to the underlying PoolingLayer::Forward
Definition: spp_layer.hpp:59
vector< Blob< Dtype > * > split_top_vec_
top vector holder used in call to the underlying SplitLayer::Forward
Definition: spp_layer.hpp:53
Does spatial pyramid pooling on the input image by taking the max, average, etc. within regions so th...
Definition: spp_layer.hpp:19
virtual const char * type() const
Returns the layer type.
Definition: spp_layer.hpp:28
vector< vector< Blob< Dtype > * > * > pooling_bottom_vecs_
bottom vector holder used in call to the underlying PoolingLayer::Forward
Definition: spp_layer.hpp:55
vector< Blob< Dtype > * > concat_bottom_vec_
bottom vector holder used in call to the underlying ConcatLayer::Forward
Definition: spp_layer.hpp:69
vector< FlattenLayer< Dtype > * > flatten_layers_
the internal Flatten layers that the Pooling layers feed into
Definition: spp_layer.hpp:63
vector< Blob< Dtype > * > flatten_outputs_
flatten_outputs stores the outputs of the FlattenLayers
Definition: spp_layer.hpp:67
virtual void LayerSetUp(const vector< Blob< Dtype > *> &bottom, const vector< Blob< Dtype > *> &top)
Does layer-specific setup: your layer should implement this function as well as Reshape.
Definition: spp_layer.cpp:65
virtual void Reshape(const vector< Blob< Dtype > *> &bottom, const vector< Blob< Dtype > *> &top)
Adjust the shapes of top blobs and internal buffers to accommodate the shapes of the bottom blobs...
Definition: spp_layer.cpp:146
virtual int ExactNumTopBlobs() const
Returns the exact number of top blobs required by the layer, or -1 if no exact number is required...
Definition: spp_layer.hpp:30
shared_ptr< ConcatLayer< Dtype > > concat_layer_
the internal Concat layers that the Flatten layers feed into
Definition: spp_layer.hpp:71
shared_ptr< SplitLayer< Dtype > > split_layer_
the internal Split layer that feeds the pooling layers
Definition: spp_layer.hpp:51
virtual int ExactNumBottomBlobs() const
Returns the exact number of bottom blobs required by the layer, or -1 if no exact number is required...
Definition: spp_layer.hpp:29
vector< Blob< Dtype > * > pooling_outputs_
pooling_outputs stores the outputs of the PoolingLayers
Definition: spp_layer.hpp:61
A wrapper around SyncedMemory holders serving as the basic computational unit through which Layers...
Definition: blob.hpp:24