Open John1231983 opened 7 years ago
@John1231983 Thank you for your interests with these scripts. To work with txt input path file, there need some small changes. I wrote some codes as an example and hope it will help you.
"""
Assuming the contents of 'train.txt ' are something like the follows:
2 JPEGImages/2009_003636.jpg SegmentationClass/2009_003636.png
8 JPEGImages/2009_000080.jpg SegmentationClass/2009_000080.png
16 JPEGImages/2008_001028.jpg SegmentationClass/2008_001028.png
The code below could be an alternative way to read the file names:
"""
# Path of your train.txt
trainLst = 'pascal/VOCdevkit/VOC2012/train.txt'
with open(trainLst, 'rb') as f:
lst_file = f.readlines()
inputs_data_train = []
inputs_label_train = []
for item in lst_file:
item_splited = item.split('\t')
inputs_data_train.append(item_splited[1])
inputs_label_train.append(item_splited[2])
Thanks DeeperCS.
Hello. thank you for sharing script to generate the lmdb file. I want to use it to generate VOC2012 dataset which contains the folder
where
SegmentationClassAug
is ground-truth label of both training and testing images, theJPEGImages
includes the original images andtrain.txt, test.txt
are image pathIn your script, it requires copy training and testing image to separate folders as
Is it possible to changing the python code to work with txt input path file as the
/caffe/examples/imagenet/create_imagenet.sh