diff --git a/modules/dnn/src/darknet/darknet_io.cpp b/modules/dnn/src/darknet/darknet_io.cpp index bc0b413588..c745d5f036 100644 --- a/modules/dnn/src/darknet/darknet_io.cpp +++ b/modules/dnn/src/darknet/darknet_io.cpp @@ -984,8 +984,8 @@ namespace cv { } std::string activation = getParam(layer_params, "activation", "linear"); - if(activation == "leaky" || activation == "swish" || activation == "mish" || activation == "logistic") - ++cv_layers_counter; // For ReLU, Swish, Mish, Sigmoid + if (activation != "linear") + ++cv_layers_counter; // For ReLU, Swish, Mish, Sigmoid, etc if(!darknet_layers_counter) tensor_shape.resize(1);