Skip to content
Novus Examples
xml1 KB

Detection Annotations — Pascal VOC (XML)

The same detection boxes in the Pascal VOC XML format — a per-image annotation with size, and one object element per box with pixel corner coordinates. The XML twin of the COCO and YOLO annotations.

Preview — first 50 linesxml
<annotation>
  <folder>vision</folder>
  <filename>street-scene.png</filename>
  <source>
    <database>Novus Examples</database>
  </source>
  <size>
    <width>640</width>
    <height>480</height>
    <depth>3</depth>
  </size>
  <segmented>0</segmented>
  <object>
    <name>person</name>
    <pose>Unspecified</pose>
    <truncated>0</truncated>
    <difficult>0</difficult>
    <bndbox>
      <xmin>90</xmin>
      <ymin>210</ymin>
      <xmax>160</xmax>
      <ymax>390</ymax>
    </bndbox>
  </object>
  <object>
    <name>car</name>
    <pose>Unspecified</pose>
    <truncated>0</truncated>
    <difficult>0</difficult>
    <bndbox>
      <xmin>300</xmin>
      <ymin>300</ymin>
      <xmax>540</xmax>
      <ymax>420</ymax>
    </bndbox>
  </object>
  <object>
    <name>tree</name>
    <pose>Unspecified</pose>
    <truncated>0</truncated>
    <difficult>0</difficult>
    <bndbox>
      <xmin>500</xmin>
      <ymin>90</ymin>
      <xmax>610</xmax>
      <ymax>410</ymax>
    </bndbox>
  </object>
</annotation>

Specifications

Format
Pascal VOC
Objects
3
Bbox
xmin, ymin, xmax, ymax

What is a .xml file?

XML (Extensible Markup Language) is a verbose, self-describing markup language using nested tags, attributes, and namespaces to represent structured, hierarchical data. It supports schemas, entities, and validation and underlies many document and data formats. It remains common in enterprise, publishing, and interchange contexts.

How to use this file

Use an example XML file to test parsers, namespace and schema validation, XPath queries, and protection against entity-expansion and external-entity attacks.

Code examples

import xml.etree.ElementTree as ET

tree = ET.parse("annotations.voc.xml")
root = tree.getroot()
print(root.tag, [c.tag for c in root][:5])

Generated by generation/ai_datasets.py. Free for any use, no attribution required — license.