From 8b52eabd48195c42b12062735b1ffb0e911d389b Mon Sep 17 00:00:00 2001 From: zuoshaobo Date: Thu, 14 Mar 2019 03:08:58 -0400 Subject: [PATCH] fix the region layer's output anchor size normalization error --- modules/dnn/src/layers/region_layer.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/dnn/src/layers/region_layer.cpp b/modules/dnn/src/layers/region_layer.cpp index cfe61c1f65..c33c1cb134 100644 --- a/modules/dnn/src/layers/region_layer.cpp +++ b/modules/dnn/src/layers/region_layer.cpp @@ -280,8 +280,8 @@ public: dstData[box_index + 0] = (x + logistic_activate(srcData[box_index + 0])) / cols; dstData[box_index + 1] = (y + logistic_activate(srcData[box_index + 1])) / rows; - dstData[box_index + 2] = exp(srcData[box_index + 2]) * biasData[2 * a] / hNorm; - dstData[box_index + 3] = exp(srcData[box_index + 3]) * biasData[2 * a + 1] / wNorm; + dstData[box_index + 2] = exp(srcData[box_index + 2]) * biasData[2 * a] / wNorm; + dstData[box_index + 3] = exp(srcData[box_index + 3]) * biasData[2 * a + 1] / hNorm; int class_index = index_sample_offset + index * cell_size + 5; for (int j = 0; j < classes; ++j) {