2

I want to train my own dataset using retinanet. The Retinanet github page says that I need to convert my dataset's annotations to csv format. Retinanet csv format:

path/to/image.jpg,x1,y1,x2,y2,class_name

I've converted my own dataset's annotations into a python list. List example:

['/home/atakan/VOC2007/JPEGImages/bookstore_video0_1.jpg,1382,553,1420,602,Pedestrian',...]

Convert list to csv code :

with open('output.csv', 'w', newline='') as csvfile:
    writer = csv.writer(csvfile,delimiter =' ',quotechar =',',quoting=csv.QUOTE_MINIMAL)
    for i in liste:
        writer.writerows([[i]])

But I can't get csv output in retinanet format. Where am I doing wrong?Thanks...

martineau
  • 119,623
  • 25
  • 170
  • 301
  • 2
    For one, your delimiter should be `delimiter = ","` – Mako212 Feb 14 '19 at 19:08
  • 3
    Are you aware about module [csv](https://docs.python.org/3/library/csv.html) ? – Alex Yu Feb 14 '19 at 19:09
  • @AlexYu - Atakan is using the CSV module in the csv code. – Adam Feb 14 '19 at 19:16
  • Atakan, is each item in the list you have created in the csv? If so, what are the headers? Are they `path,x1,y1,x2,y2,class_name` like your first line? – Adam Feb 14 '19 at 19:18
  • Could you [edit] the question to show what the output should look like for that data. You currently just have a list with one item that is a string already in CSV format. i.e. explain what is needed for `retinanet`. – Martin Evans Feb 15 '19 at 09:20

0 Answers0