Skip to content

Commit bc87277

Browse files
author
Qoo
committed
save allocation of memory for fake image
1 parent 7ce56b3 commit bc87277

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
@@ -286,7 +286,8 @@ class ProposalLayerImpl CV_FINAL : public ProposalLayer
286286

287287
CV_Assert(imInfo.total() >= 2);
288288
// We've chosen the smallest data type because we need just a shape from it.
289-
fakeImageBlob.create(shape(1, 1, imInfo.at<float>(0), imInfo.at<float>(1)), CV_8UC1);
289+
// We don't allocate memory but just need the shape is correct.
290+
Mat fakeImageBlob(shape(1, 1, imInfo.at<float>(0), imInfo.at<float>(1)), CV_8UC1, nullptr);
290291

291292
// Generate prior boxes.
292293
std::vector<Mat> layerInputs(2), layerOutputs(1, priorBoxes);
@@ -427,7 +428,6 @@ class ProposalLayerImpl CV_FINAL : public ProposalLayer
427428
Ptr<PermuteLayer> deltasPermute;
428429
Ptr<PermuteLayer> scoresPermute;
429430
uint32_t keepTopBeforeNMS, keepTopAfterNMS, featStride, baseSize;
430-
Mat fakeImageBlob;
431431
float nmsThreshold;
432432
DictValue ratios, scales;
433433
#ifdef HAVE_OPENCL

0 commit comments

Comments
 (0)