remove flag of convolution

pull/23625/head
zihaomu 2 years ago
parent 233478e689
commit 91b6c8507a
  1. 1
      modules/dnn/include/opencv2/dnn/all_layers.hpp
  2. 3
      modules/dnn/src/layers/convolution_layer.cpp
  3. 4
      modules/dnn/src/net_impl_fuse.cpp

@ -258,7 +258,6 @@ CV__DNN_INLINE_NS_BEGIN
static Ptr<BaseConvolutionLayer> create(const LayerParams& params);
bool fusedActivation = false;
bool fusedAdd = false;
bool isConv2D = false; // Should be deleted after fastconv branch support Conv1D and Conv3D.
bool useWinograd = false; // Flag whether to use Winograd to speed up 3x3 convolution.
};

@ -116,9 +116,6 @@ public:
fusedWeights = false;
fusedBias = false;
if (kernel_size.size() == 2)
isConv2D = true;
}
virtual void finalize(InputArrayOfArrays inputs_arr, OutputArrayOfArrays outputs_arr) CV_OVERRIDE

@ -170,8 +170,8 @@ void Net::Impl::fuseLayers(const std::vector<LayerPin>& blobsToKeep_)
// To avoid the order like: conv + activ + add, if we found the conv has been fused with activ, we break.
Ptr<ConvolutionLayer> convLayer = ld.layerInstance.dynamicCast<ConvolutionLayer>();
// Only Conv2D without fusion Activation supports this fusion, other-wise, we skip.
if (!convLayer->isConv2D || convLayer->fusedActivation)
// Only Convolution layer without fusion Activation supports this fusion, other-wise, we skip.
if (convLayer->fusedActivation)
break;
// For now, there are currently two layers in OpenCV that run the Add operator.

Loading…
Cancel
Save