Automate visual recognition model training

Source Node: 749605

This code pattern is part of the Getting started with IBM Maximo Visual Inspection learning path.

Summary

Training a visual recognition model can be repetitive and tedious. Users generally have to manually upload and label each individual image. This code pattern shows how to automate these repetitive tasks by monitoring a set of folders using a Python script. As images are added to each folder, they’ll be uploaded and labeled in IBM Maximo Visual Inspection. Once enough images have been uploaded, an image recognition model will be trained.

Description

This code pattern is targeted toward business users that utilize custom visual recognition models and would like to reduce the amount of time spent on manually tuning and retraining their models. This is accomplished through the use of a Python script that has the ability to monitor folders for changes. As images are added to each designated folder, the images are automatically uploaded to the IBM Maximo Visual Inspection service and labelled accordingly. This greatly simplifies the training process because you don’t have to use the UI to upload and label each individual image. This enables you to continuously update IBM Maximo Visual Inspection models without depending on a system administrator.

When you complete this code pattern, you’ll be able to:

  • Automate categorizing and uploading of images to IBM Maximo Visual Inspection
  • Automate model training in IBM Maximo Visual Inspection

Flow

flow

  1. The user copies respective images to the category subfolders.
  2. The script counts the number of images added and determines if image count exceeds threshold.
  3. If image count exceeds “upload” threshold, the script executes a POST request and uploads images for each category.
  4. If image count exceeds “train” threshold, the script executes a POST request to begin training a model.

Instructions

Get the detailed instructions in the README file. These steps will show you how to:

  1. Clone the repository.
  2. Create the image folder and subfolders.
  3. Fill in the configuration file.
  4. Start and test the script.

Conclusion

This code pattern explained how to automate repetitive tasks by monitoring a set of folders using a Python script. The code pattern is part of the Getting started with IBM Maximo Visual Inspection learning path. To continue with the learning path, look at the next pattern Load IBM Maximo Visual Inspection inference results in a dashboard.

Source: https://developer.ibm.com/patterns/upload-datasets-for-training-models-in-ibm-visual-insights/

Time Stamp:

More from IBM Developer