Commit 5d54f7cf authored by Guillaume HEUSCH's avatar Guillaume HEUSCH
Browse files

[protocols] commited the protocols, all sequences are now used

parent b7208bfc
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -10,7 +10,13 @@ import re
random.seed(1)
subjects = range(1, 31)
subjects.remove(29)
nb_files_per_subject = {}
for subj in subjects:
nb_files_per_subject[str(subj)] = 0
subjects.remove(15)
# training set - get the subjects
train = random.sample(subjects, 10)
......@@ -34,7 +40,7 @@ for dirpath, dirnames, filenames in os.walk('../data/Sessions'):
for filename in filenames:
sub = re.search('Part_(.+?)_', filename).group(1)
nb_files_per_subject[sub] += 1
#basename, ext = os.path.splitext(os.path.join(dirpath, filename))
basename = os.path.dirname(os.path.join(dirpath, filename))
......@@ -57,18 +63,25 @@ print "development set contains {0} files".format(len(dev_files))
print test
print "test set contains {0} files".format(len(test_files))
total_files = 0
for key in nb_files_per_subject:
print "Number of files for subject {0} --> {1}".format(key, nb_files_per_subject[key])
total_files += nb_files_per_subject[key]
print "TOTAL -> {0}".format(total_files)
# print list to files
train_list_file = open("default/train.txt", "w")
train_list_file = open("all/train.txt", "w")
for f in train_files:
train_list_file.write("{0}\n".format(f))
train_list_file.close()
dev_list_file = open("default/dev.txt", "w")
dev_list_file = open("all/dev.txt", "w")
for f in dev_files:
dev_list_file.write("{0}\n".format(f))
dev_list_file.close()
test_list_file = open("default/test.txt", "w")
test_list_file = open("all/test.txt", "w")
for f in test_files:
test_list_file.write("{0}\n".format(f))
test_list_file.close()
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment