diff --git a/src/bindings/python/src/pyopenvino/frontend/frontend.cpp b/src/bindings/python/src/pyopenvino/frontend/frontend.cpp index 29faff8caa81c6..ace191ae92b82a 100644 --- a/src/bindings/python/src/pyopenvino/frontend/frontend.cpp +++ b/src/bindings/python/src/pyopenvino/frontend/frontend.cpp @@ -31,7 +31,7 @@ void regclass_frontend_FrontEnd(py::module m) { return self.load(model_path); } catch (...) { // Extended for one argument only for this time - return self.load({py_object_to_any(py_obj)}); + return self.load({Common::utils::py_object_to_any(py_obj)}); } }, py::arg("path"), diff --git a/src/bindings/python/src/pyopenvino/utils/utils.cpp b/src/bindings/python/src/pyopenvino/utils/utils.cpp index a729ccc2537ec6..7891650d6f9840 100644 --- a/src/bindings/python/src/pyopenvino/utils/utils.cpp +++ b/src/bindings/python/src/pyopenvino/utils/utils.cpp @@ -12,6 +12,7 @@ #include #include "Python.h" +#include "openvino/frontend/decoder.hpp" namespace Common { namespace utils { @@ -233,6 +234,14 @@ ov::Any py_object_to_any(const py::object& py_obj) { return py::cast(py_obj); } else if (py::isinstance(py_obj)) { return py::cast(py_obj); + // FrontEnd Decoder + } else if (py::isinstance(py_obj)) { + return py::cast>(py_obj); + // Custom FrontEnd Types + } else if (py::isinstance(py_obj)) { + return py::cast(py_obj); + } else if (py::isinstance(py_obj)) { + return py::cast(py_obj); // If there is no match fallback to py::object } else if (py::isinstance(py_obj)) { return py_obj;