Upload Labeled Images to Object Detection Projects
  • 21 Sep 2023
  • 3 Minutes to read
  • Dark
  • PDF

Upload Labeled Images to Object Detection Projects

  • Dark
  • PDF

Article Summary

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

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

Pascal VOC XML Files

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:

<?xml version='1.0' encoding='UTF-8'?>

Pascal VOC Elements

The following table explains the elements in the Pascal VOC XML file.

<?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.

  • The labeled object is not overlapped: 0
  • The labeled object is overlapped: -1
<difficult>Indicates if the object is easy to detect.

  • The object is easy to detect: 0
  • The object is difficult to detect: -1
<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.
  • The bounding box includes the full object: 0
  • The bounding box does not include the full object: -1
<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).

  • All bounding boxes are rectangles: 0
  • At least one bounding box is not a rectangle: -1
<size>This element wraps around the dimensions of the image.<size>
<height>The height of the image (in pixels).<height>4032</height>
<width>The width of the image (in pixels).<width>3024</width>

Convert to Pascal VOC

If you have images annotated in a format that is NOT Pascal VOC, use a third-party conversion tool to convert the files to Pascal VOC. Then upload the images and the XML files to LandingLens.

Upload Images and Their XML Files

Before you upload labeled images, you must unzip the file; LandingLens will not accept zipped files.

To upload labeled images to Object Detection projects:

  1. Open the project you want to upload images to.
  2. 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.
      Open the Upload Pop-Up Window
    • If you've already uploaded images, click the Upload icon.
      Click the Upload Icon
  3. 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).
  4. A preview of your images displays. If an image has a correctly-formatted XML file, LandingLens captions it as Pascal Voc.
  5. To confirm your upload, click the Upload button.
    Preview and Upload Labeled Images
  6. The pre-labeled images display in your project.
    Labeled Images

Was this article helpful?