- 21 Sep 2023
- 3 Minutes to read
- Print
- DarkLight
- PDF
Upload Labeled Images to Object Detection Projects
- Updated on 21 Sep 2023
- 3 Minutes to read
- Print
- DarkLight
- PDF
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'?>
<annotation>
<object>
<pose>Unspecified</pose>
<occluded>0</occluded>
<difficult>0</difficult>
<truncated>0</truncated>
<name>Diamond</name>
<labeler>0f7936ab-7025-482f-9812-4d9c778e00f6</labeler>
<bndbox>
<xmax>926</xmax>
<xmin>652</xmin>
<ymax>3046</ymax>
<ymin>2808</ymin>
</bndbox>
</object>
</annotation>
Pascal VOC Elements
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:
| <occluded>0</occluded> |
<difficult> | Indicates if the object is easy to detect. Values:
| <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:
| <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:
| <segmented>0</segmented> |
<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
To upload labeled images to Object Detection projects:
- Open the 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.
Open the Upload Pop-Up Window
- If you've already uploaded images, click the Upload icon.
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.
- 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.
- To confirm your upload, click the Upload button.
Preview and Upload Labeled Images
- The pre-labeled images display in your project.
Labeled Images