[CPU] ROIPooling with 1x1 pooled shape in bilinear mode fixed (#4020)

This commit is contained in:
Yury Gaydaychuk 2021-01-29 15:09:39 +03:00 committed by GitHub
parent 4b64c64c62
commit 7500bbd3b1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 7 deletions

View File

@ -491,11 +491,13 @@ void MKLDNNROIPoolingNode::execute(mkldnn::stream strm) {
float roi_end_w_ = src_roi_ptr[3];
float roi_end_h_ = src_roi_ptr[4];
float height_scale = ((roi_end_h_ - roi_start_h_) * (jpp.ih - 1)) / (jpp.pooled_h - 1);
float width_scale = ((roi_end_w_ - roi_start_w_) * (jpp.iw - 1)) / (jpp.pooled_w - 1);
float height_scale = (jpp.pooled_h > 1 ? ((roi_end_h_ - roi_start_h_) * (jpp.ih - 1)) / (jpp.pooled_h - 1) : 0);
float width_scale = (jpp.pooled_w > 1 ? ((roi_end_w_ - roi_start_w_) * (jpp.iw - 1)) / (jpp.pooled_w - 1) : 0);
float in_y = (oh * height_scale + roi_start_h_ * (jpp.ih - 1));
float in_x = (ow * width_scale + roi_start_w_ * (jpp.iw - 1));
float in_y = (jpp.pooled_h > 1 ? (oh * height_scale + roi_start_h_ * (jpp.ih - 1)) :
0.5 * (roi_start_h_ + roi_end_h_) * (jpp.ih - 1));
float in_x = (jpp.pooled_w > 1 ? (ow * width_scale + roi_start_w_ * (jpp.iw - 1)) :
0.5 * (roi_start_w_ + roi_end_w_) * (jpp.iw - 1));
if (in_y < 0 || in_y > jpp.ih - 1 || in_x < 0 || in_x > jpp.iw - 1) {
if (roi_pooling_kernel) {

View File

@ -22,6 +22,7 @@ const std::vector<std::vector<size_t>> pooledShapes_max = {
};
const std::vector<std::vector<size_t>> pooledShapes_bilinear = {
{1, 1},
{2, 2},
{3, 3},
{6, 6}

View File

@ -1176,9 +1176,6 @@ IE_CPU.onnx_model_nonmaxsuppression_center_point_box_format
IE_CPU.onnx_model_nonmaxsuppression_single_box
IE_CPU.nonmaxsuppression_suppress_by_IOU_and_scores_without_constants
# Bug in CPU plugin for ROIPooling when pooled size is 1x1 and method is bilinear
IE_CPU.roi_pooling_1x1_bilinear
# Unsupported dynamic op
IE_CPU.range_v4_trunc_inputs
IE_CPU.onnx_model_reduce_sum_13_axes_as_input