diff options
author | SiCong Li <sicong.li@arm.com> | 2017-09-12 19:06:28 +0100 |
---|---|---|
committer | Anthony Barbier <anthony.barbier@arm.com> | 2018-11-02 16:35:24 +0000 |
commit | cfb6553e6114fd84e1972b1a5c5cc42784996333 (patch) | |
tree | 8932e23781591c9999613f16ec3b34a2d3890517 /src/core/NEON | |
parent | 5b61fd3fbaf41031232296abde56258d12ba3340 (diff) | |
download | ComputeLibrary-cfb6553e6114fd84e1972b1a5c5cc42784996333.tar.gz |
COMPMID-417 Fix ROIPooling
* Fix ROIPooling in NEON, CL and Reference.
Change-Id: Id5066625e5073e0bfebe69391f7941e993003296
Reviewed-on: http://mpd-gerrit.cambridge.arm.com/87435
Reviewed-by: Moritz Pflanzer <moritz.pflanzer@arm.com>
Tested-by: Kaizen <jeremy.johnson+kaizengerrit@arm.com>
Reviewed-by: Georgios Pinitas <georgios.pinitas@arm.com>
Reviewed-by: Anthony Barbier <anthony.barbier@arm.com>
Diffstat (limited to 'src/core/NEON')
-rw-r--r-- | src/core/NEON/kernels/NEROIPoolingLayerKernel.cpp | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/src/core/NEON/kernels/NEROIPoolingLayerKernel.cpp b/src/core/NEON/kernels/NEROIPoolingLayerKernel.cpp index 83ab611b67..a209a523d3 100644 --- a/src/core/NEON/kernels/NEROIPoolingLayerKernel.cpp +++ b/src/core/NEON/kernels/NEROIPoolingLayerKernel.cpp @@ -105,10 +105,6 @@ void NEROIPoolingLayerKernel::run(const Window &window, const ThreadInfo &info) const int roi_width = std::max(support::cpp11::round(curr_roi.rect.width * spatial_scale), 1.f); const int roi_height = std::max(support::cpp11::round(curr_roi.rect.height * spatial_scale), 1.f); - // Determine pooling regions - const auto pool_region_size_x = static_cast<float>(roi_width) / pooled_w; - const auto pool_region_size_y = static_cast<float>(roi_height) / pooled_h; - // Iterate through all feature maps for(int fm = 0; fm < fms; ++fm) { @@ -117,10 +113,10 @@ void NEROIPoolingLayerKernel::run(const Window &window, const ThreadInfo &info) { for(int px = 0; px < pooled_w; ++px) { - auto region_start_x = static_cast<int>(std::floor(px * pool_region_size_x)); - auto region_end_x = static_cast<int>(std::ceil((px + 1) * pool_region_size_x)); - auto region_start_y = static_cast<int>(std::floor(py * pool_region_size_y)); - auto region_end_y = static_cast<int>(std::ceil((py + 1) * pool_region_size_y)); + auto region_start_x = static_cast<int>(std::floor((static_cast<float>(px) / pooled_w) * roi_width)); + auto region_end_x = static_cast<int>(std::floor((static_cast<float>(px + 1) / pooled_w) * roi_width)); + auto region_start_y = static_cast<int>(std::floor((static_cast<float>(py) / pooled_h) * roi_height)); + auto region_end_y = static_cast<int>(std::floor((static_cast<float>(py + 1) / pooled_h) * roi_height)); region_start_x = std::min(std::max(region_start_x + roi_anchor_x, 0), width); region_end_x = std::min(std::max(region_end_x + roi_anchor_x, 0), width); |