I have some images annotated with this tool and txt format for one image, as you know, is like below:
annotation>
<folder>pos</folder>
<filename>02HAT.jpg</filename>
<path>D:\Projects\hardhat_detection\hardhat-detector\pos\02HAT.jpg</path>
<source>
<database>Unknown</database>
</source>
<size>
<width>209</width>
<height>154</height>
<depth>3</depth>
</size>
<segmented>0</segmented>
<object>
<name>helmet</name>
<pose>Unspecified</pose>
<truncated>0</truncated>
<difficult>0</difficult>
<bndbox>
<xmin>2</xmin>
<ymin>4</ymin>
<xmax>208</xmax>
<ymax>109</ymax>
</bndbox>
</object>
</annotation>
And as it is said here yolo_mark.cmd creates a txt file for one image as:
<object-class> <x> <y> <width> <height>
It is obvious that they are different in form but I thought it might be applicable with former (that's labalImg's) format in some way, because the author (of labelImg) mentions that here
It would save me a great time, thanks!
Are you asking if labelImg can save annotations in the YOLO format? Because your second link explains how to do that...


Yes, but the format in the yolo mark annotator is different as I pointed out!
I just created an annotation and saved it in the YOLO format, and I got this:
0 0.518182 0.381733 0.775758 0.585480
Which looks exactly like the format you mentioned above:
<object-class> <x> <y> <width> <height>
And looks exactly like the examples that are posted here:
"For example for img1.jpg you will be created img1.txt containing:"
1 0.716797 0.395833 0.216406 0.147222
0 0.687109 0.379167 0.255469 0.158333
1 0.420312 0.395833 0.140625 0.166667
@vdalv Yes, you were right, it saved as you showed. Looks like I mistakenly unnoticed the yolo format was back to PascalVOC when I reopened it. Don't you know any other tool to convert them to yolo by any chance?
@git-sohib Ah, ok, that makes sense.
I wrote a script to convert all of my PascalVOC xml files to YOLO txt files a little while ago. I just shared the script here: https://gist.github.com/vdalv/321876a7076caaa771d47216f382cba5
Most helpful comment
@git-sohib Ah, ok, that makes sense.
I wrote a script to convert all of my PascalVOC xml files to YOLO txt files a little while ago. I just shared the script here: https://gist.github.com/vdalv/321876a7076caaa771d47216f382cba5