Scenario: Adding preprocessing and post-processing

Note: Starting in Maximo® Visual Inspection 8.7, custom models are not supported. Custom models are still supported in Maximo Visual Inspection 8.6 and earlier versions.

The goal of this scenario is to create a model to detect license plates, then add post-processing to crop out everything in the image except the license plate.

Before you begin

This scenario assumes that you have the following items:

  • A model that is trained to identify license plates.
  • A post-processing script that crops the area outside the identified license plates in the image.

Procedure

  1. Import the post-processing script.

    The post-processing script is a .zip file that is created by using the custom.py template. See Preprocessing and post-processing for details. Navigate to the Custom artifacts page and upload the .zip file that contains custom.py. For artifact type, select Custom inference script. Name the .zip file crop.zip.

  2. Train the model.

    Preprocessing and post-processing can be done on any type of model except action detection. Use an object detection model that is called license_plates. For instructions to train a model, see Training models.

  3. Deploy the model, specifying the post-processing script.
    1. Navigate to the model you want to deploy and click Deploy model.
    2. Click Advanced deployment.
    3. For Custom inference script, select the inference script that you want to use, specify what you want done with the inference results, and click Deploy. Save the inference results to the cropped_license_plates data set.
  4. Perform an inference and review results.

    Use the deployed model API endpoint to perform an inference. After the inference, the crop script is called, and the resulting image, which has the license plates labeled, is saved to the cropped_license_plates data set. When you view the data set in the table view, these images are labeled "Inference result" in the Created column.