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.pad.base
Commits
2ddbe247
Commit
2ddbe247
authored
May 08, 2018
by
Theophile GENTILHOMME
Browse files
fix load path
parent
cd042d49
Pipeline
#19938
passed with stage
in 22 minutes and 56 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
bob/pad/base/test/test_spoof.py
View file @
2ddbe247
...
...
@@ -17,6 +17,7 @@ import numpy
import
bob.io.base.test_utils
import
bob.bio.base
import
bob.bio.base.score.load
as
bio_load
import
bob.pad.base
from
bob.bio.base.test
import
utils
...
...
@@ -43,7 +44,7 @@ def _detect(parameters, cur_test_dir, sub_dir, score_types=('dev-real',), scores
for
i
in
range
(
0
,
len
(
score_types
)):
data2check
=
[]
for
sfile
in
(
score_files
[
i
],
reference_files
[
i
]):
f
=
b
ob
.
bio
.
score
.
load
.
open_file
(
sfile
)
f
=
b
io_
load
.
open_file
(
sfile
)
d_
=
[]
for
line
in
f
:
if
isinstance
(
line
,
bytes
):
line
=
line
.
decode
(
'utf-8'
)
...
...
bob/pad/base/tools/scoring.py
View file @
2ddbe247
...
...
@@ -7,7 +7,7 @@
import
bob.io.base
import
bob.bio.base
import
bob.bio.base
.score.load
as
bio_load
import
bob.measure
import
numpy
import
os
...
...
@@ -49,12 +49,12 @@ def _compute_scores(algorithm, toscore_objects, allow_missing_files):
def
_open_to_read
(
score_file
):
"""Checks for the existence of the normal and the compressed version of the file,
and calls :py:func:`bob.bio.base.score.open_file` for the existing one."""
and calls :py:func:`bob.bio.base.score.
load.
open_file` for the existing one."""
if
not
os
.
path
.
exists
(
score_file
):
score_file
+=
'.tar.bz2'
if
not
os
.
path
.
exists
(
score_file
):
raise
IOError
(
"The score file '%s' cannot be found. Aborting!"
%
score_file
)
return
b
ob
.
bio
.
base
.
open_file
(
score_file
)
return
b
io_load
.
open_file
(
score_file
)
def
_open_to_write
(
score_file
,
write_compressed
):
...
...
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