1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-30 07:43:03 +04:00

Fix Region layer with OpenVINO in case of different width/height

This commit is contained in:
Dmitry Kurtaev
2023-05-18 17:33:58 +03:00
parent d2143bcd44
commit af14780526
2 changed files with 30 additions and 9 deletions
+3 -3
View File
@@ -526,14 +526,14 @@ public:
std::vector<float> x_indices(w * h * anchors);
auto begin = x_indices.begin();
for (int i = 0; i < h; i++)
for (int i = 0; i < w; i++)
{
std::fill(begin + i * anchors, begin + (i + 1) * anchors, i);
}
for (int j = 1; j < w; j++)
for (int j = 1; j < h; j++)
{
std::copy(begin, begin + h * anchors, begin + j * h * anchors);
std::copy(begin, begin + w * anchors, begin + j * w * anchors);
}
auto horiz = std::make_shared<ngraph::op::Constant>(ngraph::element::f32, box_broad_shape, x_indices.data());
box_x = std::make_shared<ngraph::op::v1::Add>(box_x, horiz, ngraph::op::AutoBroadcastType::NUMPY);