Skip to content

Commit

Permalink
Merge pull request #326 from sebassem/ag_manufacturing_patches
Browse files Browse the repository at this point in the history
Ag manufacturing patches - update openVINO
  • Loading branch information
sebassem authored May 19, 2024
2 parents 5e19067 + 00c9c31 commit 2d7d4eb
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ To get started with the "Contoso Motors" Jumpstart Agora scenario, we provided y
|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------|
| [Deployment guide](../contoso_motors/deployment/) | Not applicable | Not applicable |
| [Data pipeline and reporting across cloud and edge](../contoso_motors/data_opc/) | Operational technology (OT) | Azure IoT Operations, Azure Data Explorer, MQTT, Event Grid, Event Hub, AKS Edge Essentials, InfluxDB, MQTT simulators |
| [Web UI and AI Inference flow](../contoso_motors/ai_inferencing/) | Operational technology (OT) | OpenVINO Open Model Zoo, Yolo8, OpenVINO™ Model Server (OVMS), AKS Edge Essentials, RTSP, Flask, OpenCV |
| [Welding defect scenario using OpenVino and Kubernetes](../contoso_motors/welding_defect/) | Welding monitoring | RTSP simulator, OpenVINO™ Model Server (OVMS), AKS Edge Essentials, Flask, OpenCV |
| [Web UI and AI Inference flow](../contoso_motors/ai_inferencing/) | Operational technology (OT) | OpenVINO Open Model Zoo,Yolo8, OpenVINO™ Model Server (OVMS), AKS Edge Essentials, RTSP, Flask, OpenCV |
| [Welding defect scenario using OpenVINO™ and Kubernetes](../contoso_motors/welding_defect/) | Welding monitoring | RTSP simulator, OpenVINO™ Model Server (OVMS), AKS Edge Essentials, Flask, OpenCV |
| [Enabling AI at the edge to enhance workers safety](../contoso_motors/workers_safety/) | Workers safety | RTSP simulator, OpenVINO™ Model Server (OVMS), AKS Edge Essentials, Flask, OpenCV |
| [Infrastructure observability for Kubernetes and Arc-enabled Kubernetes](../contoso_motors/k8s_infra_observability/) | Infrastructure | Arc-enabled Kubernetes, AKS Edge Essentials, Prometheus, Grafana |
| [Infrastructure observability for Arc-enabled servers using Azure Monitor](../contoso_motors/arc_monitoring_servers/) |Infrastructure | Arc-enabled servers, Azure Monitor |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,19 @@ weight: 3
title: Web UI and AI Inference flow
linkTitle: Web UI and AI Inference flow
summary: |
Contoso Motors leverages AI-powered manufacturing with a Kubernetes-based infrastructure which provides a flexible and scalable design that can be easily extended. In this scenario, Contoso Motors wants to implement different AI inferencing models for various use cases, leveraging OpenVINO Model Server (OVMS), a high-performance inference serving software that allows users to deploy and serve multiple AI models. This scenario also explains the architecture of the AI inference flow and the steps involved in the inference/processing.
Contoso Motors leverages AI-powered manufacturing with a Kubernetes-based infrastructure which provides a flexible and scalable design that can be easily extended. In this scenario, Contoso Motors wants to implement different AI inferencing models for various use cases, leveraging OpenVINO Model Server (OVMS), a high-performance inference serving software that allows users to deploy and serve multiple AI models. This scenario also explains the architecture of the AI inference flow and the steps involved in the inference/processing.
serviceOrPlatform: INFRASTRUCTURE
technologyStack:
- AI
- OPENVINO
- OpenVINO™
- AKS EDGE ESSENTIALS
- OPENVINO MODEL SERVER
- OpenVINO™ MODEL SERVER
- RTSP
---

# Web UI and AI Inference

Contoso Motors leverages AI-powered manufacturing with a Kubernetes-based infrastructure which provides a flexible and scalable design that can be easily extended. This document covers how Contoso Motors implements different AI inferencing models for various use cases, leveraging [OpenVINO Model Server (OVMS)](https://docs.openvino.ai/2023.3/ovms_what_is_openvino_model_server.html). The OVMS by Intel, is a high-performance inference serving software that allows users to deploy and serve multiple AI models in a convenient, scalable and efficient manner.
Contoso Motors leverages AI-powered manufacturing with a Kubernetes-based infrastructure which provides a flexible and scalable design that can be easily extended. This document covers how Contoso Motors implements different AI inferencing models for various use cases, leveraging [OpenVINO Model Server (OVMS)](https://docs.openvino.ai/2023.3/ovms_what_is_openvino_model_server.html). The OVMS by Intel, is a high-performance inference serving software that allows users to deploy and serve multiple AI models in a convenient, scalable and efficient manner.

## Architecture

Expand All @@ -26,7 +26,7 @@ The Edge AI inference flow can be divided into two configuration steps and three

1. **Model Downloader:** this is a *Kubernetes Job* that downloads the binary files of the AI models and the corresponding configuration files. Depending on the model type, various formats can be used, such as .onnx, .hd5, .bin, and others. In general, the binary files contain the model weights and architecture, while the configuration files specify the model properties, such as input/output tensor shapes, number of layers, and more.

The models and configurations needed for the OVMS deployment are hosted in a storage account in Azure. During deployment, the **Model Downloader** job pulls these models and configurations by running the ***ovms_config.sh*** script, which downloads all necessary model files and stores them in the **ovms-pvc** persistent volume claim for the OVMS pods to access and serve. All models need to be placed and mounted in a particular directory structure and according to the rules described in [OpenVINO - Model Serving](https://docs.OpenVINO.ai/2022.3/ovms_docs_models_repository.html).
The models and configurations needed for the OVMS deployment are hosted in a storage account in Azure. During deployment, the **Model Downloader** job pulls these models and configurations by running the ***ovms_config.sh*** script, which downloads all necessary model files and stores them in the **ovms-pvc** persistent volume claim for the OVMS pods to access and serve. All models need to be placed and mounted in a particular directory structure and according to the rules described in [OpenVINO - Model Serving](https://docs.openvino.ai/2022.3/ovms_docs_models_repository.html).

For more information, see *[job.yaml](https://github.com/microsoft/jumpstart-agora-apps/blob/main/contoso_manufacturing/operations/charts/ovms/templates/job.yaml)* and *[ovms_config.sh](https://raw.githubusercontent.com/microsoft/jumpstart-agora-apps/manufacturing/contoso_manufacturing/deployment/configs/ovms_config.sh)*.

Expand Down Expand Up @@ -54,17 +54,17 @@ The steps involved in the inference/procressing can be described as follows:

1. **Pre-process and AI inference:** this is the code of the **Web AI Inference and UI** pod that handles the **preprocessing** of the image and sends the processed input to the AI inference server. Each model has it's own Python class ([Yolo8](https://github.com/microsoft/jumpstart-agora-apps/blob/main/contoso_manufacturing/developer/webapp-decode/yolov8.py), [Welding](https://github.com/microsoft/jumpstart-agora-apps/blob/main/contoso_manufacturing/developer/webapp-decode/welding.py) and [Pose Estimator](https://github.com/microsoft/jumpstart-agora-apps/blob/main/contoso_manufacturing/developer/webapp-decode/pose_estimator.py)) that implements the **pre-process**, **post-process** and **run** methods according to the model requirements. Once the input data, generally a **torch** is created, it's then sent to the AI inference server using the [ovmsclient library](https://pypi.org/project/ovmsclient/).

The AI inference server, in our case the [OpenVINO Model Server](https://docs.OpenVINO.ai/2023.3/ovms_what_is_OpenVINO_model_server.html), hosts models and makes them accessible to software components over standard network protocols: a client sends a request to the model server, which performs model inference and sends a response back to the client.
The AI inference server, in our case the [OpenVINO Model Server](https://docs.openvino.ai/2023.3/ovms_what_is_openvino_model_server.html), hosts models and makes them accessible to software components over standard network protocols: a client sends a request to the model server, which performs model inference and sends a response back to the client.

The OVMS model server is configured as part of the helm deployment, using the **OVMS Operator**. The deployment installs the OVMS Operator, sets up the storage for AI models, and configures the OVMS pods and services. For more information about the setup, check [OVMS Helm](https://github.com/microsoft/jumpstart-agora-apps/tree/manufacturing/contoso_manufacturing/operations/charts/ovms).For more information about OVMS Operator, check [OpenVINO Model Server with Kubernetes](https://docs.OpenVINO.ai/archive/2021.4/ovms_docs_kubernetes.html). The OVMS model server is typically deployed as a set of pods. Each pod contains one or more instances of the OVMS software, along with any necessary dependencies. The pods are managed by a Kubernetes controller, which is responsible for ensuring that the desired number of pods are running at all times.
The OVMS model server is configured as part of the helm deployment, using the **OVMS Operator**. The deployment installs the OVMS Operator, sets up the storage for AI models, and configures the OVMS pods and services. For more information about the setup, check [OVMS Helm](https://github.com/microsoft/jumpstart-agora-apps/tree/manufacturing/contoso_manufacturing/operations/charts/ovms).For more information about OVMS Operator, check [OpenVINO Model Server with Kubernetes](https://docs.openvino.ai/archive/2021.4/ovms_docs_kubernetes.html). The OVMS model server is typically deployed as a set of pods. Each pod contains one or more instances of the OVMS software, along with any necessary dependencies. The pods are managed by a Kubernetes controller, which is responsible for ensuring that the desired number of pods are running at all times.

2. **Post-process and UI rendering:** this is the code in the **Web AI Inference and UI** pod is responsible for handling post-processing and final UI rendering for the user. Depending on the model, once the OVMS provides the inference response, post-processing is applied to the image, such as adding labels, bounding boxes, or human skeleton graphs. Once the visual data is added to the frame, it's then served to the UI frontend using a **Flask App** method. For more information on the Flask App, please refer to the [Web UI - app.py](https://github.com/microsoft/jumpstart-agora-apps/blob/main/contoso_manufacturing/developer/webapp-decode/app.py)

## OpenVINO Model Server
## OpenVINO Model Server

The [OpenVINO Model Server](https://www.intel.com/content/www/us/en/developer/articles/technical/deploy-OpenVINO-in-openshift-and-kubernetes.html) by Intel, is a high-performance inference serving software that allows users to deploy and serve AI models. Model serving is taking a trained AI model and making it available to software components over a network API. OVMS offers a native method for exposing models over a gRPC or REST API. Furthermore, it supports various deep learning frameworks such as TensorFlow, PyTorch, OpenVINO and ONNX. By using OvMS developers can easily deploy AI models by specifying the model configuration and the input/output formats.
The [OpenVINO Model Server](https://www.intel.com/content/www/us/en/developer/articles/technical/deploy-openvino-in-openshift-and-kubernetes.html) by Intel, is a high-performance inference serving software that allows users to deploy and serve AI models. Model serving is taking a trained AI model and making it available to software components over a network API. OVMS offers a native method for exposing models over a gRPC or REST API. Furthermore, it supports various deep learning frameworks such as TensorFlow, PyTorch, OpenVINO and ONNX. By using OvMS developers can easily deploy AI models by specifying the model configuration and the input/output formats.

The OpenVINO Model Server offers many advantages for efficient model deployment:
The OpenVINO Model Server offers many advantages for efficient model deployment:

- Remote inference enables using lightweight clients with only the necessary functions to perform API calls to edge or cloud deployments.
- Applications are independent of the model framework, hardware device, and infrastructure.
Expand All @@ -77,4 +77,4 @@ The OpenVINO Model Server offers many advantages for efficient model deployment:

## Next steps

Now that you have completed the data pipeline scenario, it's time to continue to the next scenario, [Welding defect scenario using OpenVino and Kubernetes](../welding_defect/).
Now that you have completed the data pipeline scenario, it's time to continue to the next scenario, [Welding defect scenario using OpenVINO™ and Kubernetes](../welding_defect/).
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
---
type: docs
weight: 4
title: Welding defect scenario using OpenVino and Kubernetes
linkTitle: Welding defect scenario using OpenVino and Kubernetes
title: Welding defect scenario using OpenVINO™ and Kubernetes
linkTitle: Welding defect scenario using OpenVINO™ and Kubernetes
summary: |
The Welding Defect page provides an overview of the welding defect scenario in the Contoso Motors solution. It describes the architecture and flow of information for detecting and classifying welding defects using AI. The page also explains the steps involved in the welding defect inference process, including UI selection, RTSP video simulation, frame capturing, image pre-processing/inferencing, and post-processing/rendering.
serviceOrPlatform: Manufacturing
technologyStack:
- AKS
- OPENVINO
- OpenVINO™
- AI
- AKS EDGE ESSENTIALS
- RTSP
---

# Welding defect scenario using OpenVino and Kubernetes
# Welding defect scenario using OpenVINO™ and Kubernetes

## Overview

Expand Down Expand Up @@ -42,7 +42,7 @@ This diagram shows the welding defect inference flow, which consists of five mai
5. Add a new dimension to the input image at the beginning of the array to create a "batch" of images.
6. Flip the order of the color channels from RGB to BGR.

After the pre-processing step is completed, the final frame data is sent to the OpenVINO model server for inference. This is achieved using gRPC and the [ovmsclient](https://pypi.org/project/ovmsclient/) library, which provides a convenient and efficient way to communicate with the server. The server uses the OpenVINO toolkit to perform the inference process, which involves running the input data through a trained machine learning model to generate predictions or classifications. Once the inference is complete, the results are returned to the client for further processing or display.
After the pre-processing step is completed, the final frame data is sent to the OpenVINO model server for inference. This is achieved using gRPC and the [ovmsclient](https://pypi.org/project/ovmsclient/) library, which provides a convenient and efficient way to communicate with the server. The server uses the OpenVINO toolkit to perform the inference process, which involves running the input data through a trained machine learning model to generate predictions or classifications. Once the inference is complete, the results are returned to the client for further processing or display.

1. **Frame post-processing/rednering:** this is the final step and involves parsing the inference reposnse and apply the required post-process. For this welding model, the post-process involves the following transformations:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ summary: |
serviceOrPlatform: Manufacturing
technologyStack:
- AKS
- OPENVINO
- OpenVINO™
- AI
- AKS EDGE ESSENTIALS
- RTSP
Expand Down Expand Up @@ -39,7 +39,7 @@ This diagram shows the workers safety inference flow, which consists of five mai
4. Transpose the dimensions of the input image from (height, width, channels) to (channels, height, width).
5. Add a new dimension to the input image at the beginning of the array to create a "batch" of images.

After the pre-processing step is completed, the final frame data is sent to the OpenVINO model server for inference. This is achieved using gRPC and the [ovmsclient](https://pypi.org/project/ovmsclient/) library, which provides a convenient and efficient way to communicate with the server. The server uses the OpenVINO toolkit to perform the inference process, which involves running the input data through a trained machine learning model to generate predictions or classifications. Once the inference is complete, the results are returned to the client for further processing or display.
After the pre-processing step is completed, the final frame data is sent to the OpenVINO model server for inference. This is achieved using gRPC and the [ovmsclient](https://pypi.org/project/ovmsclient/) library, which provides a convenient and efficient way to communicate with the server. The server uses the OpenVINO toolkit to perform the inference process, which involves running the input data through a trained machine learning model to generate predictions or classifications. Once the inference is complete, the results are returned to the client for further processing or display.

1. **Frame post-processing/rednering:** this is the final step and involves parsing the inference reposnse and apply the required post-process. For this welding model, the post-process involves the following transformations:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ To get started with the "Contoso Supermarket" Jumpstart Agora scenario, we provi
| [Contoso Supermarket deployment guide](../contoso_supermarket/deployment/) | Not applicable | Not applicable |
| [Data pipeline and reporting across cloud and edge for store orders](../contoso_supermarket/data_pos/) | Point of Sale (PoS) | Cosmos DB, Azure Data Explorer, OSS PostgreSQL, AKS Edge Essentials |
| [Data pipeline and reporting across cloud and edge for sensor telemetry](../contoso_supermarket/freezer_monitor/) | Freezer Monitoring for Food Safety | IoT Hub, Azure Data Explorer, Mosquitto MQTT Broker, Prometheus, Grafana, AKS Edge Essentials |
| [Enabling AI at the Edge & Software configurations rollout with basic GitOps flow](../contoso_supermarket/ai/) | Managers Control Center | AKS Edge Essentials, GitOps (Flux), OSS PostgreSQL, Intel OpenVino Inference Engine |
| [Enabling AI at the Edge & Software configurations rollout with basic GitOps flow](../contoso_supermarket/ai/) | Managers Control Center | AKS Edge Essentials, GitOps (Flux), OSS PostgreSQL, Intel OpenVINO™ Inference Engine |
| [Streamlining the Software Delivery Process using CI/CD](../contoso_supermarket/ci_cd/) | Point of Sale (PoS) | AKS, AKS Edge Essentials, Azure Arc, Flux, GitHub Actions, Azure Container Registry |
| [Infrastructure observability for Kubernetes and Arc-enabled Kubernetes](../contoso_supermarket/k8s_infra_observability/) | Infrastructure | AKS, Arc-enabled Kubernetes, AKS Edge Essentials, Prometheus, Grafana |
| [Infrastructure observability for Arc-enabled servers using Azure Monitor](../contoso_supermarket/arc_monitoring_servers/) | Infrastructure | Arc-enabled servers, Azure Monitor |
Expand Down
Loading

0 comments on commit 2d7d4eb

Please sign in to comment.