From 0c429d0f0c39b60b143777f989b92e8c4c148a82 Mon Sep 17 00:00:00 2001 From: Pavel Korshunov <pavel.korshunov@idiap.ch> Date: Wed, 19 Oct 2016 18:42:17 +0200 Subject: [PATCH] [sphinx] cleanup and fixes --- bob/pad/base/database/__init__.py | 3 +++ doc/experiments.rst | 13 +++++-------- doc/index.rst | 2 +- doc/installation.rst | 6 +----- doc/py_api.rst | 4 ---- 5 files changed, 10 insertions(+), 18 deletions(-) diff --git a/bob/pad/base/database/__init__.py b/bob/pad/base/database/__init__.py index f437a24..cc025f5 100644 --- a/bob/pad/base/database/__init__.py +++ b/bob/pad/base/database/__init__.py @@ -1,5 +1,8 @@ from .database import PadDatabase from .file import PadFile +# to fix sphinx warnings of not able to find classes, when path is shortened +PadDatabase.__module__ = "database" +PadFile.__module__ = "database" # gets sphinx autodoc done right - don't remove it __all__ = [_ for _ in dir() if not _.startswith('_')] diff --git a/doc/experiments.rst b/doc/experiments.rst index 71f6ca4..41bd096 100644 --- a/doc/experiments.rst +++ b/doc/experiments.rst @@ -86,15 +86,12 @@ To change this behavior, you can use the ``--verbose`` option several times to i 2) Informative messages 3) Debug messages -When running experiments, my personal preference is verbose level 2, which can be enabled by using the short version: ``-vv``. -So, a typical PAD experiment (in this case, attacks detection in speech) could look something like: +When running experiments, it is a good idea to set verbose level 2, which can be enabled by using the short version: ``-vv``. +So, a typical PAD experiment (in this case, attacks detection in speech) would look like the following: .. code-block:: sh - $ ./bin/spoof.py --database avspoof --preprocessor vad_energy --extractor lbp_hist --algorithm logregr --sub-directory pad_speech -vv - -.. note:: - To be able to run exactly the command line from above, it requires to have :ref:`bob.pad.voice <bob.pad.voice>` installed. + $ ./bin/spoof.py --database <database-name> --preprocessor <preprocessor> --extractor <extractor> --algorithm <algorithm> --sub-directory <folder_name> -vv Before running an experiment, it is recommended to add the ``--dry-run`` option, so that it will only print, which steps would be executed, without actually executing them, and make sure that everything works as expected. @@ -151,7 +148,7 @@ Hence, to run the same experiment as above using four parallel threads on the lo .. code-block:: sh - $ ./bin/spoof.py --database avspoof --preprocessor vad_energy --extractor lbp_hist --algorithm logregr --sub-directory pad_speech -vv --grid local-p4 --run-local-scheduler --nice 10 + $ ./bin/spoof.py --database <database-name> --preprocessor <preprocessor> --extractor <extractor> --algorithm <algorithm> --sub-directory <folder_name> -vv --grid local-p4 --run-local-scheduler --nice 10 .. note:: You might realize that the second execution of the same experiment is much faster than the first one. @@ -198,7 +195,7 @@ To change the protocol, you can either modify the configuration file, or simply Some databases define several kinds of evaluation setups. For example, often two groups of data are defined, a so-called *development set* and an *evaluation set*. -The scores of the two groups will be concatenated into two files called **scores-dev** and **scores-eval**, which are located in the score directory (see above). +The scores of the two groups will be concatenated into several files called **scores-dev** and **scores-eval**, which are located in the score directory (see above). In this case, by default only the development set is employed. To use both groups, just specify ``--groups dev eval`` (of course, you can also only use the ``'eval'`` set by calling ``--groups eval``). diff --git a/doc/index.rst b/doc/index.rst index 4397356..cb38cc7 100644 --- a/doc/index.rst +++ b/doc/index.rst @@ -34,7 +34,7 @@ The implementation of (most of) the tools is separated into other packages in th All these packages can be easily combined. Here is a growing list of derived packages: -* :ref:`bob.pad.voice <bob.pad.voice>` Tools to run presentation attack detection experiments for speech, including Cepstral-based feature and LBP-based feature extraction, GMM-based and logistic regression based algorithms, plot processing and score fusion scripts. +* `bob.pad.voice <http://pypi.python.org/pypi/bob.pad.voice>`__` Tools to run presentation attack detection experiments for speech, including several Cepstral-based features and LBP-based feature extraction, GMM-based and logistic regression based algorithms, as well as plot and score fusion scripts. If you are interested, please continue reading: diff --git a/doc/installation.rst b/doc/installation.rst index 094b115..a358a40 100644 --- a/doc/installation.rst +++ b/doc/installation.rst @@ -29,10 +29,6 @@ There, in the ``eggs`` section of the ``buildout.cfg`` file, simply list the ``b gridtk in order to download and install all packages that are required for your experiments. -In the example above, you might want to run a simple speech presentation attack detection -experiment using the :py:class:`bob.bio.spear.preprocessor.Mod_4Hz` and -the :py:class:`bob.pad.voice.extractor.LBPHistograms` feature extractor -defined in :ref:`bob.pad.voice <bob.pad.voice>`, using the AVspoof database interface defined in :ref:`bob.db.avspoof <bob.db.avspoof>`. Running the simple command line: .. code-block:: sh @@ -67,7 +63,7 @@ Please use ``./bin/databases.py`` for a list of known databases, where you can s .. note:: - If you have installed only ``bob.pad.base``, there is no database listed -- as all databases are included in other packages, such as :ref:`bob.pad.voice <bob.pad.voice>`. + If you have installed only ``bob.pad.base``, there is no database listed -- as all databases are included in other extension packages, such as :ref:`bob.pad.voice <bob.pad.voice>`. Test your Installation diff --git a/doc/py_api.rst b/doc/py_api.rst index 2b2910d..144fa54 100644 --- a/doc/py_api.rst +++ b/doc/py_api.rst @@ -40,10 +40,6 @@ Details .. automodule:: bob.pad.base - .. attribute:: valid_keywords - - Valid keywords, for which resources are defined, are ``('database', 'preprocessor', 'extractor', 'algorithm', 'grid')`` - .. automodule:: bob.pad.base.tools -- GitLab