Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
bob
bob.db.hci_tagging
Commits
5d54f7cf
Commit
5d54f7cf
authored
Apr 29, 2016
by
Guillaume HEUSCH
Browse files
[protocols] commited the protocols, all sequences are now used
parent
b7208bfc
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
bob/db/hci_tagging/protocols/all/dev.txt
View file @
5d54f7cf
This diff is collapsed.
Click to expand it.
bob/db/hci_tagging/protocols/all/test.txt
View file @
5d54f7cf
This diff is collapsed.
Click to expand it.
bob/db/hci_tagging/protocols/all/train.txt
View file @
5d54f7cf
This diff is collapsed.
Click to expand it.
bob/db/hci_tagging/protocols/make_datasets.py
View file @
5d54f7cf
...
...
@@ -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
()
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment