Skip to content

Commit cceec84

Browse files
committed
Merge pull request opencv#19520 from WeiChungChang:refine
2 parents fba70f7 + c909693 commit cceec84

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

modules/dnn/src/layers/proposal_layer.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,11 @@ class ProposalLayerImpl CV_FINAL : public ProposalLayer
5454
for (int i = 0; i < ratios.size(); ++i)
5555
{
5656
float ratio = ratios.get<float>(i);
57+
float width = std::floor(baseSize / sqrt(ratio) + 0.5f);
58+
float height = std::floor(width * ratio + 0.5f);
5759
for (int j = 0; j < scales.size(); ++j)
5860
{
5961
float scale = scales.get<float>(j);
60-
float width = std::floor(baseSize / sqrt(ratio) + 0.5f);
61-
float height = std::floor(width * ratio + 0.5f);
6262
widths.push_back(scale * width);
6363
heights.push_back(scale * height);
6464
}

0 commit comments

Comments
 (0)