wojciechmo / yolo2

Train YOLOv2 object detector from scratch using Tensorflow.
138 stars 43 forks source link

Could you upload data.csv file? #2

Open threeon1318 opened 6 years ago

threeon1318 commented 6 years ago

Hello, I would like to test your source, can you upload the data.csv sample? Thank you in advance.

Madhivarman commented 6 years ago

Did you created your own dataset for training a network?

muye5 commented 6 years ago

Yes,and got more details from another keras implementation version.

Madhivarman commented 6 years ago

Great...! mind to share the link? I just downloaded VOC sample dataset, the dataset itself contain annotations, segmentation. I have to preprocess the dataset in the required format to train the network.

muye5 commented 6 years ago

https://github.com/experiencor/keras-yolo2

justein commented 6 years ago

@muye5 Ah!Tha's Great!

spudz000 commented 6 years ago

I echo this statement. At least provide an example of the format of the csv. I am a little unsure of the format.

Could someone please add an example csv?

muye5 commented 6 years ago

@ccnankai sorry finally I switch to another project, not figuring out the cvs format.

ronak97o commented 5 years ago

hey it will be helpful if you provide a csv format can you do that ??

ghost commented 4 years ago

Sort of necro-posting, but figured it could be of use to someone.

The file format that worked for me was

filename,rois,classes
00000.jpg,"[[0,0,0,0], [1,1,1,1], [2,2,2,2]]","[1,2,3]"
00001.jpg,"[[0,0,0,0], [1,1,1,1], [2,2,2,2]]","[1,2,3]"

If you save this data (watch out with spaces between commas!) to test.csv, you can read it using the following code (confirmed it works on Python 3.6.9)

import csv
csvdata = csv.DictReader(open('test.csv'))
for row in csvdata: 
    # this is what the code does to parse the string into a numpy array
    rois = np.array(eval(row['rois']), dtype='float32') 
    classes = np.array(eval(row['classes']), dtype='int32') 
    print(rois, classes) 

and it should produce this output

[[0. 0. 0. 0.]
 [1. 1. 1. 1.]
 [2. 2. 2. 2.]] [1 2 3]
[[0. 0. 0. 0.]
 [1. 1. 1. 1.]
 [2. 2. 2. 2.]] [1 2 3]

It took me a while to figure out the proper formatting, but then I saw the code is calling eval call inside the creation of a numpy.array.

Good luck!