Skip to content

Commit

Permalink
Fixes in documentation (openvinotoolkit#920)
Browse files Browse the repository at this point in the history
* Fixes in documentation

Change TF version in Ensemble example since 1.15 is no longer
available in pip3.

* Update docs/developer_guide.md
  • Loading branch information
atobiszei authored Sep 13, 2021
1 parent dde78fa commit 6a6443c
Show file tree
Hide file tree
Showing 7 changed files with 29 additions and 30 deletions.
4 changes: 2 additions & 2 deletions docs/demultiplexing.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Demultiplexing in Directed Acyclic Graph Scheduler

## Pipeline branching
Directed Acyclic Graph Scheduler allows creating pipelines with optional parameter `demultiply_count: `N` which adds ability to any node to slice outputs into `N` separate sub outputs and branch pipeline execution into `N` sub pipelines. Following nodes will be executed by event loop `N` times independently from each other and results will be gathered and packed into one output just before sending a response. Additionally `gather_from_node: <node_name>` parameter can be used to specify gathering at any point in Directed Acyclic Graph.`demultiply_count` node parameter value has to match first dimension of all node outputs. All node outputs have to have at least 2 dimensions.
Directed Acyclic Graph Scheduler allows creating pipelines with optional parameter `demultiply_count: N` which adds ability to any node to slice outputs into `N` separate sub outputs and branch pipeline execution into `N` sub pipelines. Following nodes will be executed by event loop `N` times independently from each other and results will be gathered and packed into one output just before sending a response. Additionally `gather_from_node: <node_name>` parameter can be used to specify gathering at any point in Directed Acyclic Graph.`demultiply_count` node parameter value has to match first dimension of all node outputs. All node outputs have to have at least 2 dimensions.

## Basic demultiplexer example and metadata explanation
This example contains 2 consecutive models:
Expand All @@ -12,7 +12,7 @@ This example has no `gather_from_node` parameter specified in config.json config

![diagram](demultiplexer.svg)

Example configuration file with one demultiplexer:
Example configuration file with one demultiplexer (remove everything after arrows in lines containing those):
```
{
"model_config_list": [
Expand Down
12 changes: 7 additions & 5 deletions docs/developer_guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,10 @@ In-case of problems, see <a href="#debug">Debugging</a>.
### Step 1: Compile source code
1. Build the development `openvino/model_server-build` Docker* image
```bash
make docker_build
make docker_build
```
or
```
make docker_build DLDT_PACKAGE_URL=<URL>
```
> **Note**: URL to OpenVINO Toolkit package can be received after registration on [OpenVINO&trade; Toolkit website](https://software.intel.com/en-us/openvino-toolkit/choose-download)
Expand Down Expand Up @@ -63,8 +65,8 @@ In-case of problems, see <a href="#debug">Debugging</a>.
* With a Docker cache :

```bash
OVMS_CPP_DOCKER_IMAGE=<unique_image_name> make docker_build
OVMS_CPP_DOCKER_IMAGE=<unique_image_name> make test_functional
OVMS_CPP_DOCKER_IMAGE=<replace_with_unique_image_name> make docker_build
OVMS_CPP_DOCKER_IMAGE=<replace_with_unique_image_name> make test_functional
OVMS_CPP_CONTAINTER_PORT=<unique_network_port> make test_perf
```

Expand Down Expand Up @@ -265,10 +267,10 @@ Two debugging options are available. Click on the required option :
```
docker run -it --cap-add=SYS_PTRACE --security-opt seccomp=unconfined -v ${PWD}:/ovms -p 9178:9178 --entrypoint bash openvino/model_server-build:latest
```
3. Recompile the OpenVINO Model Server with debug symbols using command.
3. Assuming resnet50 model is prepared for OVMS in /models catalog recompile the OpenVINO Model Server with debug symbols using command:
```
[root@72dc3b874772 ovms]# bazel build //src:ovms -c dbg
[root@72dc3b874772 ovms]# gdb --args ./bazel-bin/src/ovms --model_name resnet --model_path /model
[root@72dc3b874772 ovms]# gdb --args ./bazel-bin/src/ovms --model_name resnet --model_path /models
```
> **NOTE**: For best results, use the makefile parameter `BAZEL_BUILD_TYPE=dbg` to build the dependencies in debug mode as shown above

Expand Down
4 changes: 2 additions & 2 deletions docs/east_ocr.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Below is depicted the graph implementing a complete OCR pipelines.

![OCR graph](east_ocr.png)

It includes the following Nodes:
It includes the following nodes:
- Model east-resnet50 - inference execution which takes the user image as input. It returns two outputs including information about all detected boxes, their location and scores.
- Custom node east_ocr - it includes C++ implementation of east-resnet50 model results processing. It analyses the detected boxes coordinates, filters the results
based on the configurable score level threshold and and applies non-max suppression algorithm to remove overlaping boxes. Finally the custom node east-ocr crops all detected boxes
Expand All @@ -35,7 +35,7 @@ Clone github repository:
git clone https://github.com/argman/EAST
cd EAST
```
Download and unzip the file east_icdar2015_resnet_v1_50_rbox.zip to EAST folder with the github repository.
Download and unzip the file east_icdar2015_resnet_v1_50_rbox.zip as instructed in readme.md file to EAST folder with the github repository.
```bash
unzip ./east_icdar2015_resnet_v1_50_rbox.zip
```
Expand Down
29 changes: 13 additions & 16 deletions docs/ensemble_scheduler.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ This document presents ensemble models as an example of [DAG Scheduler](dag_sche
```
~$ virtualenv -p python3 .tf_env
~$ source .tf_env/bin/activate
~$ pip3 install tensorflow==1.15
~$ pip3 install tensorflow==2.3.1
```
3. Prepare argmax model with `(1, 1001)` input shapes to match output of googlenet and resnet output shapes. Generated model will sum inputs and calculate the index with the highest value. The model output will indicate the most likely predicted class from the ImageNet* dataset. <a name="point-3"></a>
```
Expand All @@ -39,56 +39,53 @@ This document presents ensemble models as an example of [DAG Scheduler](dag_sche
~$ docker run -u $(id -u):$(id -g) -v ~/models:/models:rw openvino/ubuntu18_dev:latest deployment_tools/open_model_zoo/tools/downloader/converter.py --name resnet-50-tf --download_dir /models --output_dir /models --precisions FP32
~$ docker run -u $(id -u):$(id -g) -v ~/models:/models:rw openvino/ubuntu18_dev:latest deployment_tools/model_optimizer/mo_tf.py --input input1,input2 --input_shape [1,1001],[1,1001] --saved_model_dir /models/public/argmax/saved_model/ --output_dir /models/public/argmax/1
~$ mv ~/models/public/googlenet-v2-tf/FP32 ~/models/public/googlenet-v2-tf/1 && mv ~/models/public/resnet-50-tf/FP32 ~/models/public/resnet-50-tf/1
~$ mkdir -p ovms_models/googlenet-v2-tf/1
~$ mkdir -p ovms_models/resnet-50-tf/1
~$ mkdir -p ovms_models/argmax/1
~$ cp ~/models/public/googlenet-v2-tf/FP32/googlenet-v2-tf.{bin,xml} ~/ovms_models/googlenet-v2-tf/1/
~$ cp ~/models/public/resnet-50-tf/FP32/resnet-50-tf.{bin,xml} ~/ovms_models/resnet-50-tf/1/
~$ cp ~/models/public/argmax/1/saved_model.{bin,xml} ~/ovms_models/argmax/1/
~$ tree models/public
models/public
ovms_models
├── argmax
│ ├── 1
│ │ ├── saved_model.bin
│ │ ├── saved_model.mapping
│ │ └── saved_model.xml
│ └── saved_model
│ ├── saved_model.pb
│ └── variables
├── googlenet-v2-tf
│ ├── 1
│ │ ├── googlenet-v2-tf.bin
│ │ ├── googlenet-v2-tf.mapping
│ │ └── googlenet-v2-tf.xml
│ └── inception_v2.frozen.pb
└── resnet-50-tf
├── 1
│ ├── resnet-50-tf.bin
│ ├── resnet-50-tf.mapping
│ └── resnet-50-tf.xml
└── resnet_v1-50.pb
```

### Step 2: Define required models and pipeline <a name="define-models"></a>
Pipelines need to be defined in configuration file to use them. The same configuration file is used to define served models and served pipelines.

Use the config.json as given below
```
~$ cat models/config.json
~$ cat ovms_models/config.json
{
"model_config_list": [
{
"config": {
"name": "googlenet",
"base_path": "/models/public/googlenet-v2-tf"
"base_path": "/models/googlenet-v2-tf"
}
},
{
"config": {
"name": "resnet",
"base_path": "/models/public/resnet-50-tf"
"base_path": "/models/resnet-50-tf"
}
},
{
"config": {
"name": "argmax",
"base_path": "/models/public/argmax"
"base_path": "/models/argmax"
}
}
],
Expand Down Expand Up @@ -155,7 +152,7 @@ In `model_config_list` section, three models are defined as usual. We can refer

1. Run command to start model server
```
~$ docker run --rm -v ~/models/:/models:ro -p 9100:9100 -p 8100:8100 openvino/model_server:latest --config_path /models/config.json --port 9100 --rest_port 8100
~$ docker run --rm -v ~/ovms_models/:/models:ro -p 9100:9100 -p 8100:8100 openvino/model_server:latest --config_path /models/config.json --port 9100 --rest_port 8100
```

### Step 4: Requesting the service
Expand Down
4 changes: 2 additions & 2 deletions docs/model_version_policy.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ Accepted values :

Examples:

{"latest": { "num_versions":2 }} # server will serve only 2 latest versions of model
{"latest": { "num_versions": 2 }} # server will serve only 2 latest versions of model

{"specific": { "versions":[1, 3] }} # server will serve only 1 and 3 versions of given model
{"specific": { "versions": [1, 3] }} # server will serve only 1 and 3 versions of given model

{"all": {}} # server will serve all available versions of given model

Expand Down
4 changes: 2 additions & 2 deletions example_client/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -397,9 +397,9 @@ usage: get_serving_meta.py [-h] [--grpc_address GRPC_ADDRESS]
| Argument | Description |
| :--- | :---- |
| -h, --help | Show help message and exit|
| --rest_url REST_URL | Specify url to REST API service. Default:http://localhost|
| --rest_url REST_URL | Specify url to REST API service. Default: http://localhost|
| --rest_port REST_PORT | Specify port to REST API service. Default: 9000|
| --model_name MODEL_NAME| Model name to query, must be same as is in service. Default : resnet|
| --model_name MODEL_NAME| Model name to query, must be same as is in service. Default: resnet|
| --model_version MODEL_VERSION | Model version to query - must be numerical. List all version if omitted|

- Usage Example
Expand Down
2 changes: 1 addition & 1 deletion tests/models/argmax_sum.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
# limitations under the License.
#

import tensorflow as tf
import tensorflow.compat.v1 as tf
from tensorflow.python.saved_model import signature_constants
from tensorflow.python.saved_model import tag_constants
import numpy as np
Expand Down

0 comments on commit 6a6443c

Please sign in to comment.