[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 unsqueeze
from ngraph.opset11 import variadic_split 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 # Extend Node class to support binary operators
Node.__add__ = add Node.__add__ = add

View File

@ -4,6 +4,8 @@
import os import os
import sys import sys
import warnings
if sys.platform == "win32": if sys.platform == "win32":
# Installer, yum, pip installs openvino dlls to the different directories # Installer, yum, pip installs openvino dlls to the different directories
@ -29,5 +31,13 @@ if sys.platform == "win32":
from .ie_api import * 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"] __all__ = ["IENetwork", "TensorDesc", "IECore", "Blob", "PreProcessInfo", "get_version"]
__version__ = get_version() # type: ignore __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: 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 This class manages data for reset operations
""" """
@ -100,8 +103,12 @@ cdef class VariableState:
cdef class TensorDesc: 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 This class defines Tensor description
""" """
def __eq__(self, other : TensorDesc): def __eq__(self, other : TensorDesc):
return self.layout == other.layout and self.precision == other.precision and self.dims == other.dims 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: 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 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. ## This class represents an Inference Engine entity and allows you to manipulate with plugins using unified interfaces.
cdef class IECore: 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. 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: 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, ...) This structure stores info about pre-processing of network inputs (scale, mean image, ...)
""" """
property mean_value: property mean_value:
def __get__(self): def __get__(self):
return deref(self._ptr).meanValue return deref(self._ptr).meanValue
@ -686,8 +703,12 @@ cdef class PreProcessChannel:
cdef class PreProcessInfo: 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 This class stores pre-process information for the input
""" """
def __cinit__(self): def __cinit__(self):
self._ptr = new CPreProcessInfo() self._ptr = new CPreProcessInfo()
self._cptr = self._ptr self._cptr = self._ptr
@ -812,6 +833,9 @@ cdef class PreProcessInfo:
cdef class InputInfoPtr: 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 This class contains information about each input of the network
""" """
@ -897,10 +921,13 @@ cdef class InputInfoPtr:
cdef class InputInfoCPtr: 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. This class contains const information about each input of the network.
Provides same interface as InputInfoPtr object except properties setters Provides same interface as InputInfoPtr object except properties setters
""" """
@property @property
def name(self): def name(self):
""" """
@ -942,9 +969,12 @@ cdef class InputInfoCPtr:
cdef class DataPtr: 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. This class is the layer data representation.
""" """
def __init__(self): def __init__(self):
""" """
Default constructor Default constructor
@ -1002,6 +1032,9 @@ cdef class DataPtr:
cdef class CDataPtr: 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 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: 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. This class represents a network instance loaded to plugin and ready for inference.
""" """
@ -1294,10 +1330,13 @@ ctypedef extern void (*cb_type)(void*, int) with gil
cdef class InferRequest: 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 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. to handle infer requests execution and to set and get output data.
""" """
def __init__(self): def __init__(self):
""" """
There is no explicit class constructor. To make a valid :class:`InferRequest` instance, use :func:`IECore.load_network` There is no explicit class constructor. To make a valid :class:`InferRequest` instance, use :func:`IECore.load_network`
@ -1554,6 +1593,10 @@ cdef class InferRequest:
cdef class IENetwork: 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 ## Class constructor
# #
# @param model: A PyCapsule containing smart pointer to nGraph function. # @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') return self.impl.getOVNameForTensor(name).decode('utf-8')
cdef class BlobBuffer: 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 = []): cdef reset(self, CBlob.Ptr & ptr, vector[size_t] representation_shape = []):
self.ptr = ptr self.ptr = ptr