diff --git a/bob/bio/base/database/__init__.py b/bob/bio/base/database/__init__.py index 72f5e78c1ccab5cf5ad3a67cb8b2a689401782dc..2e8ecb4b0d9ec6087f0b889f871779b2d541bf28 100644 --- a/bob/bio/base/database/__init__.py +++ b/bob/bio/base/database/__init__.py @@ -4,7 +4,7 @@ from .database import BioDatabase from .database import ZTBioDatabase from .filelist.query import FileListBioDatabase from .filelist.models import Client - +from . import filelist # gets sphinx autodoc done right - don't remove it def __appropriate__(*args): diff --git a/bob/bio/base/database/filelist/__init__.py b/bob/bio/base/database/filelist/__init__.py index cfb205f2615f5a8890b4c50f34d322b35be37f19..5067e4c9719d5b8edab6d382731811419f828938 100644 --- a/bob/bio/base/database/filelist/__init__.py +++ b/bob/bio/base/database/filelist/__init__.py @@ -1,5 +1,6 @@ -from .models import ListReader, Client +from .models import ListReader, Client, FileListFile from .query import FileListBioDatabase +from .driver import Interface # gets sphinx autodoc done right - don't remove it @@ -21,6 +22,8 @@ def __appropriate__(*args): __appropriate__( ListReader, Client, + FileListFile, FileListBioDatabase, + Interface, ) __all__ = [_ for _ in dir() if not _.startswith('_')] diff --git a/bob/bio/base/database/filelist/query.py b/bob/bio/base/database/filelist/query.py index ba067861d63fb19ac08a427cbddfb22457fb33ce..9e06211b18fdda43e3db100344964f84c689acab 100644 --- a/bob/bio/base/database/filelist/query.py +++ b/bob/bio/base/database/filelist/query.py @@ -21,6 +21,16 @@ class FileListBioDatabase(ZTBioDatabase): attribute when querying the database, it will be appended to the base directory, such that several protocols are supported by the same class instance of `bob.bio.base`. + name : str + The name of the database + + protocol : str + The protocol of the database. This should be a folder inside ``base_dir``. + + biofilecls : class + The class that should be used for return the files. + This can be `BioFile`, `AudioBioFile`, `FaceBioFile`, or anything similar. + original_directory : str or ``None`` The directory, where the original data can be found @@ -222,6 +232,17 @@ class FileListBioDatabase(ZTBioDatabase): def _make_bio(self, files): return [self.biofilecls(client_id=f.client_id, path=f.path, file_id=f.id) for f in files] + def all_files(self, groups=['dev']): + files = self.objects(groups, self.protocol, None, None, **self.all_files_options) + # add all files that belong to the ZT-norm + for group in groups: + if group == 'world': + continue + if self.implements_zt(self.protocol, group): + files += self.tobjects(group, self.protocol, None) + files += self.zobjects(group, self.protocol, **self.z_probe_options) + return self.sort(self._make_bio(files)) + def groups(self, protocol=None): """This function returns the list of groups for this database.