utfvp.py 1.05 KB
Newer Older
1 2
#!/usr/bin/env python
# vim: set fileencoding=utf-8 :
3
# Tue 27 Sep 2016 16:49:05 CEST
4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29

from .database import VeinBioFile
from bob.bio.base.database import BioDatabase, BioFile


class UtfvpBioDatabase(BioDatabase):
    """
    Implements verification API for querying UTFVP Fingervein database.
    """

    def __init__(self, **kwargs):

        super(UtfvpBioDatabase, self).__init__(name='utfvp',
            **kwargs)
        from bob.db.utfvp.query import Database as LowLevelDatabase
        self.__db = LowLevelDatabase()

    def model_ids_with_protocol(self, groups=None, protocol=None, **kwargs):
        protocol = protocol if protocol is not None else self.protocol
        return self.__db.model_ids(groups=groups, protocol=protocol)

    def objects(self, groups=None, protocol=None, purposes=None,
        model_ids=None, **kwargs):

        retval = self.__db.objects(groups=groups, protocol=protocol,
            purposes=purposes, model_ids=model_ids, **kwargs)
30
        return [VeinBioFile(client_id=f.client_id, path=f.path, file_id=f.id) for f in retval]