Upload Labeled Images to Segmentation Projects
  • 29 Aug 2023
  • 2 Minutes to read
  • Dark
    Light
  • PDF

Upload Labeled Images to Segmentation Projects

  • Dark
    Light
  • PDF

Article summary

Note:
To see all the methods for uploading images to projects, go to Upload Images.

You can upload pre-labeled images into Segmentation projects by uploading the images and their Segmentation Masks. A Segmentation Mask is a PNG file that you upload along with the image. The Segmentation Mask identifies each detected area.

When you open the Upload pop-up window, you can select the Upload Labeled Images option. Then you upload each file type:

  1. Image: Upload your images.
  2. Segmentation mask: Upload the PNGs of your segmentation masks.
  3. Defect Map: Upload the JSON file with the defect map.

Segmentation Mask

The Segmentation Masks must be PNG files. The Segmentation Mask is an 8-bit grayscale bitmap of the image in which each intensity represents a class. If you open the Segmentation Mask file, it looks like the image is all black. However, when you upload the image and its Segmentation Mask to LandingLens, you will see the mask as a label. 

For example, the images below show the 1) original image, 2) the Segmentation Mask in an image editor, and 3) the Segmentation Mask applied to the image in LandingLens.

1) Original Image
2) Segmentation Mask, When Viewed in an Image Editor
3) Segmentation Mask Applied to the Image in LandingLens

The Segmentation Mask files must have the same names as the image files. If the image is a PNG, you must store the image and mask in separate folders before uploading. Otherwise, your computer may overwrite one file with the other.

You can create Segmentation Masks using open-source, third-party tools.

Defect Map

The Defect Map is a JSON file that defines the class names for your project. The Defect Map must follow this format:

{
  "0": "ok",
  "1": "Class Name",
  "2": "Class Name"
}

The value for “0” must be “ok”. “0” is used to identify the background; in other words, areas that do not have classes applied to them. The value “ok” will not be created as a class. If you don’t include this line, you will get an error when you try to upload the images.

Enter your class names starting with “1”. For example, let’s say you have two classes: Chip and Scratch. You would format the Defect Map like this:

{
  "0": "ok",
  "1": "Chip",
  "2": "Scratch"
}

Upload Labeled Images

  1. Open the project you want to upload images to. 
  2. Open the Upload pop-up window.
    1. If you haven't uploaded any images to the project yet, scroll down to the bottom of the page and click Click Here.
      Upload Images to New Project
    2. If you've already uploaded images, click the Upload icon.
      Upload Images to Existing Project
  3. Select Upload labeled images from the drop-down menu.
    Upload Labeled Images
  4. Upload your images in the Image tile. Drag and drop the files here, or click Choose File.
    The number of files displays below the tile. The number of files displays below the tile. The images display in the Upload Preview section.
    Upload Images
  5. Upload the Segmentation Masks in the Segmentation mask tile. Drag and drop the files here, or click Choose File.
    The number of files displays below the tile. In the Upload Preview section, every image that has a mask is now marked as Labeled. Images that don’t have masks are marked as Unlabeled.
    Upload Segmentation Masks
  6. Upload the Defect Map to the Defect map tile. Drag and drop the file here, or click Choose File.
    The file name displays below the tile.
    Upload the Defect Map
  7. Click Upload Images. LandingLens shows the upload progress.
    Upload Progress
    When the upload is complete, all images that have masks are labeled.
    The Uploaded Masks Display as Labels

Was this article helpful?