-
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 roi pool #35084
Add roi pool #35084
Conversation
Thanks for your contribution! |
84aaf42
to
ea0b5c4
Compare
self.boxes = boxes.astype('float32') | ||
self.boxes_num = np.array([3], dtype=np.int32) | ||
|
||
def roi_pool_functional(self, output_size): |
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.
结论正确性,可以 复用
def calc_roi_pool(self): |
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.
好的 正确性在test_value里 有验证具体计算的结果
python/paddle/vision/ops.py
Outdated
2D-Tensor or 2D-LoDTensor with the shape of [num_boxes,4], the lod level is 1. | ||
Given as [[x1, y1, x2, y2], ...], (x1, y1) is the top left coordinates, | ||
and (x2, y2) is the bottom right coordinates. | ||
boxes_num (Tensor): The number of RoIs in each image. Default: None |
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.
这里需要说明下 boxes_num是整形, 以及支持的dtype
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
python/paddle/vision/ops.py
Outdated
boxes[:, 2] += boxes[:, 0] + 3 | ||
boxes[:, 3] += boxes[:, 1] + 4 | ||
boxes_num = paddle.to_tensor([3]).astype('int32') | ||
roi_pool_c = RoIPool(output_size=(4, 3)) |
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.
名字简短一些,roi_pool就行,去掉后面_c
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
f150be2
to
06b488b
Compare
2e87ef2
to
4b48538
Compare
4b48538
to
9ab50ef
Compare
9ab50ef
to
1685f7c
Compare
1685f7c
to
26c07f4
Compare
2. Finding the largest value in each section; | ||
3. Copying these max values to the output buffer. | ||
For more information, please refer to https://stackoverflow.com/questions/43430056/what-is-roi-layer-in-fast-rcnn | ||
Args: |
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.
Args 前有个空行
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
python/paddle/vision/ops.py
Outdated
2D-Tensor or 2D-LoDTensor with the shape of [num_boxes,4], the lod level is 1. | ||
Given as [[x1, y1, x2, y2], ...], (x1, y1) is the top left coordinates, | ||
and (x2, y2) is the bottom right coordinates. | ||
boxes_num (Tensor): The number of RoIs in each image. Default: None |
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.
没有 Default: None
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
|
||
Examples: | ||
.. code-block:: python | ||
import paddle |
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.
import paddle 前要加一行空行
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
2. Finding the largest value in each section; | ||
3. Copying these max values to the output buffer. | ||
For more information, please refer to https://stackoverflow.com/questions/43430056/what-is-roi-layer-in-fast-rcnn | ||
Args: |
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.
Args: 前加个空行
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
|
||
Examples: | ||
.. code-block:: python | ||
import paddle |
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.
import paddle 前有个空行
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
Args: | ||
output_size (int or tuple[int, int]): The pooled output size(h, w), data type is int32. If int, h and w are both equal to output_size. | ||
spatial_scale (float, optional): Multiplicative spatial scale factor to translate ROI coords from their input scale to the scale used when pooling. Default: 1.0 | ||
Returns: |
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.
Returns 前有个空行
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
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.
输入名称建议用x,对齐avd_pool和conv2d
done |
763f82b
to
1917c13
Compare
541813e
to
8890a26
Compare
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.
LGTM
8890a26
to
164a7ad
Compare
164a7ad
to
ec15acc
Compare
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.
LGTM
* add roi pool * rename input as x
* add roi pool * rename input as x
PR types
New features
PR changes
OPs
Describe
roi pool
RoIPool
cn docs add roi pool cn docs docs#3887
roi pool cn doc
RoIPool cn doc
roi pool en doc
RoIPool en doc