Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
A sample XML annotation file based on Pascal VOC format.
<annotation>
<folder>GeneratedData_Train</folder>
<filename>000001.png</filename>
<path>/my/path/GeneratedData_Train/000001.png</path>
<source>
<database>Unknown</database>
</source>
<size>
<width>224</width>
<height>224</height>
<depth>3</depth>
</size>
<segmented>0</segmented>
<object>
<name>21</name>
<pose>Frontal</pose>
<truncated>0</truncated>
<difficult>0</difficult>
<occluded>0</occluded>
<bndbox>
<xmin>82</xmin>
<xmax>172</xmax>
<ymin>88</ymin>
<ymax>146</ymax>
</bndbox>
</object>
</annotation>
@amitguptagwl

This comment has been minimized.

Copy link

commented Jul 5, 2018

Simple question. If I have to annotate 3 faces in an image file, do I need to generate 3 xml files?

@goyder

This comment has been minimized.

Copy link

commented Jul 5, 2018

Hi @amitguptagwl - one .xml file needs to be generated for each image, which can contain several <object> tags - one for each annotation.

If you have multiple annotations, the <object> tag with its contents is repeated.

So nope, only one file is needed!

@victorklos

This comment has been minimized.

Copy link

commented Sep 29, 2018

You can have multiple bndbox-es per object, at least with caffe-ssd.

@danFromTelAviv

This comment has been minimized.

Copy link

commented Nov 6, 2018

the object class in this example is 21?

@goyder

This comment has been minimized.

Copy link

commented Nov 13, 2018

@danFromTelAviv yep, that's correct.

@robertlugg

This comment has been minimized.

Copy link

commented Dec 22, 2018

Hi all, a couple of questions/suggestions:

  • are x and y values referenced the top left of the image?
  • Would it be possible to include an image that is represented by this file?
  • Is there a spec/description of the fields?
@shahmustafa

This comment has been minimized.

Copy link

commented Jan 16, 2019

Hi,
what are other formats, apart from Pascal VOC format?

@AdityanJothi

This comment has been minimized.

Copy link

commented Apr 4, 2019

What is the significance of these tags?
-name

  • pose
    -truncated
  • difficult
    -occluded
    are they necessary or optional tags, how are they interpreted in tfrecords?
@devika-28

This comment has been minimized.

Copy link

commented Oct 2, 2019

Quick question, am I going to need multiple annotation files for multiple images..?

@JordanMakesMaps

This comment has been minimized.

Copy link

commented Oct 10, 2019

Quick question, am I going to need multiple annotation files for multiple images..?

Yeah, each image has its own annotation file, where any instances within that image are listed in the above format. The image file and annotation file should have the same file name, except for the extensions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.