You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mxnet.apache.org by GitBox <gi...@apache.org> on 2018/03/02 03:43:01 UTC
[GitHub] pengzhao-intel commented on a change in pull request #9939: add multi proposal operator (cpu version) and fix the bug in proposal op (gpu version)
pengzhao-intel commented on a change in pull request #9939: add multi proposal operator (cpu version) and fix the bug in proposal op (gpu version)
URL: https://github.com/apache/incubator-mxnet/pull/9939#discussion_r171758785
##########
File path: src/operator/contrib/multi_proposal.cc
##########
@@ -22,11 +22,253 @@
* Licensed under The Apache-2.0 License [see LICENSE for details]
* \file multi_proposal.cc
* \brief
- * \author Xizhou Zhu
+ * \author Xizhou Zhu, Kan Wu
*/
#include "./multi_proposal-inl.h"
+//============================
+// Bounding Box Transform Utils
+//============================
+namespace mxnet {
+namespace op {
+namespace utils {
+
+// bbox prediction and clip to the image borders
+inline void BBoxTransformInv(const mshadow::Tensor<cpu, 2>& boxes,
+ const mshadow::Tensor<cpu, 3>& deltas,
+ const float im_height,
+ const float im_width,
+ const int real_height,
+ const int real_width,
+ mshadow::Tensor<cpu, 2> *out_pred_boxes) {
+ CHECK_GE(boxes.size(1), 4);
+ CHECK_GE(out_pred_boxes->size(1), 4);
+ int anchors = deltas.size(0) / 4;
+ int heights = deltas.size(1);
+ int widths = deltas.size(2);
+
+ for (int a = 0; a < anchors; ++a) {
+ for (int h = 0; h < heights; ++h) {
+ for (int w = 0; w < widths; ++w) {
Review comment:
Is it possible to parallel the for-loop by OMP?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services