-
Notifications
You must be signed in to change notification settings - Fork 5.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add ROIPooling for Fast(er) R-CNN #2982
Conversation
paddle/gserver/layers/ROIPoolLayer.h
Outdated
size_t pooledHeight_; | ||
real spatialScale_; | ||
|
||
MatrixPtr maxIdxs_; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maxIdxs_
should be int matrix, but there is no int matrix in Paddle. So add comments here use the real matrix instead.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
@config_layer('roi_pool') | ||
class ROIPoolLayer(LayerBase): | ||
def __init__(self, name, inputs, pooled_width, pooled_height, | ||
spatial_scale): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
spatial_scale):
-> spatial_scale, **xargs):
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
class ROIPoolLayer(LayerBase): | ||
def __init__(self, name, inputs, pooled_width, pooled_height, | ||
spatial_scale): | ||
super(ROIPoolLayer, self).__init__(name, 'roi_pool', 0, inputs) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
inputs)
- > inputs, **xargs):
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
resetOutput(numROIs, channels_ * pooledHeight_ * pooledWidth_); | ||
MatrixPtr outputValue = getOutputValue(); | ||
|
||
if (useGpu_) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add TODO(xxx): implement on GPU later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
bottomROIs += roiOffset; | ||
} | ||
if (useGpu_) { | ||
getOutputValue()->copyFrom(*outputValue); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does the maxIdxs_
needs to output?
Add ROIPoolLayer for Fast(er) R-CNN