From 51f7547bf152685660d44469a48c9d1ba25a0f39 Mon Sep 17 00:00:00 2001 From: Abhishek Gola Date: Tue, 21 Jul 2026 15:11:33 +0530 Subject: [PATCH] refactoring --- apps/model-diagnostics/model_diagnostics.cpp | 10 ++++++---- modules/dnn/include/opencv2/dnn/dnn.hpp | 6 +++--- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/apps/model-diagnostics/model_diagnostics.cpp b/apps/model-diagnostics/model_diagnostics.cpp index 8a550f2e5d..bf857a6273 100644 --- a/apps/model-diagnostics/model_diagnostics.cpp +++ b/apps/model-diagnostics/model_diagnostics.cpp @@ -53,7 +53,7 @@ std::string diagnosticKeys = "{ model m | | Path to the model file. }" "{ config c | | Path to the model configuration file. }" "{ framework f | | [Optional] Name of the model framework. }" - "{ engine e | new | [Optional] DNN engine selector: new (default) or ort}" + "{ engine e | auto | [Optional] DNN engine selector: auto (default), opencv or ort}" "{ input0_name | | [Optional] Name of input0. Use with input0_shape}" "{ input0_shape | | [Optional] Shape of input0. Use with input0_name}" "{ input1_name | | [Optional] Name of input1. Use with input1_shape}" @@ -98,17 +98,19 @@ int main( int argc, const char** argv ) std::string input4_name = argParser.get("input4_name"); std::string input4_shape = argParser.get("input4_shape"); - dnn::EngineType engine = dnn::ENGINE_OPENCV; + dnn::EngineType engine = dnn::ENGINE_AUTO; if (argParser.has("engine")) { std::string eng_name = argParser.get("engine"); - if(eng_name == "new") + if(eng_name == "auto") + engine = dnn::ENGINE_AUTO; + else if(eng_name == "opencv") engine = dnn::ENGINE_OPENCV; else if(eng_name == "ort") engine = dnn::ENGINE_ORT; else { - std::cerr << "Unknown DNN graph engine \"" << eng_name << "\" (use 'new' or 'ort')\n"; + std::cerr << "Unknown DNN graph engine \"" << eng_name << "\" (use 'auto', 'opencv' or 'ort')\n"; return -1; } } diff --git a/modules/dnn/include/opencv2/dnn/dnn.hpp b/modules/dnn/include/opencv2/dnn/dnn.hpp index defdf59046..00f086e516 100644 --- a/modules/dnn/include/opencv2/dnn/dnn.hpp +++ b/modules/dnn/include/opencv2/dnn/dnn.hpp @@ -1093,7 +1093,7 @@ CV__DNN_INLINE_NS_BEGIN * @param config path to the .pbtxt file that contains text graph definition in protobuf format. * Resulting Net object is built by text graph using weights from a binary one that * let us make it more flexible. - * @param engine select DNN engine to be used. With auto selection the new engine is used. + * @param engine select DNN engine to be used. ENGINE_AUTO (the default) resolves to ENGINE_OPENCV. * @param extraOutputs specify model outputs explicitly, in addition to the outputs the graph analyzer finds. * Please pay attention that the new DNN does not support non-CPU back-ends for now. * @returns Net object. @@ -1106,7 +1106,7 @@ CV__DNN_INLINE_NS_BEGIN /** @brief Reads a network model stored in TensorFlow framework's format. * @param bufferModel buffer containing the content of the pb file * @param bufferConfig buffer containing the content of the pbtxt file - * @param engine select DNN engine to be used. With auto selection the new engine is used. + * @param engine select DNN engine to be used. ENGINE_AUTO (the default) resolves to ENGINE_OPENCV. * @param extraOutputs specify model outputs explicitly, in addition to the outputs the graph analyzer finds. * Please pay attention that the new DNN does not support non-CPU back-ends for now. * @returns Net object. @@ -1123,7 +1123,7 @@ CV__DNN_INLINE_NS_BEGIN * @param lenModel length of bufferModel * @param bufferConfig buffer containing the content of the pbtxt file * @param lenConfig length of bufferConfig - * @param engine select DNN engine to be used. With auto selection the new engine is used. + * @param engine select DNN engine to be used. ENGINE_AUTO (the default) resolves to ENGINE_OPENCV. * @param extraOutputs specify model outputs explicitly, in addition to the outputs the graph analyzer finds. * Please pay attention that the new DNN does not support non-CPU back-ends for now. */