Commit 9981d93d authored by Tiago de Freitas Pereira's avatar Tiago de Freitas Pereira
Browse files

[refactoring2016] modifications in the contructor

parent 4e2fbfe2
Pipeline #3731 canceled with stage
in 16 minutes and 41 seconds
#!/usr/bin/env python
# vim: set fileencoding=utf-8 :
from .database import FaceBioFile
from .mobio import MobioBioDatabase
from .replay import ReplayBioDatabase
from .atnt import AtntBioDatabase
......
......@@ -33,4 +33,4 @@ class ARFaceBioDatabase(BioDatabase):
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)
return [FaceBioFile(BioFile(client_id=f.client_id, path=f.path, file_id=f.id)) for f in retval]
return [FaceBioFile(client_id=f.client_id, path=f.path, file_id=f.id) for f in retval]
......@@ -33,4 +33,4 @@ class AtntBioDatabase(BioDatabase):
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)
return [FaceBioFile(f) for f in retval]
return [FaceBioFile(client_id=f.client_id, path=f.path, file_id=f.id) for f in retval]
......@@ -36,12 +36,12 @@ class BancaBioDatabase(ZTBioDatabase):
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)
return [FaceBioFile(BioFile(client_id=f.client_id, path=f.path, file_id=f.id)) for f in retval]
return [FaceBioFile(client_id=f.client_id, path=f.path, file_id=f.id) for f in retval]
def tobjects(self, groups=None, protocol=None, model_ids=None, **kwargs):
retval = self.__db.tobjects(groups=groups, protocol=protocol, model_ids=model_ids, **kwargs)
return [FaceBioFile(BioFile(client_id=f.client_id, path=f.path, file_id=f.id)) for f in retval]
return [FaceBioFile(client_id=f.client_id, path=f.path, file_id=f.id) for f in retval]
def zobjects(self, groups=None, protocol=None, **kwargs):
retval = self.__db.zobjects(groups=groups, protocol=protocol, **kwargs)
return [FaceBioFile(BioFile(client_id=f.client_id, path=f.path, file_id=f.id)) for f in retval]
return [FaceBioFile(client_id=f.client_id, path=f.path, file_id=f.id) for f in retval]
......@@ -33,4 +33,4 @@ class CaspealBioDatabase(BioDatabase):
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)
return [FaceBioFile(BioFile(client_id=f.client_id, path=f.path, file_id=f.id)) for f in retval]
return [FaceBioFile(client_id=f.client_id, path=f.path, file_id=f.id) for f in retval]
......@@ -11,13 +11,9 @@ from bob.bio.base.database.file import BioFile
class FaceBioFile(BioFile):
def __init__(self, f):
def __init__(self, client_id, path, file_id):
"""
Initializes this File object with an File equivalent for
VoxForge database.
"""
super(FaceBioFile, self).__init__(client_id=f.client_id, path=f.path, file_id=f.id)
self.__f = f
super(FaceBioFile, self).__init__(client_id=client_id, path=path, file_id=id)
......@@ -33,4 +33,4 @@ class GBUBioDatabase(BioDatabase):
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)
return [FaceBioFile(BioFile(client_id=f.client_id, path=f.path, file_id=f.id)) for f in retval]
return [FaceBioFile(client_id=f.client_id, path=f.path, file_id=f.id) for f in retval]
......@@ -34,4 +34,4 @@ class LFWBioDatabase(BioDatabase):
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)
return [FaceBioFile(BioFile(client_id=f.client_id, path=f.path, file_id=f.id)) for f in retval]
return [FaceBioFile(client_id=f.client_id, path=f.path, file_id=f.id) for f in retval]
......@@ -38,12 +38,12 @@ class MobioBioDatabase(ZTBioDatabase):
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)
return [FaceBioFile(f) for f in retval]
return [FaceBioFile(client_id=f.client_id, path=f.path, file_id=f.id) for f in retval]
def tobjects(self, groups=None, protocol=None, model_ids=None, **kwargs):
retval = self.__db.tobjects(groups=groups, protocol=protocol, model_ids=model_ids, **kwargs)
return [FaceBioFile(f) for f in retval]
return [FaceBioFile(client_id=f.client_id, path=f.path, file_id=f.id) for f in retval]
def zobjects(self, groups=None, protocol=None, **kwargs):
retval = self.__db.zobjects(groups=groups, protocol=protocol, **kwargs)
return [FaceBioFile(f) for f in retval]
return [FaceBioFile(client_id=f.client_id, path=f.path, file_id=f.id) for f in retval]
......@@ -40,9 +40,9 @@ class MultipieBioDatabase(ZTBioDatabase):
def tobjects(self, groups=None, protocol=None, model_ids=None, **kwargs):
retval = self.__db.tobjects(groups=groups, protocol=protocol, model_ids=model_ids, **kwargs)
return [FaceBioFile(BioFile(client_id=f.client_id, path=f.path, file_id=f.id)) for f in retval]
return [FaceBioFile(client_id=f.client_id, path=f.path, file_id=f.id) for f in retval]
def zobjects(self, groups=None, protocol=None, **kwargs):
retval = self.__db.zobjects(groups=groups, protocol=protocol, **kwargs)
return [FaceBioFile(BioFile(client_id=f.client_id, path=f.path, file_id=f.id)) for f in retval]
return [FaceBioFile(client_id=f.client_id, path=f.path, file_id=f.id) for f in retval]
......@@ -106,9 +106,9 @@ class ReplayBioDatabase(BioDatabase):
retval = []
for f in objects:
if f.is_real():
retval.append(FaceBioFile(f))
retval.append(FaceBioFile(client_id=f.client_id, path=f.path, file_id=f.id))
else:
temp = FaceBioFile(f)
temp = FaceBioFile(client_id=f.client_id, path=f.path, file_id=f.id)
temp.client_id = 'attack'
retval.append(temp)
return retval
......@@ -36,12 +36,12 @@ class SCFaceBioDatabase(ZTBioDatabase):
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)
return [FaceBioFile(BioFile(client_id=f.client_id, path=f.path, file_id=f.id)) for f in retval]
return [FaceBioFile(client_id=f.client_id, path=f.path, file_id=f.id) for f in retval]
def tobjects(self, groups=None, protocol=None, model_ids=None, **kwargs):
retval = self.__db.tobjects(groups=groups, protocol=protocol, model_ids=model_ids, **kwargs)
return [FaceBioFile(BioFile(client_id=f.client_id, path=f.path, file_id=f.id)) for f in retval]
return [FaceBioFile(client_id=f.client_id, path=f.path, file_id=f.id) for f in retval]
def zobjects(self, groups=None, protocol=None, **kwargs):
retval = self.__db.zobjects(groups=groups, protocol=protocol, **kwargs)
return [FaceBioFile(BioFile(client_id=f.client_id, path=f.path, file_id=f.id)) for f in retval]
return [FaceBioFile(client_id=f.client_id, path=f.path, file_id=f.id) for f in retval]
......@@ -33,4 +33,4 @@ class XM2VTSBioDatabase(BioDatabase):
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)
return [FaceBioFile(BioFile(client_id=f.client_id, path=f.path, file_id=f.id)) for f in retval]
return [FaceBioFile(client_id=f.client_id, path=f.path, file_id=f.id) for f in retval]
Markdown is supported
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