mirror of
https://github.com/opencv/opencv.git
synced 2025-08-06 06:26:29 +08:00
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: Wu Zhiwen <zhiwen.wu@intel.com>
This commit is contained in:
parent
087e9308ec
commit
ca51bbb7ff
@ -453,8 +453,8 @@ public:
|
|||||||
outputPtr = outputs[0].ptr<float>(0, 1);
|
outputPtr = outputs[0].ptr<float>(0, 1);
|
||||||
if(_variance.size() == 1)
|
if(_variance.size() == 1)
|
||||||
{
|
{
|
||||||
Mat secondChannel(outputs[0].size[2], outputs[0].size[3], CV_32F, outputPtr);
|
Mat secondChannel(1, outputs[0].size[2], CV_32F, outputPtr);
|
||||||
secondChannel.setTo(Scalar(_variance[0]));
|
secondChannel.setTo(Scalar::all(_variance[0]));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user