Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
bob
bob.db.kboc16
Commits
d88ed08c
Commit
d88ed08c
authored
Feb 03, 2016
by
mgbarrero
Browse files
bugs fixed
parent
699181da
Changes
2
Hide whitespace changes
Inline
Side-by-side
bob/db/KBOC16/models.py
View file @
d88ed08c
...
...
@@ -32,6 +32,7 @@ protocolPurpose_file_association = Table('protocolPurpose_file_association', Bas
db_file_extension
=
'.txt'
class
Client
(
Base
):
"""Database clients, marked by an integer identifier and the group they belong to"""
...
...
bob/db/KBOC16/query.py
View file @
d88ed08c
...
...
@@ -53,11 +53,6 @@ class Database(bob.db.verification.utils.SQLiteDatabase,bob.db.verification.util
return
ProtocolPurpose
.
group_choices
def
client_types
(
self
):
"""Returns the names of the types."""
return
Client
.
type_choices
def
client_groups
(
self
):
"""Returns the names of the groups. This is specific to this database which
does not have separate training, development and evaluation sets."""
...
...
@@ -80,12 +75,12 @@ class Database(bob.db.verification.utils.SQLiteDatabase,bob.db.verification.util
Returns: A list containing all the clients which have the given properties.
"""
groups
=
self
.
__group_replace_eval_by_genuine__
(
groups
)
groups
=
self
.
check_parameters_for_validity
(
groups
,
"group"
,
self
.
client_
type
s
())
"""
groups = self.__group_replace_eval_by_genuine__(groups)
groups = self.check_parameters_for_validity(groups, "group", self.client_
group
s())
"""
# List of the clients
q
=
self
.
query
(
Client
)
if
groups
:
q
=
q
.
filter
(
Client
.
s
type
.
in_
(
groups
))
"""
if groups:
q = q.filter(Client.s
group
.in_(groups))
"""
q
=
q
.
order_by
(
Client
.
id
)
return
list
(
q
)
...
...
@@ -106,7 +101,7 @@ class Database(bob.db.verification.utils.SQLiteDatabase,bob.db.verification.util
to the given group.
"""
groups
=
self
.
__group_replace_eval_by_genuine__
(
groups
)
#
groups = self.__group_replace_eval_by_genuine__(groups)
#groups = self.check_parameters_for_validity(groups, "group", ('Genuine',))
# List of the clients
...
...
@@ -202,7 +197,7 @@ class Database(bob.db.verification.utils.SQLiteDatabase,bob.db.verification.util
q
=
self
.
query
(
File
).
join
(
Client
).
join
((
ProtocolPurpose
,
File
.
protocolPurposes
)).
join
(
Protocol
).
\
filter
(
and_
(
Protocol
.
name
.
in_
(
protocol
),
ProtocolPurpose
.
sgroup
.
in_
(
groups
),
ProtocolPurpose
.
purpose
==
'enrol'
))
if
model_ids
:
q
=
q
.
filter
(
Client
.
sub
id
.
in_
(
model_ids
))
q
=
q
.
filter
(
Client
.
id
.
in_
(
model_ids
))
q
=
q
.
order_by
(
File
.
client_id
,
File
.
session_id
,
File
.
shot_id
)
retval
+=
list
(
q
)
...
...
@@ -211,7 +206,7 @@ class Database(bob.db.verification.utils.SQLiteDatabase,bob.db.verification.util
q
=
self
.
query
(
File
).
join
(
Client
).
join
((
ProtocolPurpose
,
File
.
protocolPurposes
)).
join
(
Protocol
).
\
filter
(
and_
(
Protocol
.
name
.
in_
(
protocol
),
ProtocolPurpose
.
sgroup
.
in_
(
groups
),
ProtocolPurpose
.
purpose
==
'probe'
))
if
model_ids
:
q
=
q
.
filter
(
Client
.
sub
id
.
in_
(
model_ids
))
q
=
q
.
filter
(
Client
.
id
.
in_
(
model_ids
))
q
=
q
.
order_by
(
File
.
client_id
,
File
.
session_id
,
File
.
shot_id
)
retval
+=
list
(
q
)
...
...
@@ -219,7 +214,7 @@ class Database(bob.db.verification.utils.SQLiteDatabase,bob.db.verification.util
q
=
self
.
query
(
File
).
join
(
Client
).
join
((
ProtocolPurpose
,
File
.
protocolPurposes
)).
join
(
Protocol
).
\
filter
(
and_
(
Protocol
.
name
.
in_
(
protocol
),
ProtocolPurpose
.
sgroup
.
in_
(
groups
),
ProtocolPurpose
.
purpose
==
'probe'
))
if
model_ids
:
q
=
q
.
filter
(
Client
.
sub
id
.
in_
(
model_ids
))
q
=
q
.
filter
(
Client
.
id
.
in_
(
model_ids
))
q
=
q
.
order_by
(
File
.
client_id
,
File
.
session_id
,
File
.
shot_id
)
retval
+=
list
(
q
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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