Commit ca51bbb7 authored by Wu Zhiwen's avatar Wu Zhiwen

dnn: fix variance setting bug for PriorBoxLayer

- The size of second channel should be size[2] of output tensor,
- The Scalar should be {variance[0], variance[0], variance[0], variance[0]}
  for _variance.size() == 1 case.
Signed-off-by: 's avatarWu Zhiwen <zhiwen.wu@intel.com>
parent 087e9308
......@@ -453,8 +453,8 @@ public:
outputPtr = outputs[0].ptr<float>(0, 1);
if(_variance.size() == 1)
{
Mat secondChannel(outputs[0].size[2], outputs[0].size[3], CV_32F, outputPtr);
secondChannel.setTo(Scalar(_variance[0]));
Mat secondChannel(1, outputs[0].size[2], CV_32F, outputPtr);
secondChannel.setTo(Scalar::all(_variance[0]));
}
else
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment