Skip to content

Commit

Permalink
Fix issue after master merge (openvinotoolkit#122)
Browse files Browse the repository at this point in the history
* Fix issue after master merge

* Fix build
  • Loading branch information
mvafin authored Jan 18, 2023
1 parent a111b66 commit 5be3099
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/bindings/python/src/pyopenvino/frontend/frontend.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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"),
Expand Down
9 changes: 9 additions & 0 deletions src/bindings/python/src/pyopenvino/utils/utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
#include <vector>

#include "Python.h"
#include "openvino/frontend/decoder.hpp"

namespace Common {
namespace utils {
Expand Down Expand Up @@ -233,6 +234,14 @@ ov::Any py_object_to_any(const py::object& py_obj) {
return py::cast<ov::streams::Num>(py_obj);
} else if (py::isinstance<ov::Affinity>(py_obj)) {
return py::cast<ov::Affinity>(py_obj);
// FrontEnd Decoder
} else if (py::isinstance<ov::frontend::IDecoder>(py_obj)) {
return py::cast<std::shared_ptr<ov::frontend::IDecoder>>(py_obj);
// Custom FrontEnd Types
} else if (py::isinstance<ov::frontend::type::Tensor>(py_obj)) {
return py::cast<ov::frontend::type::Tensor>(py_obj);
} else if (py::isinstance<ov::frontend::type::List>(py_obj)) {
return py::cast<ov::frontend::type::List>(py_obj);
// If there is no match fallback to py::object
} else if (py::isinstance<py::object>(py_obj)) {
return py_obj;
Expand Down

0 comments on commit 5be3099

Please sign in to comment.