nareshmlx/opencv-pr huggingface dataset:
**File:** modules/dnn/test/test_layers_1d.cpp
**Change Type:** modified
**Context:** PR #25101: 1D test for Reduce layer

**Code Changes:**
```diff
@@ -480,6 +480,128 @@ INSTANTIATE_TEST_CASE_P(/*nothing*/, Layer_Scatter_Test, Combine(
 
 
 
+typedef testing::TestWithParam<tuple<std::vector<int>, std::string, int>> Layer_Reduce_Test;
+TEST_P(Layer_Reduce_Test, Accuracy_01D)
+{
+    auto reduceOperation = [](const cv::Mat& input, const std::string& operation, int axis) -> cv::Mat {
+        // Initialize result matrix
+        cv::Mat result;
```

Review comment:
Why not as a part of the previous loop?
**File:** modules/dnn/test/test_layers_1d.cpp
**Change Type:** modified
**Context:** PR #25101: 1D test for Reduce layer

**Code Changes:**
```diff
@@ -480,6 +480,128 @@ INSTANTIATE_TEST_CASE_P(/*nothing*/, Layer_Scatter_Test, Combine(
 
 
 
+typedef testing::TestWithParam<tuple<std::vector<int>, std::string, int>> Layer_Reduce_Test;
+TEST_P(Layer_Reduce_Test, Accuracy_01D)
+{
+    auto reduceOperation = [](const cv::Mat& input, const std::string& operation, int axis) -> cv::Mat {
+        // Initialize result matrix
+        cv::Mat result;
```

Review comment:
I recommend use shapes directly. Including 1D vector with multiple values.
**File:** modules/dnn/test/test_layers_1d.cpp
**Change Type:** modified
**Context:** PR #25101: 1D test for Reduce layer

**Code Changes:**
```diff
@@ -480,6 +480,128 @@ INSTANTIATE_TEST_CASE_P(/*nothing*/, Layer_Scatter_Test, Combine(
 
 
 
+typedef testing::TestWithParam<tuple<std::vector<int>, std::string, int>> Layer_Reduce_Test;
+TEST_P(Layer_Reduce_Test, Accuracy_01D)
+{
+    auto reduceOperation = [](const cv::Mat& input, const std::string& operation, int axis) -> cv::Mat {
+        // Initialize result matrix
+        cv::Mat result;
```

Review comment:
Could you define reduction operation on 0d / 1d tensor? Any reference?
**File:** modules/dnn/test/test_layers_1d.cpp
**Change Type:** modified
**Context:** PR #25101: 1D test for Reduce layer

**Code Changes:**
```diff
@@ -480,6 +480,128 @@ INSTANTIATE_TEST_CASE_P(/*nothing*/, Layer_Scatter_Test, Combine(
 
 
 
+typedef testing::TestWithParam<tuple<std::vector<int>, std::string, int>> Layer_Reduce_Test;
+TEST_P(Layer_Reduce_Test, Accuracy_01D)
+{
+    auto reduceOperation = [](const cv::Mat& input, const std::string& operation, int axis) -> cv::Mat {
+        // Initialize result matrix
+        cv::Mat result;
```

Review comment:
formally there is not any. This test is to check if layer fails on singleton matrices
**File:** modules/dnn/test/test_layers_1d.cpp
**Change Type:** modified
**Context:** PR #25101: 1D test for Reduce layer

**Code Changes:**
```diff
@@ -480,6 +480,128 @@ INSTANTIATE_TEST_CASE_P(/*nothing*/, Layer_Scatter_Test, Combine(
 
 
 
+typedef testing::TestWithParam<tuple<std::vector<int>, std::string, int>> Layer_Reduce_Test;
+TEST_P(Layer_Reduce_Test, Accuracy_01D)
+{
+    auto reduceOperation = [](const cv::Mat& input, const std::string& operation, int axis) -> cv::Mat {
+        // Initialize result matrix
+        cv::Mat result;
```

Review comment:
There are some in onnxruntime: https://github.com/microsoft/onnxruntime/blob/4a196d15940b0f328735c888e2e861d67602ffcf/onnxruntime/test/providers/cpu/reduction/reduction_ops_test.cc#L326 (Search for 0D).
**File:** modules/dnn/test/test_layers_1d.cpp
**Change Type:** modified
**Context:** PR #25101: 1D test for Reduce layer

**Code Changes:**
```diff
@@ -480,6 +480,128 @@ INSTANTIATE_TEST_CASE_P(/*nothing*/, Layer_Scatter_Test, Combine(
 
 
 
+typedef testing::TestWithParam<tuple<std::vector<int>, std::string, int>> Layer_Reduce_Test;
+TEST_P(Layer_Reduce_Test, Accuracy_01D)
+{
+    auto reduceOperation = [](const cv::Mat& input, const std::string& operation, int axis) -> cv::Mat {
+        // Initialize result matrix
+        cv::Mat result;
```

Review comment:
incorrect comment
**File:** modules/dnn/test/test_layers_1d.cpp
**Change Type:** modified
**Context:** PR #25101: 1D test for Reduce layer

**Code Changes:**
```diff
@@ -480,6 +480,128 @@ INSTANTIATE_TEST_CASE_P(/*nothing*/, Layer_Scatter_Test, Combine(
 
 
 
+typedef testing::TestWithParam<tuple<std::vector<int>, std::string, int>> Layer_Reduce_Test;
+TEST_P(Layer_Reduce_Test, Accuracy_01D)
+{
+    auto reduceOperation = [](const cv::Mat& input, const std::string& operation, int axis) -> cv::Mat {
+        // Initialize result matrix
+        cv::Mat result;
```

Review comment:
```suggestion cv::Mat output_ref = cv::Mat(std::vector<int>(input_shape.size(), 1), CV_32F, out_value); ```
**File:** modules/dnn/test/test_layers_1d.cpp
**Change Type:** modified
**Context:** PR #25101: 1D test for Reduce layer

**Code Changes:**
```diff
@@ -480,6 +480,128 @@ INSTANTIATE_TEST_CASE_P(/*nothing*/, Layer_Scatter_Test, Combine(
 
 
 
+typedef testing::TestWithParam<tuple<std::vector<int>, std::string, int>> Layer_Reduce_Test;
+TEST_P(Layer_Reduce_Test, Accuracy_01D)
+{
+    auto reduceOperation = [](const cv::Mat& input, const std::string& operation, int axis) -> cv::Mat {
+        // Initialize result matrix
+        cv::Mat result;
```

Review comment:
Why do still we have ONE output value for matrix? Don't write WEAK tests.
**File:** modules/dnn/test/test_layers_1d.cpp
**Change Type:** modified
**Context:** PR #25101: 1D test for Reduce layer

**Code Changes:**
```diff
@@ -480,6 +480,128 @@ INSTANTIATE_TEST_CASE_P(/*nothing*/, Layer_Scatter_Test, Combine(
 
 
 
+typedef testing::TestWithParam<tuple<std::vector<int>, std::string, int>> Layer_Reduce_Test;
+TEST_P(Layer_Reduce_Test, Accuracy_01D)
+{
+    auto reduceOperation = [](const cv::Mat& input, const std::string& operation, int axis) -> cv::Mat {
+        // Initialize result matrix
+        cv::Mat result;
```

Review comment:
Sorry, I do not understand you. What could be output for 1D(or 0D) matrix under reduction operation other than one output value? What do you mean by output value?
**File:** modules/dnn/test/test_layers_1d.cpp
**Change Type:** modified
**Context:** PR #25101: 1D test for Reduce layer

**Code Changes:**
```diff
@@ -480,6 +480,128 @@ INSTANTIATE_TEST_CASE_P(/*nothing*/, Layer_Scatter_Test, Combine(
 
 
 
+typedef testing::TestWithParam<tuple<std::vector<int>, std::string, int>> Layer_Reduce_Test;
+TEST_P(Layer_Reduce_Test, Accuracy_01D)
+{
+    auto reduceOperation = [](const cv::Mat& input, const std::string& operation, int axis) -> cv::Mat {
+        // Initialize result matrix
+        cv::Mat result;
```

Review comment:
Done! (did not see the comment, sorry)
**File:** modules/dnn/test/test_layers_1d.cpp
**Change Type:** modified
**Context:** PR #25101: 1D test for Reduce layer

**Code Changes:**
```diff
@@ -480,6 +480,128 @@ INSTANTIATE_TEST_CASE_P(/*nothing*/, Layer_Scatter_Test, Combine(
 
 
 
+typedef testing::TestWithParam<tuple<std::vector<int>, std::string, int>> Layer_Reduce_Test;
+TEST_P(Layer_Reduce_Test, Accuracy_01D)
+{
+    auto reduceOperation = [](const cv::Mat& input, const std::string& operation, int axis) -> cv::Mat {
+        // Initialize result matrix
+        cv::Mat result;
```

Review comment:
in case of `[4, 4]` input and `axis=1` output is `[4, 1]`, so it also can be tested
**File:** modules/dnn/test/test_layers_1d.cpp
**Change Type:** modified
**Context:** PR #25101: 1D test for Reduce layer
**Review Line:** 490

**Code Changes:**
```diff
+{
+    auto reduceOperation = [](const cv::Mat& input, const std::string& operation, int axis) -> cv::Mat {
+        // Initialize result matrix
+        cv::Mat result;
+        if (shape(input).size() == 0 || shape(input).size() == 1){
+            result = cv::Mat(shape(input).size(), shape(input).data(), CV_32F);
+            int sz[1] = {1};
+            if (!shape(input).empty() && shape(input)[0] != 1){
+                result = cv::Mat(1, 1, CV_32F);
+                result = result.reshape(1, 1, sz);
+            }
```

Review comment:
Might be incorrect for `std::vector<int>({4})` test case (not represented). Number of input dimensions is 1 however output shape is not equal to input shape.
**File:** modules/dnn/test/test_layers_1d.cpp
**Change Type:** modified
**Context:** PR #25101: 1D test for Reduce layer
**Review Line:** 502

**Code Changes:**
```diff
+            if (axis == 0) {
+                result = cv::Mat::zeros(1, input.cols, CV_32F);
+            } else {
+                result = cv::Mat::zeros(input.rows, 1, CV_32F);
+            }
+        }
+
+        auto process_value = [&](float& res, float value, bool is_first) {
+            if (operation == "max") {
+                res = is_first ? value : std::max(res, value);
+            } else if (operation == "min") {
```

Review comment:
Can we simplify to something like this? ```cpp MatShape shape(input). if (!shape.empty()) shape[axis] = 1; result = cv::Mat::zeros(shape.size(), &shape[0], CV_32F); ```
**File:** modules/dnn/test/test_layers_1d.cpp
**Change Type:** modified
**Context:** PR #25101: 1D test for Reduce layer

**Code Changes:**
```diff
@@ -480,6 +480,128 @@ INSTANTIATE_TEST_CASE_P(/*nothing*/, Layer_Scatter_Test, Combine(
 
 
 
+typedef testing::TestWithParam<tuple<std::vector<int>, std::string, int>> Layer_Reduce_Test;
+TEST_P(Layer_Reduce_Test, Accuracy_01D)
+{
+    auto reduceOperation = [](const cv::Mat& input, const std::string& operation, int axis) -> cv::Mat {
+        // Initialize result matrix
+        cv::Mat result;
```

Review comment:
Please clarify this condition. For example, `{1, 4}` input, axis=1 should be reduced to `{1x1}`: `[[a, b, c, d]]` -> `[[a*a + b*b + c*c + d*d]]`
**File:** modules/dnn/test/test_layers_1d.cpp
**Change Type:** modified
**Context:** PR #25101: 1D test for Reduce layer
**Review Line:** 592

**Code Changes:**
```diff
+    ASSERT_EQ(shape(output_ref), shape(outputs[0]));
+    normAssert(output_ref, outputs[0]);
+}
+INSTANTIATE_TEST_CASE_P(/*nothing*/, Layer_Reduce_Test, Combine(
+/*input blob shape*/    Values(
+    std::vector<int>({}),
+    std::vector<int>({1}),
+    std::vector<int>({4}),
+    std::vector<int>({1, 4}),
+    std::vector<int>({4, 1}),
+    std::vector<int>({4, 4})
```

Review comment:
nit: use without parenthesis for simplificity, e.g. `std::vector<int>{}`.
**File:** modules/dnn/test/test_layers_1d.cpp
**Change Type:** modified
**Context:** PR #25101: 1D test for Reduce layer

**Code Changes:**
```diff
@@ -480,6 +480,128 @@ INSTANTIATE_TEST_CASE_P(/*nothing*/, Layer_Scatter_Test, Combine(
 
 
 
+typedef testing::TestWithParam<tuple<std::vector<int>, std::string, int>> Layer_Reduce_Test;
+TEST_P(Layer_Reduce_Test, Accuracy_01D)
+{
+    auto reduceOperation = [](const cv::Mat& input, const std::string& operation, int axis) -> cv::Mat {
+        // Initialize result matrix
+        cv::Mat result;
```

Review comment:
Please drop debug printing.
**File:** modules/core/include/opencv2/core.hpp
**Change Type:** modified
**Context:** PR #25914: throw() -> noexcept

**Code Changes:**
```diff
@@ -123,12 +123,12 @@ class CV_EXPORTS Exception : public std::exception
      Instead, the macros CV_Error(), CV_Error_() and CV_Assert() are used.
     */
     Exception(int _code, const String& _err, const String& _func, const String& _file, int _line);
-    virtual ~Exception() throw();
+    virtual ~Exception() CV_NOEXCEPT;
 
     /*!
      \return the error description and the context as a text string.
     */
```

Review comment:
Use `CV_NOEXCEPT` according to existed codebase,
**File:** modules/dnn/src/ie_ngraph.hpp
**Change Type:** modified
**Context:** PR #25199: Fix for OpenVINO 2024.0. OpenVINO 2022.1 as minimal supported version.

**Code Changes:**
```diff
@@ -17,7 +17,8 @@
 #pragma warning(disable : 4245)
 #pragma warning(disable : 4268)
 #endif
-#include <ngraph/ngraph.hpp>
+#include <openvino/openvino.hpp>
+#include <openvino/op/ops.hpp>
 #ifdef _MSC_VER
 #pragma warning(pop)
 #endif
```

Review comment:
Should be valid even for earlier release: https://github.com/opencv/opencv/blob/0fabe2b9e9fac96957b553b6a83483bddfe129bb/modules/dnn/src/op_inf_engine.hpp#L49. Not sure about `ov::` namespace
**File:** modules/dnn/src/ie_ngraph.cpp
**Change Type:** modified
**Context:** PR #25199: Fix for OpenVINO 2024.0. OpenVINO 2022.1 as minimal supported version.

**Code Changes:**
```diff
@@ -14,7 +14,7 @@
 #include <opencv2/dnn/shape_utils.hpp>
 
 #ifdef HAVE_DNN_NGRAPH
-#include <ie_extension.h>
+#include <openvino/core/extension.hpp>
 #endif  // HAVE_DNN_NGRAPH
 
 #include <opencv2/core/utils/configuration.private.hpp>
@@ -35,36 +35,6 @@ static bool DNN_IE_SERIALIZE = utils::getConfigurationParameterBool("OPENCV_DNN_
```

Review comment:
Is `ov::` available for `< 2020.3`?
**File:** modules/dnn/src/layers/elementwise_layers.cpp
**Change Type:** modified
**Context:** PR #25199: Fix for OpenVINO 2024.0. OpenVINO 2022.1 as minimal supported version.

**Code Changes:**
```diff
@@ -490,13 +490,13 @@ struct ReLUFunctor : public BaseFunctor
 #endif
 
 #ifdef HAVE_DNN_NGRAPH
-    std::shared_ptr<ngraph::Node> initNgraphAPI(const ngraph::Output<ngraph::Node>& node)
+    std::shared_ptr<ov::Node> initNgraphAPI(const ov::Output<ov::Node>& node)
     {
         if (slope) {
-            auto param = std::make_shared<ngraph::op::Constant>(ngraph::element::f32, ngraph::Shape{1}, &slope);
-            return std::make_shared<ngraph::op::PRelu>(node, param);
```

Review comment:
```cpp #include <openvino/op/ops.hpp> ```
**File:** modules/dnn/src/layers/elementwise_layers.cpp
**Change Type:** modified
**Context:** PR #25199: Fix for OpenVINO 2024.0. OpenVINO 2022.1 as minimal supported version.

**Code Changes:**
```diff
@@ -490,13 +490,13 @@ struct ReLUFunctor : public BaseFunctor
 #endif
 
 #ifdef HAVE_DNN_NGRAPH
-    std::shared_ptr<ngraph::Node> initNgraphAPI(const ngraph::Output<ngraph::Node>& node)
+    std::shared_ptr<ov::Node> initNgraphAPI(const ov::Output<ov::Node>& node)
     {
         if (slope) {
-            auto param = std::make_shared<ngraph::op::Constant>(ngraph::element::f32, ngraph::Shape{1}, &slope);
-            return std::make_shared<ngraph::op::PRelu>(node, param);
```

Review comment:
And I think better to include it to `op_inf_engine.hpp`
**File:** modules/dnn/src/layers/elementwise_layers.cpp
**Change Type:** modified
**Context:** PR #25199: Fix for OpenVINO 2024.0. OpenVINO 2022.1 as minimal supported version.

**Code Changes:**
```diff
@@ -490,13 +490,13 @@ struct ReLUFunctor : public BaseFunctor
 #endif
 
 #ifdef HAVE_DNN_NGRAPH
-    std::shared_ptr<ngraph::Node> initNgraphAPI(const ngraph::Output<ngraph::Node>& node)
+    std::shared_ptr<ov::Node> initNgraphAPI(const ov::Output<ov::Node>& node)
     {
         if (slope) {
-            auto param = std::make_shared<ngraph::op::Constant>(ngraph::element::f32, ngraph::Shape{1}, &slope);
-            return std::make_shared<ngraph::op::PRelu>(node, param);
```

Review comment:
Includes of separated ops speed up build. But I cannot use this approach with 2021 OpenVINO release :(
**File:** modules/dnn/src/ie_ngraph.cpp
**Change Type:** modified
**Context:** PR #25199: Fix for OpenVINO 2024.0. OpenVINO 2022.1 as minimal supported version.

**Code Changes:**
```diff
@@ -14,7 +14,7 @@
 #include <opencv2/dnn/shape_utils.hpp>
 
 #ifdef HAVE_DNN_NGRAPH
-#include <ie_extension.h>
+#include <openvino/core/extension.hpp>
 #endif  // HAVE_DNN_NGRAPH
 
 #include <opencv2/core/utils/configuration.private.hpp>
@@ -35,36 +35,6 @@ static bool DNN_IE_SERIALIZE = utils::getConfigurationParameterBool("OPENCV_DNN_
```

Review comment:
do you need to support 4 years old OpenVINO? Can we say only 2022.1 and newer are supported? It will significantly simplify conditions in code where OpenVINO is used and also will allow to drop legacy cmake code and rely only on `find_package(OpenVINO)` 2 year since 2022.1 is a good release history
**File:** modules/dnn/src/ie_ngraph.cpp
**Change Type:** modified
**Context:** PR #25199: Fix for OpenVINO 2024.0. OpenVINO 2022.1 as minimal supported version.

**Code Changes:**
```diff
@@ -14,7 +14,7 @@
 #include <opencv2/dnn/shape_utils.hpp>
 
 #ifdef HAVE_DNN_NGRAPH
-#include <ie_extension.h>
+#include <openvino/core/extension.hpp>
 #endif  // HAVE_DNN_NGRAPH
 
 #include <opencv2/core/utils/configuration.private.hpp>
@@ -35,36 +35,6 @@ static bool DNN_IE_SERIALIZE = utils::getConfigurationParameterBool("OPENCV_DNN_
```

Review comment:
Agree. For now CI works on 2021.4 so we can keep it to test it against OpenVINO API 2.0 (2022.x). I just mean that this lane changed under `#ifdef` and we don't test it. So specifically for this line, I recommend revert. Let's drop OpenVINO support for 2020.x in a separate PR.
**File:** modules/dnn/src/ie_ngraph.cpp
**Change Type:** modified
**Context:** PR #25199: Fix for OpenVINO 2024.0. OpenVINO 2022.1 as minimal supported version.

**Code Changes:**
```diff
@@ -14,7 +14,7 @@
 #include <opencv2/dnn/shape_utils.hpp>
 
 #ifdef HAVE_DNN_NGRAPH
-#include <ie_extension.h>
+#include <openvino/core/extension.hpp>
 #endif  // HAVE_DNN_NGRAPH
 
 #include <opencv2/core/utils/configuration.private.hpp>
@@ -35,36 +35,6 @@ static bool DNN_IE_SERIALIZE = utils::getConfigurationParameterBool("OPENCV_DNN_
```

Review comment:
> 2021.4 API 2.0 since 2022.1 If we want to drop IE:: and API 1.0, we need to test since 2022.1
**File:** modules/dnn/src/ie_ngraph.hpp
**Change Type:** modified
**Context:** PR #25199: Fix for OpenVINO 2024.0. OpenVINO 2022.1 as minimal supported version.

**Code Changes:**
```diff
@@ -17,7 +17,8 @@
 #pragma warning(disable : 4245)
 #pragma warning(disable : 4268)
 #endif
-#include <ngraph/ngraph.hpp>
+#include <openvino/openvino.hpp>
+#include <openvino/op/ops.hpp>
 #ifdef _MSC_VER
 #pragma warning(pop)
 #endif
```

Review comment:
Conflicts with existing namespace https://github.com/opencv/opencv/actions/runs/8256827567/job/22596488054?pr=25199
**File:** modules/dnn/src/ie_ngraph.cpp
**Change Type:** modified
**Context:** PR #25199: Fix for OpenVINO 2024.0. OpenVINO 2022.1 as minimal supported version.

**Code Changes:**
```diff
@@ -14,7 +14,7 @@
 #include <opencv2/dnn/shape_utils.hpp>
 
 #ifdef HAVE_DNN_NGRAPH
-#include <ie_extension.h>
+#include <openvino/core/extension.hpp>
 #endif  // HAVE_DNN_NGRAPH
 
 #include <opencv2/core/utils/configuration.private.hpp>
@@ -35,36 +35,6 @@ static bool DNN_IE_SERIALIZE = utils::getConfigurationParameterBool("OPENCV_DNN_
```

Review comment:
> I only recommend to do this in a separate PR But in this case we need to do double job: - Current PR supports both Pre and Post API 1.0 changes - Next PR removes Pre API 1.0 code path. I suppose we need to do it in one shot and just drop API 1.0 here
**File:** modules/dnn/src/layers/detection_output_layer.cpp
**Change Type:** modified
**Context:** PR #25199: Fix for OpenVINO 2024.0. OpenVINO 2022.1 as minimal supported version.
**Review Line:** 56

**Code Changes:**
```diff
@@ -55,11 +55,7 @@
 
 #ifdef HAVE_DNN_NGRAPH
 #include "../ie_ngraph.hpp"
-#if INF_ENGINE_VER_MAJOR_GT(INF_ENGINE_RELEASE_2020_4)
-#include <ngraph/op/detection_output.hpp>
-#else
-#include <ngraph/op/experimental/layers/detection_output.hpp>
```

Review comment:
HAVE_DNN_NGRAPH => HAVE_DNN_OPENVINO ?
**File:** modules/dnn/src/net_openvino.cpp
**Change Type:** modified
**Context:** PR #25199: Fix for OpenVINO 2024.0. OpenVINO 2022.1 as minimal supported version.
**Review Line:** 14

**Code Changes:**
```diff
 #include <opencv2/core/utils/configuration.private.hpp>
 #include <opencv2/core/utils/logger.hpp>
 
+#include "op_inf_engine.hpp"
+
+#ifdef HAVE_INF_ENGINE
+#include <openvino/op/util/op_types.hpp>
+#endif
+
 #include "net_impl.hpp"
 
```

Review comment:
```suggestion #ifdef HAVE_OPENVINO ```
**File:** modules/dnn/src/net_openvino.cpp
**Change Type:** modified
**Context:** PR #25199: Fix for OpenVINO 2024.0. OpenVINO 2022.1 as minimal supported version.

**Code Changes:**
```diff
@@ -9,6 +9,12 @@
 #include <opencv2/core/utils/configuration.private.hpp>
 #include <opencv2/core/utils/logger.hpp>
 
+#include "op_inf_engine.hpp"
+
+#ifdef HAVE_INF_ENGINE
+#include <openvino/op/util/op_types.hpp>
+#endif
+
```

Review comment:
it's removed in API 2.0
**File:** modules/dnn/src/op_inf_engine.cpp
**Change Type:** modified
**Context:** PR #25199: Fix for OpenVINO 2024.0. OpenVINO 2022.1 as minimal supported version.
**Review Line:** 12

**Code Changes:**
```diff
@@ -10,7 +10,7 @@
 #include <opencv2/dnn/shape_utils.hpp>
 
 #ifdef HAVE_INF_ENGINE
-#include <ie_extension.h>
+#include <openvino/core/extension.hpp>
 #elif defined(ENABLE_PLUGINS)
 // using plugin API
 #include "backend.hpp"
```

Review comment:
```suggestion #ifdef HAVE_OPENVINO ```
**File:** modules/dnn/src/op_inf_engine.hpp
**Change Type:** modified
**Context:** PR #25199: Fix for OpenVINO 2024.0. OpenVINO 2022.1 as minimal supported version.
**Review Line:** 24

**Code Changes:**
```diff
-#define INF_ENGINE_RELEASE_2021_2 2021020000
-#define INF_ENGINE_RELEASE_2021_3 2021030000
-#define INF_ENGINE_RELEASE_2021_4 2021040000
 #define INF_ENGINE_RELEASE_2022_1 2022010000
 #define INF_ENGINE_RELEASE_2023_0 2023000000
+#define INF_ENGINE_RELEASE_2024_0 2024000000
 
 #ifndef INF_ENGINE_RELEASE
-#warning("IE version have not been provided via command-line. Using 2021.4 by default")
-#define INF_ENGINE_RELEASE INF_ENGINE_RELEASE_2021_4
+#warning("IE version have not been provided via command-line. Using 2022.1 by default")
```

Review comment:
```suggestion #define OPENVINO_RELEASE_2024_0 2024000000 ``` and can we remove old ones?
**File:** modules/dnn/src/layers/detection_output_layer.cpp
**Change Type:** modified
**Context:** PR #25199: Fix for OpenVINO 2024.0. OpenVINO 2022.1 as minimal supported version.
**Review Line:** 56

**Code Changes:**
```diff
@@ -55,11 +55,7 @@
 
 #ifdef HAVE_DNN_NGRAPH
 #include "../ie_ngraph.hpp"
-#if INF_ENGINE_VER_MAJOR_GT(INF_ENGINE_RELEASE_2020_4)
-#include <ngraph/op/detection_output.hpp>
-#else
-#include <ngraph/op/experimental/layers/detection_output.hpp>
```

Review comment:
Will cost a lot of changes as well as DNN_BACKEND_INFERENCE_ENGINE -> DNN_BACKEND_OPENVINO.
**File:** modules/dnn/src/op_inf_engine.hpp
**Change Type:** modified
**Context:** PR #25199: Fix for OpenVINO 2024.0. OpenVINO 2022.1 as minimal supported version.
**Review Line:** 24

**Code Changes:**
```diff
-#define INF_ENGINE_RELEASE_2021_2 2021020000
-#define INF_ENGINE_RELEASE_2021_3 2021030000
-#define INF_ENGINE_RELEASE_2021_4 2021040000
 #define INF_ENGINE_RELEASE_2022_1 2022010000
 #define INF_ENGINE_RELEASE_2023_0 2023000000
+#define INF_ENGINE_RELEASE_2024_0 2024000000
 
 #ifndef INF_ENGINE_RELEASE
-#warning("IE version have not been provided via command-line. Using 2021.4 by default")
-#define INF_ENGINE_RELEASE INF_ENGINE_RELEASE_2021_4
+#warning("IE version have not been provided via command-line. Using 2022.1 by default")
```

Review comment:
Let’s remove old ones, but keep IE notation to reduce changes.
**File:** modules/dnn/src/op_inf_engine.hpp
**Change Type:** modified
**Context:** PR #25199: Fix for OpenVINO 2024.0. OpenVINO 2022.1 as minimal supported version.

**Code Changes:**
```diff
@@ -19,19 +19,13 @@
 
 #ifdef HAVE_INF_ENGINE
 
-#define INF_ENGINE_RELEASE_2020_2 2020020000
-#define INF_ENGINE_RELEASE_2020_3 2020030000
-#define INF_ENGINE_RELEASE_2020_4 2020040000
-#define INF_ENGINE_RELEASE_2021_1 2021010000
-#define INF_ENGINE_RELEASE_2021_2 2021020000
-#define INF_ENGINE_RELEASE_2021_3 2021030000
```

Review comment:
Please remove this workaround with `CNNNetwork` alias