Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
bob.pad.base
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
bob
bob.pad.base
Commits
cd042d49
Commit
cd042d49
authored
7 years ago
by
Theophile GENTILHOMME
Browse files
Options
Downloads
Patches
Plain Diff
open_file is in bob.bio.base now
parent
42c59a87
Branches
Branches containing commit
Tags
Tags containing commit
2 merge requests
!42
Set of click commands for pad
,
!41
Set of click commands for pad
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
bob/pad/base/test/test_spoof.py
+1
-1
1 addition, 1 deletion
bob/pad/base/test/test_spoof.py
bob/pad/base/tools/scoring.py
+3
-2
3 additions, 2 deletions
bob/pad/base/tools/scoring.py
with
4 additions
and
3 deletions
bob/pad/base/test/test_spoof.py
+
1
−
1
View file @
cd042d49
...
@@ -43,7 +43,7 @@ def _detect(parameters, cur_test_dir, sub_dir, score_types=('dev-real',), scores
...
@@ -43,7 +43,7 @@ def _detect(parameters, cur_test_dir, sub_dir, score_types=('dev-real',), scores
for
i
in
range
(
0
,
len
(
score_types
)):
for
i
in
range
(
0
,
len
(
score_types
)):
data2check
=
[]
data2check
=
[]
for
sfile
in
(
score_files
[
i
],
reference_files
[
i
]):
for
sfile
in
(
score_files
[
i
],
reference_files
[
i
]):
f
=
bob
.
measu
re
.
load
.
open_file
(
sfile
)
f
=
bob
.
bio
.
sco
re
.
load
.
open_file
(
sfile
)
d_
=
[]
d_
=
[]
for
line
in
f
:
for
line
in
f
:
if
isinstance
(
line
,
bytes
):
line
=
line
.
decode
(
'
utf-8
'
)
if
isinstance
(
line
,
bytes
):
line
=
line
.
decode
(
'
utf-8
'
)
...
...
This diff is collapsed.
Click to expand it.
bob/pad/base/tools/scoring.py
+
3
−
2
View file @
cd042d49
...
@@ -7,6 +7,7 @@
...
@@ -7,6 +7,7 @@
import
bob.io.base
import
bob.io.base
import
bob.bio.base
import
bob.measure
import
bob.measure
import
numpy
import
numpy
import
os
import
os
...
@@ -48,12 +49,12 @@ def _compute_scores(algorithm, toscore_objects, allow_missing_files):
...
@@ -48,12 +49,12 @@ def _compute_scores(algorithm, toscore_objects, allow_missing_files):
def
_open_to_read
(
score_file
):
def
_open_to_read
(
score_file
):
"""
Checks for the existence of the normal and the compressed version of the file,
"""
Checks for the existence of the normal and the compressed version of the file,
and calls :py:func:`bob.
measure.load
.open_file` for the existing one.
"""
and calls :py:func:`bob.
bio.base.score
.open_file` for the existing one.
"""
if
not
os
.
path
.
exists
(
score_file
):
if
not
os
.
path
.
exists
(
score_file
):
score_file
+=
'
.tar.bz2
'
score_file
+=
'
.tar.bz2
'
if
not
os
.
path
.
exists
(
score_file
):
if
not
os
.
path
.
exists
(
score_file
):
raise
IOError
(
"
The score file
'
%s
'
cannot be found. Aborting!
"
%
score_file
)
raise
IOError
(
"
The score file
'
%s
'
cannot be found. Aborting!
"
%
score_file
)
return
bob
.
measure
.
load
.
open_file
(
score_file
)
return
bob
.
bio
.
base
.
open_file
(
score_file
)
def
_open_to_write
(
score_file
,
write_compressed
):
def
_open_to_write
(
score_file
,
write_compressed
):
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment