You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+4-2Lines changed: 4 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,7 +11,7 @@
11
11
12
12
## Introduction
13
13
14
-
Model API is a set of wrapper classes for particular tasks and model architectures, simplifying data preprocess and postprocess as well as routine procedures (model loading, asynchronous execution, etc.). It is aimed at simplifying end-to-end model inference. The Model API is based on the OpenVINO inference API.
14
+
Model API is a set of wrapper classes for particular tasks and model architectures, simplifying data preprocess and postprocess as well as routine procedures (model loading, asynchronous execution, etc.). It is aimed at simplifying end-to-end model inference for different deployment scenarios, including local execution and serving. The Model API is based on the OpenVINO inference API.
15
15
16
16
## How it works
17
17
@@ -29,6 +29,7 @@ Training Extensions embed all the metadata required for inference into model fil
29
29
30
30
- Python API
31
31
- Synchronous and asynchronous inference
32
+
- Local inference and serving through the rest API
32
33
- Model preprocessing embedding for faster inference
33
34
34
35
## Installation
@@ -41,6 +42,7 @@ Training Extensions embed all the metadata required for inference into model fil
41
42
from model_api.models import Model
42
43
43
44
# Create a model wrapper from a compatible model generated by OpenVINO Training Extensions
45
+
# Use URL to work with OVMS-served model, e.g. "localhost:9000/models/ssdlite_mobilenet_v2"
There are usecases when it is not possible to modify an internal `ov::Model` and it is hidden behind `InferenceAdapter`. `create_model()` can construct a model from a given `InferenceAdapter`. That approach assumes that the model in `InferenceAdapter` was already configured by `create_model()` called with a string (a path or a model name). It is possible to prepare such model:
57
+
There are usecases when it is not possible to modify an internal `ov::Model` and it is hidden behind `InferenceAdapter`. For example the model can be served using [OVMS](https://github.com/openvinotoolkit/model_server). `create_model()` can construct a model from a given `InferenceAdapter`. That approach assumes that the model in `InferenceAdapter` was already configured by `create_model()` called with a string (a path or a model name). It is possible to prepare such model:
56
58
57
59
```python
58
60
model = DetectionModel.create_model("~/.cache/omz/public/ssdlite_mobilenet_v2/FP16/ssdlite_mobilenet_v2.xml")
This example demonstrates how to use a Python API of OpenVINO Model API for a remote inference of models hosted with [OpenVINO Model Server](https://docs.openvino.ai/latest/ovms_what_is_openvino_model_server.html). This tutorial assumes that you are familiar with Docker subsystem and includes the following steps:
4
+
5
+
- Run Docker image with
6
+
- Instantiate a model
7
+
- Run inference
8
+
- Process results
9
+
10
+
## Prerequisites
11
+
12
+
- Install Model API from source. Please refer to the main [README](../../../README.md) for details.
13
+
- Install Docker. Please refer to the [official documentation](https://docs.docker.com/get-docker/) for details.
14
+
- Install OVMS client into the Python environment:
15
+
16
+
```bash
17
+
pip install ovmsclient
18
+
```
19
+
20
+
- Download a model by running a Python code with Model API, see Python [exaple](../../synchronous_api/README.md) and resave a configured model at OVMS friendly folder layout:
Copy file name to clipboardExpand all lines: src/README.md
+13-1Lines changed: 13 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -79,13 +79,25 @@ The following tasks can be solved with wrappers usage:
79
79
80
80
Model API wrappers are executor-agnostic, meaning it does not implement the specific model inference or model loading, instead it can be used with different executors having the implementation of common interface methods in adapter class respectively.
81
81
82
-
Currently, `OpenvinoAdapter` and `ONNXRuntimeAdapter` are supported.
82
+
Currently, `OpenvinoAdapter` and `OVMSAdapter` are supported.
83
83
84
84
### OpenVINO Adapter
85
85
86
86
`OpenvinoAdapter` hides the OpenVINO™ toolkit API, which allows Model API wrappers launching with models represented in Intermediate Representation (IR) format.
87
87
It accepts a path to either `xml` model file or `onnx` model file.
88
88
89
+
### OpenVINO Model Server Adapter
90
+
91
+
`OVMSAdapter` hides the OpenVINO Model Server python client API, which allows Model API wrappers launching with models served by OVMS.
92
+
93
+
Refer to **[`OVMSAdapter`](adapters/ovms_adapter.md)** to learn about running demos with OVMS.
94
+
95
+
For using OpenVINO Model Server Adapter you need to install the package with extra module:
96
+
97
+
```sh
98
+
pip install <omz_dir>/demos/common/python[ovms]
99
+
```
100
+
89
101
### ONNXRuntime Adapter
90
102
91
103
`ONNXRuntimeAdapter` hides the ONNXRuntime, which Model API wrappers launching with models represented in ONNX format.
0 commit comments