dnn: do not try to rebuilt network during setInput()

- this doesn't make sense in case of multiple inputs
This commit is contained in:
Alexander Alekhin 2021-12-23 02:37:45 +00:00
parent 19ac54277b
commit c408157a4d

View File

@ -1339,6 +1339,11 @@ struct Net::Impl : public detail::NetImplBase
#endif
clear();
if (hasDynamicShapes)
{
updateLayersShapes();
}
this->blobsToKeep = blobsToKeep_;
allocateLayers(blobsToKeep_);
@ -3886,13 +3891,8 @@ void Net::setInput(InputArray blob, const String& name, double scalefactor, cons
bool oldShape = prevShape == blobShape;
blob_.copyTo(impl->netInputLayer->inputsData[pin.oid]);
if (!oldShape) {
if (!oldShape)
ld.outputBlobs[pin.oid] = impl->netInputLayer->inputsData[pin.oid];
if (impl->hasDynamicShapes)
{
impl->updateLayersShapes();
}
}
if (!ld.outputBlobsWrappers[pin.oid].empty())
{