# Deploy with Helm ## Prerequisites - [System Requirements](./vision-system-requirements.md) - **Kubernetes Cluster**: Ensure you have a properly installed and configured Kubernetes cluster. - **Tools Installed**: Install the required tools: - Kubernetes CLI (kubectl) - Helm 3 or later - For Helm installation, refer to [Helm website](https://helm.sh/docs/intro/install/) - **Intel NFD and Device Plugins** (required for GPU/NPU workloads): Install [Node Feature Discovery (NFD)](https://github.com/intel/intel-device-plugins-for-kubernetes) and the Intel GPU/NPU device plugins to enable hardware detection and scheduling. This ensures pods requesting GPU or NPU resources are only deployed on nodes with available hardware. Refer to [release tags](https://github.com/intel/intel-device-plugins-for-kubernetes/tags) for available versions (tested with `v0.35.0`): ```bash # Pick a release version compatible with your cluster export RELEASE_VERSION=v0.35.0 # Step 1: Create namespace for the Intel device plugins kubectl create namespace intel-device-plugins # Step 2: Allow privileged pods in the device plugin namespace # Required because the plugin needs hostPath mounts and access to host device files. kubectl label namespace intel-device-plugins \ pod-security.kubernetes.io/enforce=privileged \ pod-security.kubernetes.io/audit=privileged \ pod-security.kubernetes.io/warn=privileged \ --overwrite # Step 3: Install Node Feature Discovery (NFD) # NFD uses its own namespace: node-feature-discovery kubectl apply -k "https://github.com/intel/intel-device-plugins-for-kubernetes/deployments/nfd?ref=${RELEASE_VERSION}" # Step 4: Allow privileged pods in the NFD namespace kubectl label namespace node-feature-discovery \ pod-security.kubernetes.io/enforce=privileged \ pod-security.kubernetes.io/audit=privileged \ pod-security.kubernetes.io/warn=privileged \ --overwrite # Step 5: Install Intel GPU NodeFeatureRules # These rules let NFD detect and label Intel GPU nodes. kubectl apply -k "https://github.com/intel/intel-device-plugins-for-kubernetes/deployments/nfd/overlays/node-feature-rules?ref=${RELEASE_VERSION}" # Step 6: Verify NFD pods are running kubectl get pods -n node-feature-discovery # Step 7: Verify the node got Intel GPU and NPU labels kubectl get node $(hostname) --show-labels | tr ',' '\n' | grep intel # Step 8: Install the Intel GPU device plugin kubectl apply -n intel-device-plugins -k "https://github.com/intel/intel-device-plugins-for-kubernetes/deployments/gpu_plugin/overlays/nfd_labeled_nodes?ref=${RELEASE_VERSION}" # Step 9: Install the Intel NPU device plugin kubectl apply -n intel-device-plugins -k "https://github.com/intel/intel-device-plugins-for-kubernetes/deployments/npu_plugin/overlays/nfd_labeled_nodes?ref=${RELEASE_VERSION}" ``` Verify the Intel Device Plugin pods are running: ```bash kubectl get pods -n intel-device-plugins ``` Verify the GPU and NPU resources are advertised on nodes: ```bash kubectl get nodes -o json | jq '.items[] | {name: .metadata.name, gpu: .status.allocatable["gpu.intel.com/i915"], npu: .status.allocatable["npu.intel.com/accel"]}' ``` > **Note:** If your node uses Intel Xe discrete GPUs (Arc), set `gpu:` to `.status.allocatable["gpu.intel.com/xe"]`. ## Set up the Application > **Note:** The following instructions assume Kubernetes is already running in the host system with Helm package manager installed. 1. Clone the **edge-ai-suites** repository and change into industrial-edge-insights-vision directory. The directory contains the utility scripts required in the instructions that follow. ```sh git clone https://github.com/open-edge-platform/edge-ai-suites.git -b main cd edge-ai-suites/manufacturing-ai-suite/industrial-edge-insights-vision/ ``` 2. Set application-specific values in the `values.yaml` file. ::::{tab-set} :::{tab-item} **Pallet Defect Detection** :sync: pallet-detect ```sh cp helm/values_pallet-defect-detection.yaml helm/values.yaml ``` ::: :::{tab-item} **PCB Anomaly Detection** :sync: pcb-detect ```sh cp helm/values_pcb-anomaly-detection.yaml helm/values.yaml ``` ::: :::: 3. Optional: Pull the Helm chart and replace the existing Helm folder with it. > **Note:** Download the Helm chart if you are not using the Helm chart provided in > `edge-ai-suites/manufacturing-ai-suite/industrial-edge-insights-vision/helm` - Download the Helm chart with the following command: ::::{tab-set} :::{tab-item} **Pallet Defect Detection** :sync: pallet-detect ```bash helm pull oci://registry-1.docker.io/intel/pallet-defect-detection-reference-implementation --version 2.7.0 ``` ::: :::{tab-item} **PCB Anomaly Detection** :sync: pcb-detect ```bash helm pull oci://registry-1.docker.io/intel/pcb-anomaly-detection --version 1.3.0 ``` ::: :::: - Extract the package using the following command: ::::{tab-set} :::{tab-item} **Pallet Defect Detection** :sync: pallet-detect ```bash tar -xvf pallet-defect-detection-reference-implementation-2.7.0.tgz ``` ::: :::{tab-item} **PCB Anomaly Detection** :sync: pcb-detect ```bash tar -xvf pcb-anomaly-detection-1.3.0.tgz ``` ::: :::: - Replace the `helm` directory: ::::{tab-set} :::{tab-item} **Pallet Defect Detection** :sync: pallet-detect ```bash rm -rf helm && mv pallet-defect-detection-reference-implementation helm ``` ::: :::{tab-item} **PCB Anomaly Detection** :sync: pcb-detect ```bash rm -rf helm && mv pcb-anomaly-detection helm ``` ::: :::: 4. Edit the HOST_IP, proxy and other environment variables in `helm/values.yaml` as follows: ::::{tab-set} :::{tab-item} **Pallet Defect Detection** :sync: pallet-detect ```yaml env: HOST_IP: # host IP address MINIO_ACCESS_KEY: # example: minioadmin MINIO_SECRET_KEY: # example: minioadmin http_proxy: # proxy details if behind proxy https_proxy: SAMPLE_APP: pallet-defect-detection # application directory webrtcturnserver: username: # WebRTC credentials e.g. intel1234 password: ``` ::: :::{tab-item} **PCB Anomaly Detection** :sync: pcb-detect ```yaml env: HOST_IP: # host IP address MINIO_ACCESS_KEY: # example: minioadmin MINIO_SECRET_KEY: # example: minioadmin http_proxy: # proxy details if behind proxy https_proxy: SAMPLE_APP: pcb-anomaly-detection # application directory webrtcturnserver: username: # WebRTC credentials e.g. intel1234 password: ``` ::: :::: > **Note:** To run the pipeline on GPU, set `gpu.enabled:true` in `values.yaml`. To run the pipeline on NPU, set `npu.enabled:true` - this also requires a GPU resource since NPU pipelines use VA-API (GPU) for video decoding. For Intel Arc (Xe) discrete GPUs, set `gpu.type: "gpu.intel.com/xe"`. 5. Install prerequisites. Run with sudo if needed. ```sh ./setup.sh helm ``` This sets up the application prerequisites, downloads artifacts, sets executable permissions for scripts, etc., and downloads resource directories. ## Deploy the application 1. Install the helm chart ```sh helm install app-deploy helm -n apps --create-namespace ``` After installation, check the status of the running pods: ```sh kubectl get pods -n apps ``` To view logs of a specific pod, replace `` with the actual pod name from the output above: ```sh kubectl logs -n apps -f ``` 2. Copy the resources such as video and model from local directory to the `dlstreamer-pipeline-server` pod to make them available for application while launching pipelines. ::::{tab-set} :::{tab-item} **Pallet Defect Detection** :sync: pallet-detect ```sh POD_NAME=$(kubectl get pods -n apps -o jsonpath='{.items[*].metadata.name}' | tr ' ' '\n' | grep deployment-dlstreamer-pipeline-server | head -n 1) kubectl cp resources/pallet-defect-detection/videos/warehouse.avi $POD_NAME:/home/pipeline-server/resources/videos/ -c dlstreamer-pipeline-server -n apps kubectl cp resources/pallet-defect-detection/models/* $POD_NAME:/home/pipeline-server/resources/models/ -c dlstreamer-pipeline-server -n apps ``` ::: :::{tab-item} **PCB Anomaly Detection** :sync: pcb-detect ```sh POD_NAME=$(kubectl get pods -n apps -o jsonpath='{.items[*].metadata.name}' | tr ' ' '\n' | grep deployment-dlstreamer-pipeline-server | head -n 1) kubectl cp resources/pcb-anomaly-detection/videos/anomalib_pcb_test.avi $POD_NAME:/home/pipeline-server/resources/videos/ -c dlstreamer-pipeline-server -n apps kubectl cp resources/pcb-anomaly-detection/models/* $POD_NAME:/home/pipeline-server/resources/models/ -c dlstreamer-pipeline-server -n apps ``` ::: :::: 3. Fetch the list of pipeline loaded available to launch ```sh ./sample_list.sh helm ``` This lists the pipeline loaded in DL Streamer Pipeline Server. Example output: ::::{tab-set} :::{tab-item} Pallet Defect Detection :sync: pallet-detect ```text Environment variables loaded from /manufacturing-ai-suite/industrial-edge-insights-vision/.env Running sample app: pallet-defect-detection Checking status of dlstreamer-pipeline-server... Server reachable. HTTP Status Code: 200 Loaded pipelines: [ ... { "description": "DL Streamer Pipeline Server pipeline", "name": "user_defined_pipelines", "parameters": { "properties": { "detection-properties": { "element": { "format": "element-properties", "name": "detection" } } }, "type": "object" }, "type": "GStreamer", "version": "pallet_defect_detection" } ... ] ``` ::: :::{tab-item} PCB Anomaly Detection :sync: pcb-detect ```text Environment variables loaded from /manufacturing-ai-suite/industrial-edge-insights-vision/.env Running sample app: pcb-anomaly-detection Checking status of dlstreamer-pipeline-server... Server reachable. HTTP Status Code: 200 Loaded pipelines: [ ... { "description": "DL Streamer Pipeline Server pipeline", "name": "user_defined_pipelines", "parameters": { "properties": { "classification-properties": { "element": { "format": "element-properties", "name": "classification" } } }, "type": "object" }, "type": "GStreamer", "version": "pcb_anomaly_detection" } ... ] ``` ::: :::: 4. Start the sample application with a pipeline. ::::{tab-set} :::{tab-item} **Pallet Defect Detection** :sync: pallet-detect ```sh ./sample_start.sh helm -p pallet_defect_detection ``` ::: :::{tab-item} **PCB Anomaly Detection** :sync: pcb-detect ```sh ./sample_start.sh helm -p pcb_anomaly_detection ``` ::: :::: This command looks for the payload for the pipeline specified in `-p` argument above, inside the `payload.json` file and launches a pipeline instance in DL Streamer Pipeline Server. Refer to the table to learn about different options available. Example output: ::::{tab-set} :::{tab-item} Pallet Defect Detection :sync: pallet-detect ```sh Environment variables loaded from /manufacturing-ai-suite/industrial-edge-insights-vision/.env Running sample app: pallet-defect-detection Checking status of dlstreamer-pipeline-server... Server reachable. HTTP Status Code: 200 Loading payload from /manufacturing-ai-suite/industrial-edge-insights-vision/helm/apps/pallet-defect-detection/payload.json Payload loaded successfully. Starting pipeline: pallet_defect_detection Launching pipeline: pallet_defect_detection Extracting payload for pipeline: pallet_defect_detection Found 1 payload(s) for pipeline: pallet_defect_detection Payload for pipeline 'pallet_defect_detection' {"source":{"uri":"file:///home/pipeline-server/resources/videos/warehouse.avi","type":"uri"},"destination":{"frame":{"type":"webrtc","peer-id":"pdd"}},"parameters":{"detection-properties":{"model":"/home/pipeline-server/resources/models/models/pallet-defect-detection/model.xml","device":"CPU"}}} Posting payload to REST server at http://:30107/pipelines/user_defined_pipelines/pallet_defect_detection Payload for pipeline 'pallet_defect_detection' posted successfully. Response: "99ac50d852b511f09f7c2242868ff651" ``` ::: :::{tab-item} PCB Anomaly Detection :sync: pcb-detect ```sh Environment variables loaded from /manufacturing-ai-suite/industrial-edge-insights-vision/.env Running sample app: pcb-anomaly-detection Checking status of dlstreamer-pipeline-server... Server reachable. HTTP Status Code: 200 Loading payload from /manufacturing-ai-suite/industrial-edge-insights-vision/apps/pcb-anomaly-detection/payload.json Payload loaded successfully. Starting pipeline: pcb_anomaly_detection Launching pipeline: pcb_anomaly_detection Extracting payload for pipeline: pcb_anomaly_detection Found 1 payload(s) for pipeline: pcb_anomaly_detection Payload for pipeline 'pcb_anomaly_detection' {"source":{"uri":"file:///home/pipeline-server/resources/videos/anomalib_pcb_test.avi","type":"uri"},"destination":{"frame":{"type":"webrtc","peer-id":"anomaly"}},"parameters":{"classification-properties":{"model":"/home/pipeline-server/resources/models/pcb-anomaly-detection/deployment/Anomaly classification/model/model.xml","device":"CPU"}}} Posting payload to REST server at http://:8080/pipelines/user_defined_pipelines/pcb_anomaly_detection Payload for pipeline 'pcb_anomaly_detection' posted successfully. Response: "f0c0b5aa5d4911f0bca7023bb629a486" ``` ::: :::: > **Note:** This starts the pipeline. You can view the inference stream on WebRTC by opening a browser and navigating to `https://:30443/mediamtx/pdd/` for Pallet Defect Detection. If you are running Helm using an `NGINX_HTTPS_PORT` other than the default 30443, replace 30443 with ``. ### Start GPU- and NPU-Based Pipelines For GPU- and NPU-based pipelines, ensure you have done the necessary [setup](../how-to-guides/use-gpu-for-inference.md#deploying-with-helm) from here, and start the respective pipelines. ::::{tab-set} :::{tab-item} Pallet Defect Detection :sync: pallet-detect **For GPU-based pipelines:** ```sh ./sample_start.sh helm -p pallet_defect_detection_gpu ``` **For NPU-based pipelines:** ```sh ./sample_start.sh helm -p pallet_defect_detection_npu ``` ::: :::{tab-item} PCB Anomaly Detection :sync: pcb-detect **For GPU-based pipelines:** ```sh ./sample_start.sh helm -p pcb_anomaly_detection_gpu ``` **For NPU-based pipelines:** ```sh ./sample_start.sh helm -p pcb_anomaly_detection_npu ``` ::: :::: 1. Get the status of pipeline instance(s) running. ```sh ./sample_status.sh helm ``` This command lists the status of pipeline instances launched during the lifetime of the sample application. Example output: ::::{tab-set} :::{tab-item} Pallet Defect Detection :sync: pallet-detect ```text Environment variables loaded from /manufacturing-ai-suite/industrial-edge-insights-vision/.env Running sample app: pallet-defect-detection [ { "avg_fps": 30.00446179356829, "elapsed_time": 36.927825689315796, "id": "99ac50d852b511f09f7c2242868ff651", "message": "", "start_time": 1750956469.620569, "state": "RUNNING" } ] ``` ::: :::{tab-item} PCB Anomaly Detection :sync: pcb-detect ```text Environment variables loaded from /manufacturing-ai-suite/industrial-edge-insights-vision/.env Running sample app: pcb-anomaly-detection [ { "avg_fps": 24.123323428597942, "elapsed_time": 9.865960359573364, "id": "f0c0b5aa5d4911f0bca7023bb629a486", "message": "", "start_time": 1752123260.5558383, "state": "RUNNING" } ] ``` ::: :::: 2. Stop pipeline instance. ```sh ./sample_stop.sh helm ``` This command will stop all instances that are currently in `RUNNING` state and respond with the last status. Example output: ::::{tab-set} :::{tab-item} Pallet Defect Detection :sync: pallet-detect ```text No pipelines specified. Stopping all pipeline instances Environment variables loaded from /manufacturing-ai-suite/industrial-edge-insights-vision/.env Running sample app: pallet-defect-detection Checking status of dlstreamer-pipeline-server... Server reachable. HTTP Status Code: 200 Instance list fetched successfully. HTTP Status Code: 200 Found 1 running pipeline instances. Stopping pipeline instance with ID: 99ac50d852b511f09f7c2242868ff651 Pipeline instance with ID '99ac50d852b511f09f7c2242868ff651' stopped successfully. Response: { "avg_fps": 30.01631239459745, "elapsed_time": 49.30651903152466, "id": "99ac50d852b511f09f7c2242868ff651", "message": "", "start_time": 1750960037.1471195, "state": "RUNNING" } ``` ::: :::{tab-item} PCB Anomaly Detection :sync: pcb-detect ```text No pipelines specified. Stopping all pipeline instances Environment variables loaded from /manufacturing-ai-suite/industrial-edge-insights-vision/.env Running sample app: pcb-anomaly-detection Checking status of dlstreamer-pipeline-server... Server reachable. HTTP Status Code: 200 Instance list fetched successfully. HTTP Status Code: 200 Found 1 running pipeline instances. Stopping pipeline instance with ID: f0c0b5aa5d4911f0bca7023bb629a486 Pipeline instance with ID 'f0c0b5aa5d4911f0bca7023bb629a486' stopped successfully. Response: { "avg_fps": 26.487679514091333, "elapsed_time": 25.634552478790283, "id": "f0c0b5aa5d4911f0bca7023bb629a486", "message": "", "start_time": 1752123260.5558383, "state": "RUNNING" } ``` ::: :::: If you wish to stop a specific instance, you can provide it with an `--id` argument to the command. For example, `./sample_stop.sh helm --id 99ac50d852b511f09f7c2242868ff651` 3. Uninstall the Helm chart. ```sh helm uninstall app-deploy -n apps ``` ## Store Frames to S3 Storage Applications can take advantage of the S3 publish feature from DL Streamer Pipeline Server and use it to save frames to an S3 compatible storage. 1. Run the steps in the [section](#set-up-the-application) above to set up the application. 2. Install the Helm chart. ```sh helm install app-deploy helm -n apps --create-namespace ``` 3. Copy the resources such as video and model from local directory to the `dlstreamer-pipeline-server` pod to make them available for application while launching pipelines. ::::{tab-set} :::{tab-item} **Pallet Defect Detection** :sync: pallet-detect ```sh POD_NAME=$(kubectl get pods -n apps -o jsonpath='{.items[*].metadata.name}' | tr ' ' '\n' | grep deployment-dlstreamer-pipeline-server | head -n 1) kubectl cp resources/pallet-defect-detection/videos/warehouse.avi $POD_NAME:/home/pipeline-server/resources/videos/ -c dlstreamer-pipeline-server -n apps kubectl cp resources/pallet-defect-detection/models/* $POD_NAME:/home/pipeline-server/resources/models/ -c dlstreamer-pipeline-server -n apps ``` ::: :::{tab-item} **PCB Anomaly Detection** :sync: pcb-detect ```sh POD_NAME=$(kubectl get pods -n apps -o jsonpath='{.items[*].metadata.name}' | tr ' ' '\n' | grep deployment-dlstreamer-pipeline-server | head -n 1) kubectl cp resources/pcb-anomaly-detection/videos/anomalib_pcb_test.avi $POD_NAME:/home/pipeline-server/resources/videos/ -c dlstreamer-pipeline-server -n apps kubectl cp resources/pcb-anomaly-detection/models/* $POD_NAME:/home/pipeline-server/resources/models/ -c dlstreamer-pipeline-server -n apps ``` ::: :::: 4. Install the package `boto3` in your Python environment if not installed. This guide recommends creating a virtual environment and installing it there. You can run the following commands to add the necessary dependencies as well as create and activate the environment. ```sh sudo apt update && \ sudo apt install -y python3 python3-pip python3-venv ``` ```sh python3 -m venv venv && \ source venv/bin/activate ``` Once the environment is ready, install `boto3` with the following command ```sh pip3 install --upgrade pip && \ pip3 install boto3==1.36.17 ``` > **Note:** DL Streamer Pipeline Server expects the bucket to be already present in the database. The next step will help you create one. 5. Create an S3 bucket using the following script. Update the `host_IP` and credentials with that of the running MinIO server. Use `create_bucket.py` as the file name. ```python import boto3 url = "http://:30800" user = "" password = "" bucket_name = "ecgdemo" client= boto3.client( "s3", endpoint_url=url, aws_access_key_id=user, aws_secret_access_key=password ) client.create_bucket(Bucket=bucket_name) buckets = client.list_buckets() print("Buckets:", [b["Name"] for b in buckets.get("Buckets", [])]) ``` Run the above script to create the bucket. ```sh python3 create_bucket.py ``` 6. Start the pipeline with the following cURL command, with `` set to system IP address. Give the correct path to the model as seen below. > **Note:** If you are running Helm using an NGINX_HTTPS_PORT other than the default 30443, replace `30443` with ``. ::::{tab-set} :::{tab-item} **Pallet Defect Detection** :sync: pallet-detect ```sh curl -k https://:30443/api/pipelines/user_defined_pipelines/pallet_defect_detection_s3write -X POST -H 'Content-Type: application/json' -d '{ "source": { "uri": "file:///home/pipeline-server/resources/videos/warehouse.avi", "type": "uri" }, "destination": { "frame": { "type": "webrtc", "peer-id": "pdds3" } }, "parameters": { "detection-properties": { "model": "/home/pipeline-server/resources/models/pallet-defect-detection/deployment/Detection/model/model.xml", "device": "CPU" } } }' ``` ::: :::{tab-item} **PCB Anomaly Detection** :sync: pcb-detect ```sh curl -k https://:30443/api/pipelines/user_defined_pipelines/pcb_anomaly_detection_s3write -X POST -H 'Content-Type: application/json' -d '{ "source": { "uri": "file:///home/pipeline-server/resources/videos/anomalib_pcb_test.avi", "type": "uri" }, "destination": { "frame": { "type": "webrtc", "peer-id": "anomaly_s3" } }, "parameters": { "classification-properties": { "model": "/home/pipeline-server/resources/models/pcb-anomaly-detection/deployment/Anomaly classification/model/model.xml", "device": "CPU" } } }' ``` ::: :::: 7. Go to MinIO console on `https://:30443/minio/` and login with `MINIO_ACCESS_KEY` and `MINIO_SECRET_KEY` provided in `helm/values.yaml` file. After logging into console, you can go to `ecgdemo` bucket and check the frames stored. > **Note:** If you are running Helm using an NGINX_HTTPS_PORT other than the default 30443, replace 30443 with . ![S3 minio image storage](../_assets/s3-minio-storage.png) 8. Uninstall the Helm chart. ```sh helm uninstall app-deploy -n apps ``` ## MLOps using Model Download 1. Run the steps mentioned in the [section](#set-up-the-application) above to set up the application. 2. Install the Helm chart ```sh helm install app-deploy helm -n apps --create-namespace ``` 3. Copy the resources such as video and model from local directory to the `dlstreamer-pipeline-server` pod to make them available for application while launching pipelines. ::::{tab-set} :::{tab-item} **Pallet Defect Detection** :sync: pallet-detect ```sh POD_NAME=$(kubectl get pods -n apps -o jsonpath='{.items[*].metadata.name}' | tr ' ' '\n' | grep deployment-dlstreamer-pipeline-server | head -n 1) kubectl cp resources/pallet-defect-detection/videos/warehouse.avi $POD_NAME:/home/pipeline-server/resources/videos/ -c dlstreamer-pipeline-server -n apps kubectl cp resources/pallet-defect-detection/models/* $POD_NAME:/home/pipeline-server/resources/models/ -c dlstreamer-pipeline-server -n apps ``` ::: :::{tab-item} **PCB Anomaly Detection** :sync: pcb-detect ```sh POD_NAME=$(kubectl get pods -n apps -o jsonpath='{.items[*].metadata.name}' | tr ' ' '\n' | grep deployment-dlstreamer-pipeline-server | head -n 1) kubectl cp resources/pcb-anomaly-detection/videos/anomalib_pcb_test.avi $POD_NAME:/home/pipeline-server/resources/videos/ -c dlstreamer-pipeline-server -n apps kubectl cp resources/pcb-anomaly-detection/models/* $POD_NAME:/home/pipeline-server/resources/models/ -c dlstreamer-pipeline-server -n apps ``` ::: :::: 4. Modify the payload in `helm/apps//payload.json` to launch an instance for the MLOps pipeline. `` stands for the `pallet-defect-detection` or `pcb-anomaly-detection` folder. ::::{tab-set} :::{tab-item} **Pallet Defect Detection** :sync: pallet-detect ```json [ { "pipeline": "pallet_defect_detection_mlops", "payload":{ "source": { "uri": "file:///home/pipeline-server/resources/videos/warehouse.avi", "type": "uri" }, "destination": { "frame": { "type": "webrtc", "peer-id": "pdd" } }, "parameters": { "detection-properties": { "model": "/home/pipeline-server/resources/models/pallet-defect-detection/deployment/Detection/model/model.xml", "device": "CPU" } } } } ] ``` ::: :::{tab-item} **PCB Anomaly Detection** :sync: pcb-detect ```json [ { "pipeline": "pcb_anomaly_detection_mlops", "payload":{ "source": { "uri": "file:///home/pipeline-server/resources/videos/anomalib_pcb_test.avi", "type": "uri" }, "destination": { "frame": { "type": "webrtc", "peer-id": "anomaly" } }, "parameters": { "classification-properties": { "model": "/home/pipeline-server/resources/models/pcb-anomaly-detection/deployment/Anomaly classification/model/model.xml", "device": "CPU" } } } } ] ``` ::: :::: 5. Start the pipeline with the above payload. ::::{tab-set} :::{tab-item} **Pallet Defect Detection** :sync: pallet-detect ```sh ./sample_start.sh helm -p pallet_defect_detection_mlops ``` ::: :::{tab-item} **PCB Anomaly Detection** :sync: pcb-detect ```sh ./sample_start.sh helm -p pcb_anomaly_detection_mlops ``` ::: :::: > **Note:** Note the instance-id. 6. Download and prepare the model. > **Note:** For the sake of simplicity, assume that the new model has already been downloaded by the Model Download microservice. The following curl command is only a simulation that just downloads the model. In production, however, they will be downloaded by the Model Download service. ::::{tab-set} :::{tab-item} **Pallet Defect Detection** :sync: pallet-detect ```sh export MODEL_URL='https://github.com/open-edge-platform/edge-ai-resources/raw/06bb0d621cb14a1791672552a538beddddcc4066/models/INT8/pallet_defect_detection.zip' curl -L "$MODEL_URL" -o "$(basename $MODEL_URL)" unzip "$(basename $MODEL_URL)" -d new-model # downloaded model is now extracted to `new-model` directory. ``` ::: :::{tab-item} **PCB Anomaly Detection** :sync: pcb-detect ```sh export MODEL_URL='https://github.com/open-edge-platform/edge-ai-resources/raw/6bde8bb1d2317cf16824b8812b845fff34cb0f76/models/FP16/pcb-anomaly-detection.zip' curl -L "$MODEL_URL" -o "$(basename $MODEL_URL)" unzip "$(basename $MODEL_URL)" -d new-model # downloaded model is now extracted to `new-model` directory. ``` ::: :::: 7. Copy the new model to the `dlstreamer-pipeline-server` pod to make it available for application while launching pipeline. ```sh POD_NAME=$(kubectl get pods -n apps -o jsonpath='{.items[*].metadata.name}' | tr ' ' '\n' | grep deployment-dlstreamer-pipeline-server | head -n 1) kubectl cp new-model $POD_NAME:/home/pipeline-server/resources/models/ -c dlstreamer-pipeline-server -n apps ``` 8. Stop the existing pipeline before restarting it with a new model. Use the instance-id generated from step 5. > **Note:** If you are running Helm using an `NGINX_HTTPS_PORT` other than the default 30443, replace 30443 with . ```sh curl -k --location -X DELETE https://:30443/api/pipelines/{instance_id} ``` 9. Modify the payload in `helm/apps//payload.json` to launch an instance for the MLOps pipeline with this new model. ::::{tab-set} :::{tab-item} **Pallet Defect Detection** :sync: pallet-detect ```json [ { "pipeline": "pallet_defect_detection_mlops", "payload":{ "source": { "uri": "file:///home/pipeline-server/resources/videos/warehouse.avi", "type": "uri" }, "destination": { "frame": { "type": "webrtc", "peer-id": "pdd" } }, "parameters": { "detection-properties": { "model": "/home/pipeline-server/resources/models/new-model/deployment/Detection/model/model.xml", "device": "CPU" } } } } ] ``` ::: :::{tab-item} **PCB Anomaly Detection** :sync: pcb-detect ```json [ { "pipeline": "pcb_anomaly_detection_mlops", "payload":{ "source": { "uri": "file:///home/pipeline-server/resources/videos/anomalib_pcb_test.avi", "type": "uri" }, "destination": { "frame": { "type": "webrtc", "peer-id": "anomaly" } }, "parameters": { "classification-properties": { "model": "/home/pipeline-server/resources/models/new-model/deployment/Anomaly classification/model/model.xml", "device": "CPU" } } } } ] ``` ::: :::: 10. Start the pipeline with the above payload. ::::{tab-set} :::{tab-item} **Pallet Defect Detection** :sync: pallet-detect ```sh ./sample_start.sh helm -p pallet_defect_detection_mlops ``` ::: :::{tab-item} **PCB Anomaly Detection** :sync: pcb-detect ```sh ./sample_start.sh helm -p pcb_anomaly_detection_mlops ``` ::: :::: 11. View the WebRTC streaming on `https://:30443/mediamtx//` by replacing `` with the value used in the original cURL command to start the pipeline. > **Note:** If you are running Helm using an `NGINX_HTTPS_PORT` other than the default 30443, replace 30443 with ``. ::::{tab-set} :::{tab-item} Pallet Defect Detection :sync: pallet-detect ![WebRTC streaming](../_assets/pdd-webrtc-streaming.png) ::: :::{tab-item} PCB Anomaly Detection :sync: pcb-detect ![WebRTC streaming](../_assets/pcb-webrtc-streaming.png) ::: :::: ## Troubleshooting - [Troubleshooting Guide](../troubleshooting.md)