diff --git a/src/inference/include/openvino/runtime/core.hpp b/src/inference/include/openvino/runtime/core.hpp index 8cde52e120f969..01915c358d53af 100644 --- a/src/inference/include/openvino/runtime/core.hpp +++ b/src/inference/include/openvino/runtime/core.hpp @@ -81,9 +81,12 @@ class OPENVINO_RUNTIME_API Core { * * PDPD (*.pdmodel) * * TF (*.pb) * * TFLite (*.tflite) + * @param properties Optional map of pairs: (property name, property value) relevant only for this read operation. * @return A model. */ - std::shared_ptr read_model(const std::wstring& model_path, const std::wstring& bin_path = {}) const; + std::shared_ptr read_model(const std::wstring& model_path, + const std::wstring& bin_path = {}, + const ov::AnyMap& properties = {}) const; #endif /** @@ -108,9 +111,7 @@ class OPENVINO_RUNTIME_API Core { #ifdef OPENVINO_CPP_VER_17 template >* = nullptr> - std::shared_ptr read_model(const Path& model_path, - const Path& bin_path = {}, - const ov::AnyMap& properties = {}) const { + auto read_model(const Path& model_path, const Path& bin_path = {}, const ov::AnyMap& properties = {}) const { return read_model(model_path.string(), bin_path.string(), properties); } #endif @@ -142,7 +143,7 @@ class OPENVINO_RUNTIME_API Core { #ifdef OPENVINO_CPP_VER_17 template >* = nullptr> - auto read_model(const Path& model_path, const Path& bin_path = {}, Properties&&... properties) const { + auto read_model(const Path& model_path, const Path& bin_path, Properties&&... properties) const { return read_model(model_path.string(), bin_path.string(), std::forward(properties)...); } #endif diff --git a/src/inference/src/cpp/core.cpp b/src/inference/src/cpp/core.cpp index 372bd30190b029..5d85fe81364a17 100644 --- a/src/inference/src/cpp/core.cpp +++ b/src/inference/src/cpp/core.cpp @@ -80,9 +80,12 @@ Core::Core(const std::string& xml_config_file) { std::map Core::get_versions(const std::string& device_name) const { OV_CORE_CALL_STATEMENT({ return _impl->get_versions(device_name); })} #ifdef OPENVINO_ENABLE_UNICODE_PATH_SUPPORT -std::shared_ptr Core::read_model(const std::wstring& model_path, const std::wstring& bin_path) const { - OV_CORE_CALL_STATEMENT( - return _impl->read_model(ov::util::wstring_to_string(model_path), ov::util::wstring_to_string(bin_path), {});); +std::shared_ptr Core::read_model(const std::wstring& model_path, + const std::wstring& bin_path, + const ov::AnyMap& properties) const { + OV_CORE_CALL_STATEMENT(return _impl->read_model(ov::util::wstring_to_string(model_path), + ov::util::wstring_to_string(bin_path), + properties);); } #endif