Commit 274bc509 authored by Tiago de Freitas Pereira's avatar Tiago de Freitas Pereira
Browse files

# This is a combination of 2 commits.

# This is the 1st commit message:

[sphinx] Redoing the documentation

[sphinx] Documenting

[sphinx] Documenting

[sphinx] Update documentation

# This is the commit message #2:

Added a template script for the vanilla pipeline
parent f0fd3f1d
......@@ -12,6 +12,10 @@ import click
from bob.extension.scripts.click_helper import verbosity_option, ResourceOption, ConfigCommand
import logging
logger = logging.getLogger(__name__)
EPILOG = """\b
......@@ -110,7 +114,6 @@ TODO: Work out this help
default="results",
help="Name of output directory",
)
@verbosity_option(cls=ResourceOption)
def vanilla_biometrics(
preprocessor,
extractor,
......@@ -165,7 +168,7 @@ def vanilla_biometrics(
"""
# Always turn-on the checkpointing
checkpointing = True
......@@ -224,3 +227,42 @@ def vanilla_biometrics(
print(reference.subject, probe.subject, probe.path, reference.data)
dask_client.shutdown()
@click.command()
@click.argument("output-file")
@verbosity_option(cls=ResourceOption)
def vanilla_biometrics_template(output_file, **kwargs):
"""
Generate an template configuration file for the vanilla biometrics pipeline
"""
import bob.io.base
path = os.path.dirname(output_file)
logger.info(f"Writting template configuration file in {path}")
bob.io.base.create_directories_safe(path)
template = '''
# Client dask. Look at https://gitlab.idiap.ch/bob/bob.pipelines/tree/master/bob/pipelines/config/distributed to find proper dask clients.
# You don't need to necessary instantiate a dask client yourself. You can simply pipe those config files
dask_client = my_client
preprocessor = my_preprocessor
extractor = my_extractor
algorithm = my_algorithm
database = my_database
'''
open(output_file, "w").write(template)
......@@ -5,18 +5,35 @@
.. _bob.bio.base.experiments:
==========================================
Running Biometric Recognition Experiments
==========================================
======================================================================
Running Biometric Recognition Experiments with the Vanilla Biometrics
======================================================================
Now, you are ready to run your first biometric recognition experiment.
.. _running_part_1:
Running Experiments (part I)
----------------------------
To run an experiment, we provide a generic script ``verify.py``.
As a default, ``verify.py`` accepts one or more *configuration files* that include the parametrization of the experiment to run.
Running Experiments.
--------------------
The previous section described the :ref:`bob.bio.base.struct_bio_rec_sys` using two sub-pipelines (three if you count the optional one) in a rough manner.
This section will describe in detail such sub-pipelines and its relation with biometric experiments.
These sub-pipelines were built using `Dask delayed <https://docs.dask.org/en/latest/delayed.html>`_ ; please follow the Dask documentation for more information about it.
Another source of information is the `TAM tutorial given at Idiap <https://github.com/tiagofrepereira2012/tam->`_
To run biometric experiments, we provide a generic CLI command called ``bob pipelines``.
Such CLI commands are entry-points to any kind of pipeline implemented under `bob.pipelines`.
This tutorial will focus on the pipeline called `vanilla-biometrics`.
.. code-block:: sh
bob pipelines vanilla-biometrics --help
As a default, the ``vanilla-biometrics`` pipeline accepts one or more *configuration files* that include the parametrization of the experiment to run.
A configuration file contains one ore more *variables* that define parts of the experiment.
When several configuration files are specified, the variables of the latter will overwrite the ones of the former.
For simplicity, here we discuss only a single configuration file.
......@@ -25,7 +42,7 @@ As a start, we have implemented a shortcut to generate an empty configuration fi
.. code-block:: sh
$ verify.py --create-configuration-file experiment.py
$ bob pipelines vanilla-biometrics-template experiment.py
.. note::
The generated ``experiment.py`` is a regular python file, so you can include any regular python code inside this file.
......@@ -36,6 +53,7 @@ But, no worries, most of them have proper default values.
However, there are five variables, which are required and sufficient to define the complete biometric recognition experiment.
These five variables are:
* ``dask_client``: The Dask client pointing the execution backend
* ``database``: The database to run the experiments on
* ``preprocessor``: The data preprocessor
* ``extractor``: The feature extractor
......
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg version="1.2" width="210mm" height="297mm" viewBox="0 0 21000 29700" preserveAspectRatio="xMidYMid" fill-rule="evenodd" stroke-width="28.222" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg" xmlns:ooo="http://xml.openoffice.org/svg/export" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:presentation="http://sun.com/xmlns/staroffice/presentation" xmlns:smil="http://www.w3.org/2001/SMIL20/" xmlns:anim="urn:oasis:names:tc:opendocument:xmlns:animation:1.0" xml:space="preserve">
<svg version="1.2" width="210mm" height="148mm" viewBox="0 0 21000 14800" preserveAspectRatio="xMidYMid" fill-rule="evenodd" stroke-width="28.222" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg" xmlns:ooo="http://xml.openoffice.org/svg/export" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:presentation="http://sun.com/xmlns/staroffice/presentation" xmlns:smil="http://www.w3.org/2001/SMIL20/" xmlns:anim="urn:oasis:names:tc:opendocument:xmlns:animation:1.0" xml:space="preserve">
<defs class="ClipPathGroup">
<clipPath id="presentation_clip_path" clipPathUnits="userSpaceOnUse">
<rect x="0" y="0" width="21000" height="29700"/>
<rect x="0" y="0" width="21000" height="14800"/>
</clipPath>
<clipPath id="presentation_clip_path_shrink" clipPathUnits="userSpaceOnUse">
<rect x="21" y="29" width="20958" height="29641"/>
<rect x="21" y="14" width="20958" height="14771"/>
</clipPath>
</defs>
<defs>
......
No preview for this file type
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg version="1.2" width="210mm" height="297mm" viewBox="0 0 21000 29700" preserveAspectRatio="xMidYMid" fill-rule="evenodd" stroke-width="28.222" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg" xmlns:ooo="http://xml.openoffice.org/svg/export" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:presentation="http://sun.com/xmlns/staroffice/presentation" xmlns:smil="http://www.w3.org/2001/SMIL20/" xmlns:anim="urn:oasis:names:tc:opendocument:xmlns:animation:1.0" xml:space="preserve">
<svg version="1.2" width="210mm" height="148mm" viewBox="0 0 21000 14800" preserveAspectRatio="xMidYMid" fill-rule="evenodd" stroke-width="28.222" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg" xmlns:ooo="http://xml.openoffice.org/svg/export" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:presentation="http://sun.com/xmlns/staroffice/presentation" xmlns:smil="http://www.w3.org/2001/SMIL20/" xmlns:anim="urn:oasis:names:tc:opendocument:xmlns:animation:1.0" xml:space="preserve">
<defs class="ClipPathGroup">
<clipPath id="presentation_clip_path" clipPathUnits="userSpaceOnUse">
<rect x="0" y="0" width="21000" height="29700"/>
<rect x="0" y="0" width="21000" height="14800"/>
</clipPath>
<clipPath id="presentation_clip_path_shrink" clipPathUnits="userSpaceOnUse">
<rect x="21" y="29" width="20958" height="29641"/>
<rect x="21" y="14" width="20958" height="14771"/>
</clipPath>
</defs>
<defs>
......
No preview for this file type
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg version="1.2" width="210mm" height="297mm" viewBox="0 0 21000 29700" preserveAspectRatio="xMidYMid" fill-rule="evenodd" stroke-width="28.222" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg" xmlns:ooo="http://xml.openoffice.org/svg/export" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:presentation="http://sun.com/xmlns/staroffice/presentation" xmlns:smil="http://www.w3.org/2001/SMIL20/" xmlns:anim="urn:oasis:names:tc:opendocument:xmlns:animation:1.0" xml:space="preserve">
<svg version="1.2" width="210mm" height="148mm" viewBox="0 0 21000 14800" preserveAspectRatio="xMidYMid" fill-rule="evenodd" stroke-width="28.222" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg" xmlns:ooo="http://xml.openoffice.org/svg/export" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:presentation="http://sun.com/xmlns/staroffice/presentation" xmlns:smil="http://www.w3.org/2001/SMIL20/" xmlns:anim="urn:oasis:names:tc:opendocument:xmlns:animation:1.0" xml:space="preserve">
<defs class="ClipPathGroup">
<clipPath id="presentation_clip_path" clipPathUnits="userSpaceOnUse">
<rect x="0" y="0" width="21000" height="29700"/>
<rect x="0" y="0" width="21000" height="14800"/>
</clipPath>
<clipPath id="presentation_clip_path_shrink" clipPathUnits="userSpaceOnUse">
<rect x="21" y="29" width="20958" height="29641"/>
<rect x="21" y="14" width="20958" height="14771"/>
</clipPath>
</defs>
<defs>
......
......@@ -22,6 +22,19 @@ The ``bob.bio`` packages contain several implementations of each of the above st
.. note::
The ``bob.bio`` packages are derived from the former `FaceRecLib <http://pypi.python.org/pypi/facereclib>`__, which is herewith outdated.
bob.bio.base in one shot
========================
If you are too lazy to go through the documentation, and just want to see what this is about, just run the command below:
.. code-block:: sh
bob pipelines vanilla-biometrics --help
Structure of the Biometric Recognition Framework
================================================
......
......@@ -196,3 +196,4 @@ The protocol also defines, which models should be compared to which probes.
.. include:: links.rst
......@@ -142,6 +142,7 @@ setup(
# run pipelines
'bob.pipelines.cli':[
'vanilla-biometrics = bob.bio.base.script.vanilla_biometrics:vanilla_biometrics',
'vanilla-biometrics-template = bob.bio.base.script.vanilla_biometrics:vanilla_biometrics_template'
],
......
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