Open threeon1318 opened 6 years ago
Did you created your own dataset for training a network?
Yes,and got more details from another keras implementation version.
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 Ah!Tha's Great!
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?
@ccnankai sorry finally I switch to another project, not figuring out the cvs format.
hey it will be helpful if you provide a csv format can you do that ??
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!
Hello, I would like to test your source, can you upload the data.csv sample? Thank you in advance.