How to convert from structure to table?
66 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Hi!
Hope everyone is doing well! I am following YOLO example for inferences with my own dataset. I noticed the example had annotations in the format like below in a table format (imagefilename cloumn, and vehicle column).
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/392618/image.png)
While the annotations file that I have has a different format and I am struggling to convert to the similar format as above. When I import the json file, it converts the data into stuct, which I am not very familiar with other than looking up Youtube videos, and MATLAB docs.
This is the data from imported json file.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/392623/image.png)
This has multiple categories and each bounding box is split into individual rows. It seems I will have to convert that into a table format for corresponding image. I can have multiple columns for different categories. Any suggestions?
Thanks!
0 Kommentare
Antworten (1)
Ameer Hamza
am 26 Okt. 2020
You can use struct2table(): https://www.mathworks.com/help/releases/R2020b/matlab/ref/struct2table.html to convert structs to table. This shows how to access data in MATLAB's table: https://www.mathworks.com/help/matlab/matlab_prog/access-data-in-a-table.html
5 Kommentare
Ameer Hamza
am 29 Okt. 2020
Sorry! I wasn't able to respond to this. Glad that you figured it out. You may consider sharing the solution so that it will be helpful for anyone else coming to this page.
Siehe auch
Kategorien
Mehr zu Data Type Conversion finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!