hai-h-nguyen / yolo2pascal-annotation-conversion Goto Github PK
View Code? Open in Web Editor NEWConvert Yolo Darket to Pascal VOC annotation format and vice versa.
Convert Yolo Darket to Pascal VOC annotation format and vice versa.
HI,
I tried to convert yolo format to pascal format
I haev folder with images and .txt files
:txt file consist of : classID x y width height
I do not have classes.txt file with me..
what is that fiel for?
How it looks like?
Any help to create it manually.
Thanks in advance
input XML;
<annotation>
<folder>TRAIN</folder>
<filename>1451_1-2$8.jpeg</filename>
<path>/Volumes/Samsung_T5/20201022_RNN_DMG_OS/data/IMG_LBLS/TRAIN/1451_1-2$8.jpeg</path>
<source>
<database>Unknown</database>
</source>
<size>
<width>200</width>
<height>238</height>
<depth>3</depth>
</size>
<segmented>0</segmented>
<object>
<name>1451_1-2</name>
<pose>Unspecified</pose>
<truncated>1</truncated>
<difficult>0</difficult>
<bndbox>
<xmin>6</xmin>
<ymin>1</ymin>
<xmax>175</xmax>
<ymax>231</ymax>
</bndbox>
</object>
</annotation>
stops running with the following error;
Convert 1451_1-2$8.xml
Image path: /volumes/Samsung_T5/IMG_LBLS/train/1451_1-2$8.jpg
Traceback (most recent call last):
File "voc2yolo.py", line 57, in <module>
writer.save(targetFile= imgFolderPath + "/" + annotation_no_xml + ".txt")
File "/Users/oliviervandhuynslager/Documents/DarkNet/darknet/scripts/pascal2yolo/yolo_io.py", line 61, in save
classIndex, xcen, ycen, w, h = self.BndBox2YoloLine(box, classList)
File "/Users/oliviervandhuynslager/Documents/DarkNet/darknet/scripts/pascal2yolo/yolo_io.py", line 37, in BndBox2YoloLine
xcen = float((xmin + xmax)) / 2 / self.imgSize[1]
ZeroDivisionError: float division by zero
I couldn't find how to remove the qt dependency. Any help ?
Hey,
i got an error when trying to convert yolo2pascal format.
Error: Too many Values given expected five.
It occurs in yolo_io.py in parseYoloFormat. So i looked your code up and found out that my yolo dataset had an " " after the 5 Values. If anyone runs into that Problem to you can fix it by editing yolo_io.py -> parseYoloFormat to:
try:
classIndex, xcen, ycen, w, h = bndBox.split(' ')
except Exception:
classIndex, xcen, ycen, w, h, corrupted = bndBox.split(' ')
the .split method is basically splitting the Complete txt file into pieces. If you happen to have " " at the end it needs 6 Values to be asigned. Thats why it's throwing the Error above. Now it works like a Charm thank you for providing that library.
some label format such as .txt, it exist '\n', so
the 146th line in Yolo2Pascal-annotation-conversion/yolo2pascal/yolo_io.py, modified as following:
classIndex, xcen, ycen, w, h, _ = bndBox.strip("\n").split(' ')
thank you so much <3
I followed the procedure.
used the following command
*python yolo2voc.py C:/Users/VVSB/Desktop/FLIR_Dataset/FLIR_ADAS_1_3/New folder/image C:/Users/VVSB/Desktop/FLIR_Dataset/FLIR_ADAS_1_3/New folder/Image/text
There is no Output.
python3 gives some error.
Thank you for support
says the files must be in jpg, would png work?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.