Package: xbob.db.verification.filelist
The Verification Filelist database API provides mechanisms to create
an API for a verification database and protocol, the user providing
file lists.You would normally not install this package unless you are maintaining it. What
you would do instead is to tie it in at the package you need touseit.
There are a few ways to achieve this:You can add this package as a requirement at thesetup.pyfor your ownsatellite packageor to your Buildout.cfgfile, if you prefer it that way. With this
method, this package gets automatically downloaded and installed on your
working environment, orYou can manually download and install this package using commands likeeasy_installorpip.The package is available in two different distribution formats:You can download it fromPyPI, orYou can download it in its source form fromits git repository. When you download the
version at the git repository, you will need to run a command to recreate
the backend SQLite file required for its operation. This means that the
database raw files must be installed somewhere in this case. With optionayou can run indummymode and only download the raw data files for
the database once you are happy with your setup.You can mix and match points 1/2 and a/b above based on your requirements. Here
are some examples:Modify your setup.py and download from PyPIThat is the easiest. Edit yoursetup.pyin your satellite package and add
the following entry in theinstall_requiressection (note:...meanswhatever extra stuff you may have in-between, don’t put that on your
script):install_requires=[
  ...
  "xbob.db.verification.filelist",
],Proceed normally with yourbootstrap/buildoutsteps and you should be all
set. That means you can now import the namespacexbob.db.verification.filelistinto your scripts.Modify your buildout.cfg and download from gitYou will need to add a dependence tomr.developerto be able to install from our
git repositories. Yourbuildout.cfgfile should contain the following
lines:[buildout]
...
extensions = mr.developer
auto-checkout = *
eggs = bob
       ...
       xbob.db.verification.filelist

[sources]
xbob.db.verification.filelist = git https://github.com/bioidiap/xbob.db.verification.filelist.git
...Creating file listsThe initial step for using this package is to provide file lists specifying the world (train), development and evaluation set to be used by the biometric verification algorithm. The following files need to be created:For training:world file, with default nametrain_world.lst, and default subdirectorynorm. It is a 2-column file with format:filename client_idtwo (optional)world files, with default namestrain_optional_world_1.lstandtrain_optional_world_2.lst, and default subdirectorynorm. The format is the same as for the world file. These files are not needed for the most of the face recognition algorithms, hence, they need to be specified only if the algorithm uses them.For enrollment:twomodel filesfor the development and evaluation set, with default namefor_models.lstand default subdirectoriesdevandevalrespectively. They are 3-column files with format:filename model_id client_idFor scoring:1.a. twoprobe filesfor the development and evaluation set, with default namefor_probes.lstand default subdirectoriesdevandevalrespectively. These files need to be provided only if the scoring is to be done exhaustively, meaning by creating a dense probe/model scoring matrix. They are 2-column files with format:filename client_id1.b. twoscore filesfor the development and evaluation set, with default namefor_scores.lstand default subdirectoriesdevandevalrespectively.  These files need to be provided only if the scoring is to be done selectively, meaning by creating a sparse probe/model scoring matrix. They are 4-column files with format:filename model_id claimed_client_id client_idtwo (optional)files for t-score normalizationfor the development and evaluation set, with default namefor_tnorm.lstand default subdirectoriesdevandevalrespectively. They are 3-column files with format:filename model_id client_idtwo (optional)files for z-score normalizationfor the development and evaluation set, with default namefor_znorm.lstand default subdirectoriesdevandevalrespectively. They are 2-column files with format:filename client_idNoteThe verification queries will use either only the probe or only the score files, so only one of them is mandatory.
In case both probe and score files are provided, the user should set the parameteruse_dense_probe_file_list, which specifies the files to consider, when creating the object of theDatabaseclass.NoteIf the database does not provide an evaluation set, the scoring files can be ommited.
Similarly, if the user only definefor scoringfiles and omit the remaining ones, the only valid queries will be scoring-related ones.The summarized structure of the base directory (here denoted asbasedir) containing all the files should be like this:basedir -- norm -- train_world.lst
       |       |-- train_optional_world_1.lst
       |       |-- train_optional_world_2.lst
       |
       |-- dev -- for_models.lst
       |      |-- for_probes.lst
       |      |-- for_scores.lst
       |      |-- for_tnorm.lst
       |      |-- for_znorm.lst
       |
       |-- eval -- for_models.lst
               |-- for_probes.lst
               |-- for_scores.lst
               |-- for_tnorm.lst
               |-- for_znorm.lstProtocols and file listsWhen you instantiate a database, you have to specify the base directory that contains the file lists.
If you have only a single protocol, you could specify the full path to the file lists described
above as follows:>>> db = xbob.db.verification.filelist.Database('basedir/protocol')Next, you should query the data, WITHOUT specifying any protocol:>>> db.objects()Alternatively, if you have more protocols, you could do the following:>>> db = xbob.db.verification.filelist.Database('basedir')
>>> db.objects(protocol='protocol')When a protocol is specified, it is appended to the base directory that contains the file lists.
This allows to use several protocols that are stored in the same base directory, without the need
to instantiate a new database. For instance, given two protocols ‘P1’ and ‘P2’ (with filelists
contained in ‘basedir/P1’ and ‘basedir/P2’, respectively), the following would work:>> db = xbob.db.verification.filelist.Database('basedir')
>> db.objects(protocol='P1') # Get the objects for the protocol P1
>> db.objects(protocol='P2') # Get the objects for the protocol P2Note that if you use several protocols as explained above, the scoring part should be defined in
the same way for all the protocols, either by usingfor_probes.lstorfor_scores.lst.
This means that at the time of the database instantiation, it will be determined (or specified
using theuse_dense_probe_file_listoptional argument), whether the protocols should use
the content offor_probes.lstorfor_scores.lst. In particular, it is not possible to
use a mixture of those for different protocols, once the database object has been created.