@@ -418,40 +418,6 @@ void regclass_Core(py::module m) {
418418 :rtype: openvino.Model
419419 )" );
420420
421- cls.def (
422- " read_model" ,
423- [](ov::Core& self,
424- const std::string& model_path,
425- const std::string& weight_path,
426- const std::map<std::string, py::object>& config) {
427- const auto any_map = Common::utils::properties_to_any_map (config);
428- py::gil_scoped_release release;
429- return self.read_model (model_path, weight_path, any_map);
430- },
431- py::arg (" model" ),
432- py::arg (" weights" ) = " " ,
433- py::arg (" config" ) = py::dict (),
434- R"(
435- Reads models from IR / ONNX / PDPD / TF and TFLite formats.
436-
437- GIL is released while running this function.
438-
439- :param model: A path to a model in IR / ONNX / PDPD / TF and TFLite format.
440- :type model: str
441- :param weights: A path to a data file For IR format (*.bin): if path is empty,
442- it tries to read a bin file with the same name as xml and if the bin
443- file with the same name was not found, loads IR without weights.
444- For ONNX format (*.onnx): weights parameter is not used.
445- For PDPD format (*.pdmodel) weights parameter is not used.
446- For TF format (*.pb) weights parameter is not used.
447- For TFLite format (*.tflite) weights parameter is not used.
448- :type weights: str
449- :param config: Optional map of pairs: (property name, property value) relevant only for this read operation.
450- :type config: dict[str, typing.Any], optional
451- :return: A model.
452- :rtype: openvino.Model
453- )" );
454-
455421 cls.def (
456422 " read_model" ,
457423 (std::shared_ptr<ov::Model>(ov::Core::*)(const std::string&, const ov::Tensor&) const ) & ov::Core::read_model,
@@ -519,16 +485,16 @@ void regclass_Core(py::module m) {
519485
520486 GIL is released while running this function.
521487
522- :param model: A path to a model in IR / ONNX / PDPD / TF and TFLite format or a model itself wrapped in io.ByesIO format.
523- :type model: Union[pathlib.Path, io.BytesIO]
488+ :param model: A path to a model in IR / ONNX / PDPD / TF and TFLite format or a model itself wrapped in io.BytesIO format.
489+ :type model: Union[str, pathlib.Path, io.BytesIO]
524490 :param weights: A path to a data file For IR format (*.bin): if path is empty,
525491 it tries to read a bin file with the same name as xml and if the bin
526492 file with the same name was not found, loads IR without weights.
527493 For ONNX format (*.onnx): weights parameter is not used.
528494 For PDPD format (*.pdmodel) weights parameter is not used.
529495 For TF format (*.pb): weights parameter is not used.
530496 For TFLite format (*.tflite) weights parameter is not used.
531- :type weights: Union[pathlib.Path, io.BytesIO]
497+ :type weights: Union[str, pathlib.Path, io.BytesIO]
532498 :param config: Optional map of pairs: (property name, property value) relevant only for this read operation.
533499 :type config: dict[str, typing.Any], optional
534500 :return: A model.
0 commit comments