Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
bob
bob.bio.base
Commits
31e99d38
Commit
31e99d38
authored
Dec 01, 2020
by
Tiago de Freitas Pereira
Browse files
[py] Added json as default annotation type
parent
33068f84
Pipeline
#46238
passed with stage
in 5 minutes and 50 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
bob/bio/base/database/csv_dataset.py
View file @
31e99d38
...
...
@@ -31,7 +31,7 @@ class AnnotationsLoader:
self
,
annotation_directory
=
None
,
annotation_extension
=
".json"
,
annotation_type
=
"
eyecenter
"
,
annotation_type
=
"
json
"
,
):
self
.
annotation_directory
=
annotation_directory
self
.
annotation_extension
=
annotation_extension
...
...
@@ -172,7 +172,7 @@ class CSVToSampleLoader(CSVBaseSampleLoader):
kwargs
=
dict
([[
str
(
h
).
lower
(),
r
]
for
h
,
r
in
zip
(
header
[
2
:],
row
[
2
:])])
if
self
.
metadata_loader
is
not
None
:
metadata
=
self
.
metadata_loader
(
row
)
metadata
=
self
.
metadata_loader
(
row
,
header
=
header
)
kwargs
.
update
(
metadata
)
return
DelayedSample
(
...
...
@@ -220,7 +220,7 @@ class LSTToSampleLoader(CSVBaseSampleLoader):
kwargs
=
{
"subject"
:
str
(
subject
)}
if
self
.
metadata_loader
is
not
None
:
metadata
=
self
.
metadata_loader
(
row
)
metadata
=
self
.
metadata_loader
(
row
,
header
=
header
)
kwargs
.
update
(
metadata
)
return
DelayedSample
(
...
...
bob/bio/base/test/test_filelist.py
View file @
31e99d38
...
...
@@ -111,7 +111,9 @@ def test_csv_file_list_dev_eval():
csv_to_sample_loader
=
CSVToSampleLoader
(
data_loader
=
bob
.
io
.
base
.
load
,
metadata_loader
=
AnnotationsLoader
(
annotation_directory
=
annotation_directory
,
annotation_extension
=
".pos"
annotation_directory
=
annotation_directory
,
annotation_extension
=
".pos"
,
annotation_type
=
"eyecenter"
,
),
dataset_original_directory
=
""
,
extension
=
""
,
...
...
@@ -159,7 +161,9 @@ def test_csv_file_list_dev_eval_sparse():
csv_to_sample_loader
=
CSVToSampleLoader
(
data_loader
=
bob
.
io
.
base
.
load
,
metadata_loader
=
AnnotationsLoader
(
annotation_directory
=
annotation_directory
,
annotation_extension
=
".pos"
annotation_directory
=
annotation_directory
,
annotation_extension
=
".pos"
,
annotation_type
=
"eyecenter"
,
),
dataset_original_directory
=
""
,
extension
=
""
,
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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