Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
bob.pad.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.pad.face
Commits
178e48d3
Commit
178e48d3
authored
6 years ago
by
Anjith GEORGE
Browse files
Options
Downloads
Patches
Plain Diff
unit tests, WIP
parent
28e747cc
No related branches found
No related tags found
1 merge request
!86
Batl loo protocols
Pipeline
#26469
failed
6 years ago
Stage: build
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
bob/pad/face/database/batl.py
+4
-3
4 additions, 3 deletions
bob/pad/face/database/batl.py
bob/pad/face/test/test_databases.py
+60
-0
60 additions, 0 deletions
bob/pad/face/test/test_databases.py
with
64 additions
and
3 deletions
bob/pad/face/database/batl.py
+
4
−
3
View file @
178e48d3
...
@@ -561,10 +561,11 @@ class BatlPadDatabase(PadDatabase):
...
@@ -561,10 +561,11 @@ class BatlPadDatabase(PadDatabase):
protocol
=
'
nowig
'
if
protocol
==
'
grandtest
'
else
protocol
protocol
=
'
nowig
'
if
protocol
==
'
grandtest
'
else
protocol
# Convert group names to low-level group names here.
# Convert group names to low-level group names here.
groups
=
self
.
convert_names_to_lowlevel
(
groups
=
self
.
convert_names_to_lowlevel
(
groups
,
self
.
low_level_group_names
,
self
.
high_level_group_names
)
groups
,
self
.
low_level_group_names
,
self
.
high_level_group_names
)
if
not
isinstance
(
groups
,
list
)
and
groups
is
not
None
:
# if a single group is given make it a list
if
not
isinstance
(
groups
,
list
)
and
groups
is
not
None
and
not
isinstance
(
groups
,
str
):
# if a single group is given make it a list
groups
=
list
(
groups
)
groups
=
list
(
groups
)
if
extra
is
not
None
and
"
join_train_dev
"
in
extra
:
if
extra
is
not
None
and
"
join_train_dev
"
in
extra
:
...
...
This diff is collapsed.
Click to expand it.
bob/pad/face/test/test_databases.py
+
60
−
0
View file @
178e48d3
...
@@ -219,3 +219,63 @@ def test_casiasurf():
...
@@ -219,3 +219,63 @@ def test_casiasurf():
raise
SkipTest
(
raise
SkipTest
(
"
The database could not be queried; probably the db.sql3 file is missing. Here is the error:
'
%s
'"
"
The database could not be queried; probably the db.sql3 file is missing. Here is the error:
'
%s
'"
%
e
)
%
e
)
# Test the BATL database
def
test_aggregated_db
():
batl_db
=
bob
.
bio
.
base
.
load_resource
(
'
batl
'
,
'
database
'
,
preferred_package
=
'
bob.pad.face
'
,
package_prefix
=
'
bob.pad.
'
)
try
:
assert
len
(
batl_db
.
objects
(
groups
=
[
'
train
'
,
'
dev
'
,
'
eval
'
]))
==
1679
assert
len
(
batl_db
.
objects
(
groups
=
[
'
train
'
,
'
dev
'
]))
==
1122
assert
len
(
batl_db
.
objects
(
groups
=
[
'
train
'
]))
==
565
assert
len
(
batl_db
.
objects
(
groups
=
'
train
'
))
==
565
assert
len
(
batl_db
.
objects
(
groups
=
'
dev
'
))
==
557
assert
len
(
batl_db
.
objects
(
groups
=
'
eval
'
))
==
557
assert
len
(
batl_db
.
objects
(
groups
=
[
'
train
'
,
'
dev
'
,
'
eval
'
],
protocol
=
'
grandtest
'
))
==
1679
assert
len
(
batl_db
.
objects
(
groups
=
[
'
train
'
,
'
dev
'
,
'
eval
'
],
protocol
=
'
grandtest
'
,
purposes
=
'
real
'
))
==
347
assert
len
(
batl_db
.
objects
(
groups
=
[
'
train
'
,
'
dev
'
,
'
eval
'
],
protocol
=
'
grandtest
'
,
purposes
=
'
attack
'
))
==
1332
#tests for join_train_dev protocols
assert
len
(
batl_db
.
objects
(
groups
=
[
'
train
'
,
'
dev
'
,
'
eval
'
],
protocol
=
'
grandtest-color-50-join_train_dev
'
))
==
1679
assert
len
(
batl_db
.
objects
(
groups
=
[
'
train
'
,
'
dev
'
],
protocol
=
'
grandtest-color-50-join_train_dev
'
))
==
1679
assert
len
(
batl_db
.
objects
(
groups
=
'
eval
'
,
protocol
=
'
grandtest-color-50-join_train_dev
'
))
==
557
# test for LOO_fakehead
assert
len
(
batl_db
.
objects
(
groups
=
[
'
train
'
,
'
dev
'
,
'
eval
'
],
protocol
=
'
grandtest-color-50-LOO_fakehead
'
))
==
1149
assert
len
(
batl_db
.
objects
(
groups
=
[
'
train
'
,
'
dev
'
],
protocol
=
'
grandtest-color-50-LOO_fakehead
'
))
==
1017
assert
len
(
batl_db
.
objects
(
groups
=
'
eval
'
,
protocol
=
'
grandtest-color-50-LOO_fakehead
'
))
==
132
except
IOError
as
e
:
raise
SkipTest
(
"
The database could not be queried; probably the db.sql3 file is missing. Here is the error:
'
%s
'"
%
e
)
\ No newline at end of file
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