Share and Store Labeled Ground Truth Data

The Image Labeler, Video Labeler, and Ground Truth Labeler (requires Automated Driving Toolbox™) apps enable you to label images, videos, and other ground truth data sources. You can then export the labeled ground truth as a groundTruth object. This object contains information about the:

  • Data source

  • Label definitions

  • Marked ground truth labels

You can share this object with:

  • Other labeling colleagues, who can use it to continue labeling

  • Algorithm developers, who can use it to train algorithms, such as an object detector or semantic segmentation network

  • Validation engineers, who can use it to validate algorithms

Share Ground Truth

To export and share labeled ground truth data from one of the labeling apps, select Export Labels > To File. Then either share the exported MAT-file directly with individuals on your team or place it in a shared network location.

If the exported ground truth contains pixel labels, the app also generates a PixelLabelData folder containing the pixel label data. The LabelData table stored in the groundTruth object references the path to this folder. Share this folder along with the groundTruth object.

The labeling apps also enable you to save a MAT-file of the entire app session. Do not share this file. This file contains app preferences that are specific to your local machine, and it might not work on other machines.

If you re-export a ground truth object containing pixel label data, the app generates a new PixelLabelData folder. Even if you are overwriting the original groundTruth object, the app generates a new PixelLabelData folder. The generated folders are named PixelLabelData_1, PixelLabelData_2, and so on, depending on how many times you re-export the groundTruth object to the same folder.

When sharing a groundTruth object, be sure to share the correct PixelLabelData folder associated with it. For example, if you overwrite the original groundTruth object, share the overwritten object and the newly created PixelLabelData_1 folder.

In addition to sharing the groundTruth object, you must also share the data source, and any additional files associated with that data source.

AppData SourceFiles to Share
Image LabelerImage collection
  • groundTruth object MAT-file

  • PixelLabelData folder (pixel labels only)

  • Folders containing image collections (if not in shared location)

Video Labeler or Ground Truth LabelerVideo
  • groundTruth object MAT-file

  • PixelLabelData folder (pixel labels only)

  • Video source file (if not in shared location)

Image sequence
  • groundTruth object MAT-file

  • PixelLabelData folder (pixel labels only)

  • Folder containing image sequence (if not in shared location)

  • Timestamps duration vector (if specified)

Custom data source reader
  • groundTruth object MAT-file

  • PixelLabelData folder (pixel labels only)

  • Data source files (if not in shared location)

  • Custom reader function

Move Ground Truth

In the exported groundTruth object, the DataSource property contains the absolute paths to the data source files. For example:

ans = 

groundTruthDataSource for an image collection with properties

                      Source: {
                              ' ...\matlab\toolbox\vision\visiondata\imageSets\cups\bigMug.jpg';
                              ' ...\matlab\toolbox\vision\visiondata\imageSets\cups\blueCup.jpg';
                              ' ...\matlab\toolbox\vision\visiondata\imageSets\cups\handMade.jpg'
                               ... and 9 more
If you move the groundTruth object to a new location, you might need to change the file paths stored in the groundTruthDataSource object. Even if the data source files are on a shared network, if other people map a different drive letter to their network folder, the file paths can be incorrect.

To update these paths, use the changeFilePaths function. Specify the groundTruth object as an input argument to this function. Also specify a cell array of string vectors containing the old paths and new paths. For example: {["C:\Shared\ImgFolder\Img1.png" "D:\Shared\ImgFolder\Img1.png"]; ["C:\Shared\ImgFolder\Img2.png" "D:\Shared\ImgFolder\Img2.png"]; ...}.

If your groundTruth object contains pixel label data, the changeFilePaths function also updates the path names to the pixel data stored in the PixelLabelData folder.

Store Ground Truth

Store the groundTruth object in a location that is on the MATLAB® search path. For more details, see What Is the MATLAB Search Path? (MATLAB).

For a video, an image sequence, or an image collection containing images from a single folder, consider storing the groundTruth object in the parent folder of the data source. For image collections containing images from different folders, no specific recommendations exist for where to store the object. You can label image collections using the Image Labeler only.

See Also




Related Topics