IBM Developer

Tutorial

Create and configure custom pipelines with Maximo Visual Inspection Edge

Learn to create and configure custom pipelines in MVI Edge for sending inference results to external systems using REST API calls

By Jatindra Suthar

Maximo Visual Inspection Edge integrates with Maximo Visual Inspection to facilitate inspections that collect images for training models or use trained models to identify objects in images. It allows users to create inspection rules that define pass or fail criteria, collecting or inspecting images from input sources like fixed cameras at the edge of manufacturing activity.

You may need to send the inference results from MVI Edge to an external system. This tutorial focuses on creating a custom pipeline and configuring it to make REST API calls to send inference results to an external system.

Pipelines

Pipelines in Maximo Visual Inspection Edge are sequences of components configured using JSON. When an inspection is created, the backend configuration uses a pipeline that outlines or extends the steps for processing images and generating inference results. In simple terms, a pipeline defines the workflow for handling input images and determining actions to take with the inference output, such as storing results or cropping images.

Maximo Visual Inspection includes built-in pipelines like Folder Cropped and Camera Cropped.

Prerequisites

  • Maximo Visual Inspection Edge
  • Access to the machine where Maximo Visual Inspection Edge is installed

Creating a custom pipeline

A pipeline is a sequence of components. To meet our requirements, we need to create a component configured to our endpoint, enabling it to make REST calls to our external system. Therefore, we need to first create this component.

Steps

Step 1. Create component

  1. It is recommended that you have root access to the machine. If you are using a virtual machine, you can use the following command to log in:

    ssh -i path-to-private-key root@server-ip

    In the above command, replace path-to-private-key with the path to your SSH private key and server-ip with the server’s IP address.

  2. Once logged in, navigate to the components directory:

    cd <INSTALL_ROOT>/vision-edge/volume/run/var/config/templates/components

  3. In this directory, you will find a list of default components used in other pipelines. To create a new component:

    • Copy or download the content from the InferenceCustomRESTWriterComponent.tpl file.
    • Update the URL and header according to your REST API definition.

      To create the file, enter the following command in the terminal:

      cat > InferenceCustomRESTWriterComponent.tpl

    • Paste the content of the InferenceCustomRESTWriterComponent.tpl file.

    • Ensure you update the URL and header as per your REST API definition.
    • Press CTRL-D to save and exit.
  4. The newly created component, named inferencecustomrestwriter, is configured to make REST calls to the URL defined in the file. This component will be used in the pipeline you will create in the upcoming steps.

  5. After you have created and verified the component, you can exit the virtual server.

Step 2. Download the default pipeline

  1. Open Maximo Visual Inspection Edge and navigate to Settings -> Pipelines.
  2. Open a default pipeline and click the Export icon. The exported Go template will serve as your custom pipeline template.
  3. Rename the exported pipeline file to InferenceCustomRestWritterYOUR-INITIALS.tpl, replacing YOUR-INITIALS with your initials (e.g., InferenceCustomRestWritterJD.tpl).

Step 3. Customize the pipeline

  1. Open the file InferenceCustomRestWritterYOUR-INITIALS.tpl that you just renamed in any preferred editor.
  2. Replace its content with the content from the InferenceCustomRestWritter.tpl file.
  3. Verify that the inferencecustomrestwriter component is used in the pipeline.
  4. Save the file.

Step 4. Register the pipeline

  1. Navigate to Settings -> Pipelines in MVI Edge.
  2. Click Register Pipeline.

    Create Pipeline

  3. Upload the pipeline file that you have created, which is InferenceCustomRestWritterYOUR-INITIALS.tpl.

  4. Click Create.

    Register Pipeline

    Your pipeline has been created successfully.

Step 5. Use the custom pipeline in an inspection

  1. Navigate to Inspections in MVI Edge.
  2. Open the inspection configuration.
  3. In the Pipeline section, select the custom pipeline you registered.

    Using Pipeline

  4. Enable the inspection.

    Upon inferring the images, you should receive the inference results at the endpoint configured in the InferenceCustomRESTWriterComponent.tpl file.

Conclusion

This tutorial guided you through integrating Maximo Visual Inspection Edge with external systems via custom pipelines. It covered creating a custom component for REST API calls, downloading and customizing a default pipeline, and registering and using the custom pipeline in inspections. By following these steps, you can automate sending inference results to your specified endpoint.