Structure of compressed image files

Before you add historical images for image groups, you must have files that contain the image files that you need for either the classification model or the object detection model.

Classification model

Add the images into compressed files. One compressed file must contain all of the images that belong to the same image group. You must put all of the images in a flat structure with no subfolders in the compressed file. The following image types are supported: PNG, JPEG, and JPG. Image files must all have uppercase file extensions, for example, PNG, JPEG, JPG, or they all must have lowercase file extensions, for example, png, jpeg, jpg.

Object detection model

The structure for the object detection model must contain two folders in one compressed file. One folder must be named JPEGImages and the other must be named Annotations. In addition to the two folders, the compressed file must also contain a labels.txt file.

Add all of the image files to the JPEGImages folder. The following image types are supported: PNG, JPEG, and JPG. Image files must all have uppercase file extensions, for example, PNG, JPEG, JPG, or they all must have lowercase file extensions, for example, png, jpeg, jpg. Add all of the annotations files to the Annotations folder. An annotation file must have the same file name as its image file. The files must be in XML format. If you use the image labeling tool in Maximo® PQI SaaS Visual Insights, the output is a compressed image file that contains the images file and the annotation file. If you use an external image labeling tool, you must make sure that the images file and the annotation file are in the expected structure. The following information is an example of an annotation file:
<annotation>
  <folder>JPEGImages</folder>
  <filename>000001.jpg</filename>
  <source>
    <database>Unknown</database>
  </source>
  <size>
    <width>864</width>
    <height>1296</height>
    <depth>3</depth>
  </size>
  <segmented>0</segmented>
  <object>
    <name>defect1</name>
    <pose>Unspecified</pose>
    <truncated>0</truncated>
    <difficult>0</difficult>
    <bndbox>
      <xmin>474</xmin>
      <ymin>368</ymin>
      <xmax>540</xmax>
      <ymax>448</ymax>
    </bndbox>
  </object>
  <object>
    <name>defect2</name>
    <pose>Unspecified</pose>
    <truncated>0</truncated>
    <difficult>0</difficult>
    <bndbox>
      <xmin>303</xmin>
      <ymin>387</ymin>
      <xmax>369</xmax>
      <ymax>452</ymax>
    </bndbox>
  </object>
</annotation>
The labels.txt file contains the names of all of the defects types that are in the annotation folder. Each defect must be on a separate line, as shown in the following example:
defect1
defect2
defect3