mirror of
https://github.com/opencv/opencv.git
synced 2025-06-13 04:52:53 +08:00
dnn: do not try to rebuilt network during setInput()
- this doesn't make sense in case of multiple inputs
This commit is contained in:
parent
19ac54277b
commit
c408157a4d
@ -1339,6 +1339,11 @@ struct Net::Impl : public detail::NetImplBase
|
|||||||
#endif
|
#endif
|
||||||
clear();
|
clear();
|
||||||
|
|
||||||
|
if (hasDynamicShapes)
|
||||||
|
{
|
||||||
|
updateLayersShapes();
|
||||||
|
}
|
||||||
|
|
||||||
this->blobsToKeep = blobsToKeep_;
|
this->blobsToKeep = blobsToKeep_;
|
||||||
|
|
||||||
allocateLayers(blobsToKeep_);
|
allocateLayers(blobsToKeep_);
|
||||||
@ -3886,13 +3891,8 @@ void Net::setInput(InputArray blob, const String& name, double scalefactor, cons
|
|||||||
bool oldShape = prevShape == blobShape;
|
bool oldShape = prevShape == blobShape;
|
||||||
|
|
||||||
blob_.copyTo(impl->netInputLayer->inputsData[pin.oid]);
|
blob_.copyTo(impl->netInputLayer->inputsData[pin.oid]);
|
||||||
if (!oldShape) {
|
if (!oldShape)
|
||||||
ld.outputBlobs[pin.oid] = impl->netInputLayer->inputsData[pin.oid];
|
ld.outputBlobs[pin.oid] = impl->netInputLayer->inputsData[pin.oid];
|
||||||
if (impl->hasDynamicShapes)
|
|
||||||
{
|
|
||||||
impl->updateLayersShapes();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!ld.outputBlobsWrappers[pin.oid].empty())
|
if (!ld.outputBlobsWrappers[pin.oid].empty())
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user