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

Merge branch 4.x

This commit is contained in:
Alexander Smorkalov
2024-07-01 15:15:08 +03:00
62 changed files with 2178 additions and 243 deletions
@@ -51,6 +51,9 @@ public:
GAPI_WRAP
PyParams& cfgDisableMemPattern();
GAPI_WRAP
PyParams& cfgSessionOptions(const std::map<std::string, std::string>& options);
GBackend backend() const;
std::string tag() const;
cv::util::any params() const;
@@ -351,6 +351,7 @@ struct ParamDesc {
std::unordered_map<std::string, std::pair<cv::Scalar, cv::Scalar> > generic_mstd;
std::unordered_map<std::string, bool> generic_norm;
std::map<std::string, std::string> session_options;
std::vector<cv::gapi::onnx::ep::EP> execution_providers;
bool disable_mem_pattern;
};
@@ -634,6 +635,19 @@ public:
return *this;
}
/** @brief Configures session options for ONNX Runtime.
This function is used to set various session options for the ONNX Runtime
session by accepting a map of key-value pairs.
@param options A map of session option to be applied to the ONNX Runtime session.
@return the reference on modified object.
*/
Params<Net>& cfgSessionOptions(const std::map<std::string, std::string>& options) {
desc.session_options.insert(options.begin(), options.end());
return *this;
}
// BEGIN(G-API's network parametrization API)
GBackend backend() const { return cv::gapi::onnx::backend(); }
std::string tag() const { return Net::tag(); }
@@ -661,7 +675,7 @@ public:
@param model_path path to model file (.onnx file).
*/
Params(const std::string& tag, const std::string& model_path)
: desc{model_path, 0u, 0u, {}, {}, {}, {}, {}, {}, {}, {}, {}, true, {}, {}, {}, false }, m_tag(tag) {}
: desc{model_path, 0u, 0u, {}, {}, {}, {}, {}, {}, {}, {}, {}, true, {}, {}, {}, {}, false}, m_tag(tag) {}
/** @see onnx::Params::cfgMeanStdDev. */
void cfgMeanStdDev(const std::string &layer,
@@ -705,6 +719,11 @@ public:
desc.disable_mem_pattern = true;
}
/** @see onnx::Params::cfgSessionOptions. */
void cfgSessionOptions(const std::map<std::string, std::string>& options) {
desc.session_options.insert(options.begin(), options.end());
}
// BEGIN(G-API's network parametrization API)
GBackend backend() const { return cv::gapi::onnx::backend(); }
std::string tag() const { return m_tag; }