Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
bob.bio.face
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.bio.face
Commits
9b1b0303
Commit
9b1b0303
authored
3 years ago
by
Yannick DAYER
Browse files
Options
Downloads
Patches
Plain Diff
Change tests for replay-mobile to csv dataset
parent
1533b950
No related branches found
No related tags found
1 merge request
!106
Vulnerability framework - CSV datasets
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
bob/bio/face/test/test_databases.py
+28
-51
28 additions, 51 deletions
bob/bio/face/test/test_databases.py
with
28 additions
and
51 deletions
bob/bio/face/test/test_databases.py
+
28
−
51
View file @
9b1b0303
...
...
@@ -26,6 +26,7 @@ from bob.bio.base.test.utils import db_available
from
bob.bio.base.test.test_database_implementations
import
check_database
import
bob.core
from
bob.extension.download
import
get_file
from
nose.plugins.skip
import
SkipTest
logger
=
bob
.
core
.
log
.
setup
(
"
bob.bio.face
"
)
...
...
@@ -271,60 +272,36 @@ def test_replay_spoof():
)
@db_available
(
"
replaymobile
"
)
def
test_replaymobile_csv
():
from
bob.bio.face.database.replaymobile_csv
import
ReplayMobileDatabase
# TODO: load resource instead
database
=
ReplayMobileDatabase
(
"
grandtest
"
,
protocol_definition_path
=
"
./csv_datasets
"
,
data_path
=
""
)
samples
=
database
.
all_samples
(
groups
=
(
"
dev
"
,
"
eval
"
))
assert
len
(
samples
)
==
8300
,
len
(
samples
)
assert
all
([
s
.
path
for
s
in
samples
])
# assert samples[0].data.shape == (3, 1280, 720)# TODO data sample?
assert
hasattr
(
samples
[
0
],
"
annotations
"
)
assert
"
topleft
"
in
samples
[
0
].
annotations
assert
"
bottomright
"
in
samples
[
0
].
annotations
assert
hasattr
(
samples
[
0
],
"
frame
"
)
@db_available
(
"
replaymobile
"
)
def
test_replaymobile_licit
():
def
test_replaymobile
():
database
=
bob
.
bio
.
base
.
load_resource
(
"
replaymobile-img
-licit
"
,
"
database
"
,
preferred_package
=
"
bob.bio.face
"
"
replaymobile-img
"
,
"
database
"
,
preferred_package
=
"
bob.bio.face
"
)
samples
=
database
.
all_samples
(
groups
=
(
"
dev
"
,
"
eval
"
))
assert
len
(
samples
)
==
8300
,
len
(
samples
)
sample
=
samples
[
0
]
assert
hasattr
(
sample
,
"
annotations
"
)
assert
"
reye
"
in
sample
.
annotations
assert
"
leye
"
in
sample
.
annotations
assert
hasattr
(
sample
,
"
path
"
)
assert
hasattr
(
sample
,
"
frame
"
)
assert
len
(
database
.
references
())
==
16
assert
len
(
database
.
references
(
group
=
"
eval
"
))
==
12
assert
len
(
database
.
probes
())
==
4160
assert
len
(
database
.
probes
(
group
=
"
eval
"
))
==
3020
try
:
check_database
(
database
,
groups
=
(
"
dev
"
,
"
eval
"
))
except
IOError
as
e
:
pytest
.
skip
(
"
The database could not be queried; probably the db.sql3 file is missing. Here is the error:
'
%s
'"
%
e
)
try
:
_check_annotations
(
database
,
topleft
=
True
,
limit_files
=
20
)
except
IOError
as
e
:
pytest
.
skip
(
"
The annotations could not be queried; probably the annotation files are missing. Here is the error:
'
%s
'"
%
e
)
@db_available
(
"
replaymobile
"
)
def
test_replaymobile_spoof
():
database
=
bob
.
bio
.
base
.
load_resource
(
"
replaymobile-img-spoof
"
,
"
database
"
,
preferred_package
=
"
bob.bio.face
"
)
try
:
check_database
(
database
,
groups
=
(
"
dev
"
,
"
eval
"
))
except
IOError
as
e
:
pytest
.
skip
(
"
The database could not be queried; probably the db.sql3 file is missing. Here is the error:
'
%s
'"
%
e
)
try
:
_check_annotations
(
database
,
topleft
=
True
,
limit_files
=
20
)
except
IOError
as
e
:
pytest
.
skip
(
"
The annotations could not be queried; probably the annotation files are missing. Here is the error:
'
%s
'"
%
e
)
assert
sample
.
annotations
==
{
"
bottomright
"
:
[
785
,
395
],
"
topleft
"
:
[
475
,
167
],
"
leye
"
:
[
587
,
336
],
"
reye
"
:
[
588
,
238
],
"
mouthleft
"
:
[
705
,
252
],
"
mouthright
"
:
[
706
,
326
],
"
nose
"
:
[
643
,
295
],
}
assert
sample
.
data
.
shape
==
(
3
,
1280
,
720
)
assert
sample
.
data
[
0
,
0
,
0
]
==
87
except
RuntimeError
as
e
:
raise
SkipTest
(
e
)
def
test_ijbc
():
...
...
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