This project is based on the official caffe implement. In this project we transform the py-faster-rcnn to pure C++ code style.
The proposal layer in faster rcnn is rewritten in C++, and the test wrapper is transformed to C++ too.
Add the Roipooling layer and Smooth_L1_loss_layer
copy the roi_pooling_layer.hpp and smooth_L1_loss_layer.hpp from the py-faster-rcnn to the official caffe branch caffe/include/caffe/layers/, then copy the roi_pooling_layer.c* and smooth_L1_loss_layer.c* to caffe/src/caffe/layers/
add the proto information of roi_pooling_layer and smooth_L1_loss_layer like
optional ROIPoolingParameter roi_pooling_param = 200;
optional SmoothL1LossParameter smooth_l1_loss_param = 201;
// Message that stores parameters used by ROIPoolingLayer
message ROIPoolingParameter {
// Pad, kernel size, and stride are all given as a single value for equal
// dimensions in height and width or as Y, X pairs.
optional uint32 pooled_h = 1 [default = 0]; // The pooled output height
optional uint32 pooled_w = 2 [default = 0]; // The pooled output width
// Multiplicative spatial scale factor to translate ROI coords from their
// input scale to the scale used when pooling
optional float spatial_scale = 3 [default = 1];
}
message SmoothL1LossParameter {
// SmoothL1Loss(x) =
// 0.5 * (sigma * x) ** 2 -- if x < 1.0 / sigma / sigma
// |x| - 0.5 / sigma / sigma -- otherwise
optional float sigma = 1 [default = 1];
}
Then add the proposal layer with C++ implement and proto information like