Defining baselinesΒΆ
Once you have a biometric system well established, tuned and working for a particular database (or a particular set of databases), you may want to provide an easier to reproduce way to share it. For this purpose, we defined something called baseline.
A baseline (bob.bio.base.baseline.Baseline
) is composed by the triplet
of bob.bio.base.preprocessor.Preprocessor
,
bob.bio.base.extractor.Extractor
and
bob.bio.base.algorithm.Algorithm
.
First, check it out the baselines ready to be triggered in your environment by doing:
$ bob bio baseline --help
For example, if you run bob bio baseline -vvv eigenface atnt
, it will run
the eigenface face recognition baseline on the atnt database (assuming you have
installed bob.bio.face
and bob.db.atnt
).
To create your own baseline, you just need to define it like in the recipe below:
from bob.bio.base.baseline import Baseline
baseline = Baseline(name="my-baseline",
preprocessors={"default": 'my-preprocessor'},
extractor='my-extractor'),
algorithm='my-algorithm'))
Some databases may require some specific preprocessors depending on the type of meta-informations provided. For instance, for some face recognition databases, faces should be cropped in a particular way depending on the annotations provided. To approach this issue, the preprocessors are defined in a dictionary, with a generic preprocessor defined as default and the database specific preprocessor defined by database name as in the example below:
self.preprocessors = dict()
self.preprocessors["default"] = 'my-preprocessor'
self.preprocessors["database_name"] = 'my-specific-preprocessor'
Follow below a full example on how to define a baseline with database specific preprocessors.
from bob.bio.base.baseline import Baseline
preprocessors = {"default": 'my-preprocessor'}
preprocessors["database_name"] = 'my-specific-preprocessor'
baseline = Baseline(name="another-baseline",
preprocessors=preprocessors,
extractor='my-extractor'),
algorithm='my-algorithm'))
Note
The triplet can be a resource or a configuration file. This works in the same way as in Running Experiments.
Note
Baselines are also registered as resources under the keyword bob.bio.baseline.
You can find the list of readily available baselines using the resources.py
command:
$ resources.py --types baseline