- 05 Aug 2024
- 3 Minutes to read
- Print
- DarkLight
- PDF
Upload Labeled Images to Segmentation Projects
- Updated on 05 Aug 2024
- 3 Minutes to read
- Print
- DarkLight
- PDF
This article applies to these versions of LandingLens:
LandingLens | LandingLens on Snowflake |
✓ | ✓ (see exceptions below) |
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:
- Image: Upload your images.
- Segmentation mask: Upload the PNGs of your segmentation masks.
- 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.
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
Once you've located your image files, Segmentation Masks, and Defect Maps, follow the instructions below to upload the files to LandingLens:
- Open the Segmentation project you want to upload images to.
- Open the Upload pop-up window.
- If you haven't uploaded any images to the project yet, scroll down to the bottom of the page and click Click Here.
- If you've already uploaded images, click the Upload icon.
- If you haven't uploaded any images to the project yet, scroll down to the bottom of the page and click Click Here.
- Select Upload labeled images from the drop-down menu.
- 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 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 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. - Click Upload Images. LandingLens shows the upload progress.When the upload is complete, all images that have masks are labeled.