[PyOV] Deprecate python IE and nG API (#17791)

This commit is contained in:
Anastasia Kuporosova 2023-06-13 15:18:30 +02:00 committed by GitHub
parent dcba37d897
commit d95c49d888
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 71 additions and 4 deletions

View File

@ -193,6 +193,15 @@ from ngraph.opset11 import unique
from ngraph.opset11 import unsqueeze
from ngraph.opset11 import variadic_split
import warnings
warnings.warn(
message="OpenVINO nGraph Python API is deprecated and will be removed in 2024.0 release."
"For instructions on transitioning to the new API, please refer to "
"https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html",
category=FutureWarning,
stacklevel=2,
)
# Extend Node class to support binary operators
Node.__add__ = add

View File

@ -4,6 +4,8 @@
import os
import sys
import warnings
if sys.platform == "win32":
# Installer, yum, pip installs openvino dlls to the different directories
@ -29,5 +31,13 @@ if sys.platform == "win32":
from .ie_api import *
warnings.warn(
message="OpenVINO Inference Engine Python API is deprecated and will be removed in 2024.0 release."
"For instructions on transitioning to the new API, please refer to "
"https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html",
category=FutureWarning,
stacklevel=2,
)
__all__ = ["IENetwork", "TensorDesc", "IECore", "Blob", "PreProcessInfo", "get_version"]
__version__ = get_version() # type: ignore

View File

@ -65,6 +65,9 @@ def read_network(path_to_xml : str, path_to_bin : str):
cdef class VariableState:
"""
OpenVINO Inference Engine Python API is deprecated and will be removed in the 2024.0 release. For instructions on
transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html
This class manages data for reset operations
"""
@ -100,8 +103,12 @@ cdef class VariableState:
cdef class TensorDesc:
"""
OpenVINO Inference Engine Python API is deprecated and will be removed in the 2024.0 release. For instructions on
transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html
This class defines Tensor description
"""
def __eq__(self, other : TensorDesc):
return self.layout == other.layout and self.precision == other.precision and self.dims == other.dims
@ -168,6 +175,9 @@ cdef class TensorDesc:
cdef class Blob:
"""
OpenVINO Inference Engine Python API is deprecated and will be removed in the 2024.0 release. For instructions on
transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html
This class represents Blob
"""
@ -312,6 +322,9 @@ cdef class Blob:
## This class represents an Inference Engine entity and allows you to manipulate with plugins using unified interfaces.
cdef class IECore:
"""
OpenVINO Inference Engine Python API is deprecated and will be removed in the 2024.0 release. For instructions on
transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html
This class represents an Inference Engine entity and allows you to manipulate with plugins using unified interfaces.
"""
@ -660,8 +673,12 @@ cdef class IECore:
cdef class PreProcessChannel:
"""
OpenVINO Inference Engine Python API is deprecated and will be removed in the 2024.0 release. For instructions on
transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html
This structure stores info about pre-processing of network inputs (scale, mean image, ...)
"""
property mean_value:
def __get__(self):
return deref(self._ptr).meanValue
@ -686,8 +703,12 @@ cdef class PreProcessChannel:
cdef class PreProcessInfo:
"""
OpenVINO Inference Engine Python API is deprecated and will be removed in the 2024.0 release. For instructions on
transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html
This class stores pre-process information for the input
"""
def __cinit__(self):
self._ptr = new CPreProcessInfo()
self._cptr = self._ptr
@ -812,6 +833,9 @@ cdef class PreProcessInfo:
cdef class InputInfoPtr:
"""
OpenVINO Inference Engine Python API is deprecated and will be removed in the 2024.0 release. For instructions on
transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html
This class contains information about each input of the network
"""
@ -897,6 +921,9 @@ cdef class InputInfoPtr:
cdef class InputInfoCPtr:
"""
OpenVINO Inference Engine Python API is deprecated and will be removed in the 2024.0 release. For instructions on
transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html
This class contains const information about each input of the network.
Provides same interface as InputInfoPtr object except properties setters
"""
@ -942,6 +969,9 @@ cdef class InputInfoCPtr:
cdef class DataPtr:
"""
OpenVINO Inference Engine Python API is deprecated and will be removed in the 2024.0 release. For instructions on
transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html
This class is the layer data representation.
"""
@ -1002,6 +1032,9 @@ cdef class DataPtr:
cdef class CDataPtr:
"""
OpenVINO Inference Engine Python API is deprecated and will be removed in the 2024.0 release. For instructions on
transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html
This class is the layer constant data representation. Provides same interface as DataPtr object except properties setters
"""
@ -1043,6 +1076,9 @@ cdef class CDataPtr:
cdef class ExecutableNetwork:
"""
OpenVINO Inference Engine Python API is deprecated and will be removed in the 2024.0 release. For instructions on
transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html
This class represents a network instance loaded to plugin and ready for inference.
"""
@ -1294,6 +1330,9 @@ ctypedef extern void (*cb_type)(void*, int) with gil
cdef class InferRequest:
"""
OpenVINO Inference Engine Python API is deprecated and will be removed in the 2024.0 release. For instructions on
transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html
This class provides an interface to infer requests of :class:`ExecutableNetwork` and serves
to handle infer requests execution and to set and get output data.
"""
@ -1554,6 +1593,10 @@ cdef class InferRequest:
cdef class IENetwork:
"""
OpenVINO Inference Engine Python API is deprecated and will be removed in the 2024.0 release. For instructions on
transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html
"""
## Class constructor
#
# @param model: A PyCapsule containing smart pointer to nGraph function.
@ -1728,7 +1771,12 @@ cdef class IENetwork:
return self.impl.getOVNameForTensor(name).decode('utf-8')
cdef class BlobBuffer:
"""Copy-less accessor for Inference Engine Blob"""
"""
OpenVINO Inference Engine Python API is deprecated and will be removed in the 2024.0 release. For instructions on
transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html
Copy-less accessor for Inference Engine Blob
"""
cdef reset(self, CBlob.Ptr & ptr, vector[size_t] representation_shape = []):
self.ptr = ptr