Upload Labeled Images to Object Detection Projects
This article applies to these versions of LandingLens:
LandingLens
LandingLens on Snowflake
(see exceptions below)
If you have labeled images you want to upload to Object Detection projects, you can upload them in the Pascal VOC (Visual Object Classes) format. This format involves uploading the original (unlabeled) image and a corresponding XML file. The XML file contains the label (annotation) details of its paired image. The XML file essentially tells LandingLens where each label is on its associated image and what the name of the class is.
The image and XML file must have the same file name (with different extensions). For example:
vehicle_123.png
vehicle_123.xml
If you’re using , uploading Pascal VOC files is not supported whenloading imagesfrom Snowflake stages. You can still upload the files from a hard drive.
When you upload an image and its corresponding XML file to an Object Detection project in LandingLens, the XML file must follow the format of the following code sample:
The following table explains the elements in the Pascal VOC XML file.
Element
Definition
Example
<?xml version='1.0' encoding='UTF-8'?>
The XML preamble that defines the XML standard and encoding method.
<?xml version='1.0' encoding='UTF-8'?>
<annotation>
This element wraps around all objects.
<annotation>
<object>
This element wraps around all elements that define the labeled object.
<object>
<pose>
Identifies if the image is skewed. The default value is Unspecified, which means that the image is not skewed.
<pose>Unspecified</pose>
<occluded>
Indicates if the labeled object overlaps another labeled object.
Values:
The labeled object is not overlapped: 0
The labeled object is overlapped: -1
<occluded>0</occluded>
<difficult>
Indicates if the object is easy to detect.
Values:
The object is easy to detect: 0
The object is difficult to detect: -1
<difficult>0</difficult>
<truncated>
Indicates if a bounding box doesn’t include the full object. This could happen because the object isn’t fully in the frame (ex: the object is a cat but it’s only halfway in the picture) or because there is something in front of the object.
Values:
The bounding box includes the full object: 0
The bounding box does not include the full object: -1
<truncated>0</truncated>
<name>
The name of the class (label). When the image and the corresponding XML file are uploaded to LandingLens, LandingLens converts this name into a class.
<name>Diamond</name>
<bndbox>
This element wraps around the dimensions for the edges of the bounding box, which is the rectangle around the labeled object.
<bndbox>
<xmax>
The distance from the left edge of the image to the right side of the bounding box (in pixels).
<xmax>1032</xmax>
<xmin>
The distance from the left edge of the image to the left side of the bounding box (in pixels).
<xmin>2085</xmin>
<ymax>
The distance from the top of the image to the bottom side of the bounding box (in pixels).
<ymax>2800</ymax>
<ymin>
The distance from the top of the image to the top side of the bounding box (in pixels).
<ymin>2396</ymin>
<filename>
The file name and image file extension of the image.
<filename>IMG_6397.jpg</filename>
<segmented>
Indicates if any of the bounding boxes are not rectangles (for example if one is a hexagon).
Values:
All bounding boxes are rectangles: 0
At least one bounding box is not a rectangle: -1
<segmented>0</segmented>
<size>
This element wraps around the dimensions of the image.
If you have images annotated in a format that is NOT Pascal VOC, you can use the Python scripts in this section to convert from YOLO or COCO to Pascal VOC.
To convert from other formats, use a third-party conversion tool to convert the files to Pascal VOC. Then upload the images and the XML files to LandingLens.
If you’re using , uploading Pascal VOC files is not supported when loading images from Snowflake stages. You can still upload the files from a hard drive.
Before uploading labeled images, ensure that they are not in a zipped file. LandingLens doesn’t support uploading zipped files.
Once you’ve located your image files, XML files, and ensure that they have the same name, follow the instructions below to upload the Pascal VOC files to LandingLens:
Open the Object Detection 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.
Drag and drop the images and Pascal VOC XML files into the project. You can also select the files from a directory. The image and XML file must have the same file name (with different extensions).
A preview of your images displays. If an image has a correctly-formatted XML file, LandingLens captions it as Pascal Voc.