Segmentation Example with a PaddlePaddle Model


This guide demonstrates how to run inference requests for PaddlePaddle model with OpenVINO Model Server. As an example, we will use ocrnet-hrnet-w48-paddle to perform segmentation on an image.


  • Docker installed

  • Python 3.7 or newer installed

Preparing to Run

Clone the repository and enter segmentation_using_paddlepaddle_model directory

git clone
cd model_server/demos/segmentation_using_paddlepaddle_model/python

Install paddlepaddle and other packages required to export the model to deployable format

pip3 install paddlepaddle
pip3 install pyyaml
pip3 install scipy
pip3 install opencv-python
pip3 install requests

You can prepare the workspace by just running


Deploying OVMS

Deploy OVMS with vehicles analysis pipeline using the following command:

docker run -p 9000:9000 -d -v ${PWD}/model:/models openvino/model_server --port 9000 --model_path /models --model_name ocrnet

Requesting the Service

Install python dependencies:

pip3 install -r requirements.txt

Now you can run the client:

python3 --grpc_port 9000 --image_input_path ../../common/static/images/cars/road1.jpg --image_output_path ./road2.jpg

Exemplary result of running the demo: