1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-30 15:53:03 +04:00

refactoring

This commit is contained in:
Abhishek Gola
2026-07-21 15:11:33 +05:30
parent 57bcf14e78
commit 51f7547bf1
2 changed files with 9 additions and 7 deletions
+6 -4
View File
@@ -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<std::string>("input4_name");
std::string input4_shape = argParser.get<std::string>("input4_shape");
dnn::EngineType engine = dnn::ENGINE_OPENCV;
dnn::EngineType engine = dnn::ENGINE_AUTO;
if (argParser.has("engine"))
{
std::string eng_name = argParser.get<std::string>("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;
}
}
+3 -3
View File
@@ -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 <a href="https://www.tensorflow.org/">TensorFlow</a> 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.
*/