Darkflow: I have all annotations in ".mat" file....How to Convert those annotations into Darkflow format?

Created on 3 Mar 2018  路  19Comments  路  Source: thtrieu/darkflow

Hii guys...
I downloaded standford cars dataset(standard dataset) which has all the images and annotations.
The only problem is that all the annotations are in ".mat" format(Matlab File)
Please give me some guidance about how to convert these annotations into darkflow xml format.
I opened the .mat file in matlab.
I will upload the screen shot of how the bounding boxes are present.
Please help me convert these annotation file into darkflow annotations format.
screenshot 7

I copied all those columns into excel and tried to convert them into darflow format..But still finding it difficult.

screenshot 8

If you find solution about converting these annotations into darkflow format...please help...
Thanks in advance...

All 19 comments

For annotation you need .xml file you want create xml file for each image

@rucsacman I know that I have to convert those annotations into xml file...Since many standard datasets have .mat file annotations...and many of them dont know the code for converting it into xml file.Writing the process or suggesting the software which do this would be helpful.

Yes using python you can write a script read .csv file you can create xml file

If you have the code please post it...Im finding it difficult to solve this issue @rucsacman

@SrikanthVelpuri did you found any way to convert .mat files to .xml

Here is a Python script to create Annotations in XML Format for Darkflow. Let me know if you are stuck somewhere!
createAnnotations-XMLFormat.py

I will try that code and let you know about that... @jatinmandav

Code is working fine....Close this issue..And thanks for solving my problem @jatinmandav

@apuayush First copy all the columns into excel file and save it as a csv file.Now load the csv file in python and modify the code provided @jatinmandav..His code is working fine.

Hi,

Sorry to bump this thread. I read in Darknet YOLO site that for training, YOLO requires the annotation files in text format and not XML format using the voc_label.py to convert.

Where x, y, width, and height are relative to the image's width and height. To generate these file we will run the voc_label.py script in Darknet's scripts/ directory.

Is this XML requirement specific to Darkflow?

Thanks,
Lobbie

Hi Lobbie!
Yes, for Darkflow, annotations are required in XML format and for Dark-net its TXT file!

Can someone please help to convert .mat file to .txt file ?

@jatinmandav could you please share the code for converting csv to PASCAL VOC xml file for darkflow.the link shared above does not work

Hi!
Here is the code: https://github.com/jatinmandav/darkflow/blob/master/generateXML_CSV.py

Let me know if the code has some bugs I will update the file
Thanks.

Thank you for uploading it.could u let me know how to pass the values to the function write_xml().Also the script does not merge more than one boundary boxes in the same image into one XML file.could you tell me how to achieve it.

I have mentioned everything in the comments on top of the file.

LISA traffic light ds has multiple annotations on the same image.ie the CSV file has multiple entries with the same filename field,when I modit your script only the first entry is saved.could you let me know how to modify this script for that

@jatinmandav Can you share for .mat to txt not xml ?

@jatinmandav hi, i was going through the thread saw Mat to. Xml conversion script link. But unfortunately the link is not working. Will you please help me in this, atleast the link or something for the actual script u shared? I am stuck at this and i really need your help. Thnx

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jubjamie picture jubjamie  路  4Comments

humanova picture humanova  路  4Comments

LeeroyHannigan picture LeeroyHannigan  路  4Comments

eugtanchik picture eugtanchik  路  4Comments

xunkaixin picture xunkaixin  路  4Comments