1
0
mirror of https://github.com/opencv/opencv_contrib.git synced 2025-10-21 23:01:45 +08:00

Merge branch 4.x

This commit is contained in:
Alexander Smorkalov
2025-07-28 10:07:59 +03:00
7 changed files with 611 additions and 4 deletions

View File

@@ -99,6 +99,8 @@ struct ParamDesc {
PluginConfigT config;
size_t nireq = 1;
bool ensure_named_tensors = false;
};
// NB: Just helper to avoid code duplication.
@@ -205,6 +207,24 @@ public:
return *this;
}
/** @brief Ensures the model has named tensors.
This function is used to ensure that all tensors in the model have names.
It goes through all input and output nodes of the model and sets the names
if they are not set. This is neccessary for models with nameless tensors.
If a tensor does not have a name, it will be assigned a default name
based on the producer node's friendly name. If the producer node has multiple
outputs, the name will be in the form "node_name:N", where N is the output index.
@param flag If true, then it guarantees that all tensors will have names.
@return reference to this parameter structure.
*/
Params<Net>& cfgEnsureNamedTensors(bool flag = true) {
m_desc.ensure_named_tensors = flag;
return *this;
}
/** @brief Specifies tensor layout for an input layer.
The function is used to set tensor layout for an input layer.
@@ -524,6 +544,12 @@ public:
return *this;
}
/** @see ov::Params::cfgEnsureNamedTensors. */
Params& cfgEnsureNamedTensors(bool flag = true) {
m_desc.ensure_named_tensors = flag;
return *this;
}
/** @see ov::Params::cfgInputTensorLayout. */
Params& cfgInputTensorLayout(std::string layout) {
detail::getModelToSetAttrOrThrow(m_desc.kind, "input tensor layout")