Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
bob
bob.db.mobio
Commits
05c7aa82
Commit
05c7aa82
authored
Jan 09, 2013
by
Manuel Günther
Browse files
Based database on new version of verification utils.
parent
3d56a477
Changes
4
Hide whitespace changes
Inline
Side-by-side
setup.py
View file @
05c7aa82
...
...
@@ -9,7 +9,7 @@ from setuptools import setup, find_packages
setup
(
name
=
'xbob.db.mobio'
,
version
=
'1.0.
1
'
,
version
=
'1.0.
2
'
,
description
=
'MOBIO Database Access API for Bob'
,
url
=
'http://github.com/bioidiap/xbob.db.mobio'
,
license
=
'GPLv3'
,
...
...
@@ -25,7 +25,7 @@ setup(
install_requires
=
[
'setuptools'
,
'bob'
,
# base signal proc./machine learning library
'xbob.db.verification.utils'
# defines a set of utilities for face verification databases like this one.
'xbob.db.verification.utils
>=0.1.4
'
# defines a set of utilities for face verification databases like this one.
],
namespace_packages
=
[
...
...
xbob/db/mobio/driver.py
View file @
05c7aa82
...
...
@@ -77,7 +77,7 @@ def reverse(args):
output
=
null
()
r
=
db
.
reverse
(
args
.
path
)
for
id
in
r
:
output
.
write
(
'%d
\n
'
%
id
)
for
f
in
r
:
output
.
write
(
'%d
\n
'
%
f
.
id
)
if
not
r
:
return
1
...
...
xbob/db/mobio/query.py
View file @
05c7aa82
...
...
@@ -24,7 +24,7 @@ class Database(xbob.db.verification.utils.SQLiteDatabase, xbob.db.verification.u
def
__init__
(
self
):
# call base class constructors to open a session to the database
xbob
.
db
.
verification
.
utils
.
SQLiteDatabase
.
__init__
(
self
,
SQLITE_FILE
)
xbob
.
db
.
verification
.
utils
.
SQLiteDatabase
.
__init__
(
self
,
SQLITE_FILE
,
File
)
xbob
.
db
.
verification
.
utils
.
ZTDatabase
.
__init__
(
self
)
def
groups
(
self
):
...
...
@@ -492,48 +492,3 @@ class Database(xbob.db.verification.utils.SQLiteDatabase, xbob.db.verification.u
return
ProtocolPurpose
.
purpose_choices
def
paths
(
self
,
ids
,
prefix
=
None
,
suffix
=
None
):
"""Returns a full file paths considering particular file ids, a given
directory and an extension
Keyword Parameters:
id
The ids of the object in the database table "file". This object should be
a python iterable (such as a tuple or list).
prefix
The bit of path to be prepended to the filename stem
suffix
The extension determines the suffix that will be appended to the filename
stem.
Returns a list (that may be empty) of the fully constructed paths given the
file ids.
"""
fobj
=
self
.
query
(
File
).
filter
(
File
.
id
.
in_
(
ids
))
retval
=
[]
for
p
in
ids
:
retval
.
extend
([
k
.
make_path
(
prefix
,
suffix
)
for
k
in
fobj
if
k
.
id
==
p
])
return
retval
def
reverse
(
self
,
paths
):
"""Reverses the lookup: from certain stems, returning file ids
Keyword Parameters:
paths
The filename stems I'll query for. This object should be a python
iterable (such as a tuple or list)
Returns a list (that may be empty).
"""
fobj
=
self
.
query
(
File
).
filter
(
File
.
path
.
in_
(
paths
))
retval
=
[]
for
p
in
paths
:
retval
.
extend
([
k
.
id
for
k
in
fobj
if
k
.
path
==
p
])
return
retval
xbob/db/mobio/test.py
View file @
05c7aa82
...
...
@@ -69,7 +69,7 @@ class MobioDatabaseTest(unittest.TestCase):
self
.
assertTrue
(
db
.
has_subworld
(
'onethird'
))
def
test03_
file
s
(
self
):
def
test03_
object
s
(
self
):
db
=
Database
()
...
...
Write
Preview
Supports
Markdown
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