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 callsMaximo 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
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-ipIn the above command, replace
path-to-private-keywith the path to your SSH private key andserver-ipwith the server’s IP address.Once logged in, navigate to the components directory:
cd <INSTALL_ROOT>/vision-edge/volume/run/var/config/templates/componentsIn 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
URLandheaderaccording to your REST API definition.To create the file, enter the following command in the terminal:
cat > InferenceCustomRESTWriterComponent.tplPaste the content of the InferenceCustomRESTWriterComponent.tpl file.
- Ensure you update the
URLandheaderas per your REST API definition. - Press
CTRL-Dto save and exit.
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.After you have created and verified the component, you can exit the virtual server.
Step 2. Download the default pipeline
- Open Maximo Visual Inspection Edge and navigate to
Settings -> Pipelines. - Open a default pipeline and click the
Exporticon. The exported Go template will serve as your custom pipeline template. - Rename the exported pipeline file to
InferenceCustomRestWritterYOUR-INITIALS.tpl, replacingYOUR-INITIALSwith your initials (e.g., InferenceCustomRestWritterJD.tpl).
Step 3. Customize the pipeline
- Open the file
InferenceCustomRestWritterYOUR-INITIALS.tplthat you just renamed in any preferred editor. - Replace its content with the content from the InferenceCustomRestWritter.tpl file.
- Verify that the
inferencecustomrestwritercomponent is used in the pipeline. - Save the file.
Step 4. Register the pipeline
- Navigate to
Settings -> Pipelinesin MVI Edge. Click
Register Pipeline.
Upload the pipeline file that you have created, which is
InferenceCustomRestWritterYOUR-INITIALS.tpl.Click
Create.
Your pipeline has been created successfully.
Step 5. Use the custom pipeline in an inspection
- Navigate to
Inspectionsin MVI Edge. - Open the inspection configuration.
In the
Pipelinesection, select the custom pipeline you registered.
Enable the inspection.
Upon inferring the images, you should receive the inference results at the endpoint configured in the
InferenceCustomRESTWriterComponent.tplfile.
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.