Giter Site home page Giter Site logo

faster-rcnn-pure-c-plus-implement's Introduction

faster-rcnn-pure-c plus implement

c++ proposal layer and c++ wrapper

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

  optional ProposalParameter proposal_param = 202;
  
  
message ProposalParameter {
  optional int32 feat_stride = 1 [default = 16];
  optional int32 anchor_base_size = 2 [default = 16];
  optional int32 anchor_scale = 3 [default = 3];
  optional int32 anchor_ratio = 4 [default = 3];
  optional int32 max_rois = 5 [default = 300];
}

Next modify the test prototxt of proposal layer to C++ layer style

layer {
  name: 'proposal'
  type: 'Proposal'
  bottom: 'rpn_cls_prob_reshape'
  bottom: 'rpn_bbox_pred'
  bottom: 'im_info'
  top: 'rois'
  proposal_param {
   feat_stride: 16;
   anchor_base_size: 16;
   anchor_scale: 3;
   anchor_ratio: 3;
   max_rois: 300;
  }
}

faster-rcnn-pure-c-plus-implement's People

Contributors

manutdzou avatar

Watchers

James Cloos avatar jnulzl avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.