|
1 |
| -""" |
2 |
| - Copyright (C) 2021-2023 Intel Corporation |
| 1 | +# -*- coding: utf-8 -*- |
| 2 | +# Copyright (C) 2018-2023 Intel Corporation |
| 3 | +# SPDX-License-Identifier: Apache-2.0 |
3 | 4 |
|
4 |
| - Licensed under the Apache License, Version 2.0 (the "License"); |
5 |
| - you may not use this file except in compliance with the License. |
6 |
| - You may obtain a copy of the License at |
| 5 | +__path__ = __import__("pkgutil").extend_path(__path__, __name__) |
7 | 6 |
|
8 |
| - http://www.apache.org/licenses/LICENSE-2.0 |
| 7 | +# Required for Windows OS platforms |
| 8 | +# Note: always top-level |
| 9 | +try: |
| 10 | + from openvino.utils import _add_openvino_libs_to_search_path |
| 11 | + _add_openvino_libs_to_search_path() |
| 12 | +except ImportError: |
| 13 | + pass |
9 | 14 |
|
10 |
| - Unless required by applicable law or agreed to in writing, software |
11 |
| - distributed under the License is distributed on an "AS IS" BASIS, |
12 |
| - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
13 |
| - See the License for the specific language governing permissions and |
14 |
| - limitations under the License. |
15 |
| -""" |
| 15 | +# API 2.0 |
| 16 | +try: |
| 17 | + # Import all public modules |
| 18 | + from openvino import runtime as runtime |
| 19 | + from openvino import frontend as frontend |
| 20 | + from openvino import helpers as helpers |
| 21 | + from openvino import preprocess as preprocess |
| 22 | + from openvino import utils as utils |
| 23 | + from openvino.runtime import properties as properties |
16 | 24 |
|
17 |
| -__path__ = __import__("pkgutil").extend_path(__path__, __name__) |
| 25 | + # Import most important classes and functions from openvino.runtime |
| 26 | + from openvino.runtime import Model |
| 27 | + from openvino.runtime import Core |
| 28 | + from openvino.runtime import CompiledModel |
| 29 | + from openvino.runtime import InferRequest |
| 30 | + from openvino.runtime import AsyncInferQueue |
| 31 | + |
| 32 | + from openvino.runtime import Dimension |
| 33 | + from openvino.runtime import Strides |
| 34 | + from openvino.runtime import PartialShape |
| 35 | + from openvino.runtime import Shape |
| 36 | + from openvino.runtime import Layout |
| 37 | + from openvino.runtime import Type |
| 38 | + from openvino.runtime import Tensor |
| 39 | + from openvino.runtime import OVAny |
| 40 | + |
| 41 | + from openvino.runtime import compile_model |
| 42 | + from openvino.runtime import get_batch |
| 43 | + from openvino.runtime import set_batch |
| 44 | + from openvino.runtime import serialize |
| 45 | + from openvino.runtime import shutdown |
| 46 | + from openvino.runtime import tensor_from_file |
| 47 | + from openvino.runtime import save_model |
| 48 | + from openvino.runtime import layout_helpers |
| 49 | + |
| 50 | + # Set version for openvino package |
| 51 | + from openvino.runtime import get_version |
| 52 | + __version__ = get_version() |
| 53 | +except ImportError: |
| 54 | + import warnings |
| 55 | + warnings.warn("openvino package has problems with imports!", ImportWarning, stacklevel=2) |
| 56 | + |
| 57 | +# Tools |
| 58 | +try: |
| 59 | + # Model Conversion API - ovc should reside in the main namespace |
| 60 | + from openvino.tools.ovc import convert_model |
| 61 | +except ImportError: |
| 62 | + pass |
0 commit comments