Commit 05c7aa82 authored by Manuel Günther's avatar Manuel Günther
Browse files

Based database on new version of verification utils.

parent 3d56a477
......@@ -9,7 +9,7 @@ from setuptools import setup, find_packages
description='MOBIO Database Access API for Bob',
......@@ -25,7 +25,7 @@ setup(
'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 = [
......@@ -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' %
if not r: return 1
......@@ -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)
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:
The ids of the object in the database table "file". This object should be
a python iterable (such as a tuple or list).
The bit of path to be prepended to the filename stem
The extension determines the suffix that will be appended to the filename
Returns a list (that may be empty) of the fully constructed paths given the
file ids.
fobj = self.query(File).filter(
retval = []
for p in ids:
retval.extend([k.make_path(prefix, suffix) for k in fobj if == p])
return retval
def reverse(self, paths):
"""Reverses the lookup: from certain stems, returning file ids
Keyword Parameters:
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([ for k in fobj if k.path == p])
return retval
......@@ -69,7 +69,7 @@ class MobioDatabaseTest(unittest.TestCase):
def test03_files(self):
def test03_objects(self):
db = Database()
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment