Skip to content
Snippets Groups Projects
Commit 15bd9bb1 authored by Amir Mohammadi's avatar Amir Mohammadi
Browse files

Fix docs

parent f75a0030
No related branches found
No related tags found
1 merge request!1Add documentation
Pipeline #
...@@ -21,25 +21,22 @@ ...@@ -21,25 +21,22 @@
=========================== ===========================
This package provides pythonic bindings for Kaldi_ functionality so it can be This package provides pythonic bindings for Kaldi_ functionality so it can be
seemlessly integrated with Python-based workflows. It is a part fo the signal-processing and machine learning toolbox seamlessly integrated with Python-based workflows. It is a part fo the signal-
Bob_. processing and machine learning toolbox Bob_.
Installation Installation
------------ ------------
To install the package, install firt bob, and then install the bob.kaldi package: This package depends on both Bob_ and Kaldi_. To install Bob_ follow our
installation_ instructions. Kaldi_ is also bundled in our conda channnels which
means you can install Kaldi_ using conda easily too. After you have installed
Bob_, please follow these instructions to install Kaldi_ too.
$ conda install bob kaldi # BOB_ENVIRONMENT is the name of your conda enviroment.
$ source activate BOB_ENVIRONMENT
$ conda install kaldi
$ pip install bob.kaldi $ pip install bob.kaldi
To be able to work properly, some dependent packages are required to be installed.
Please make sure that you have read the `Dependencies
<https://github.com/idiap/bob/wiki/Dependencies>`_ for your operating system.
This package also requires that Kaldi_ is properly installed alongside the
Python interpreter you're using, under the directory ``<PREFIX>/lib/kaldi``,
along with all necessary scripts and compiled binaries.
Documentation Documentation
...@@ -48,7 +45,7 @@ Documentation ...@@ -48,7 +45,7 @@ Documentation
For further documentation on this package, please read the `Stable Version For further documentation on this package, please read the `Stable Version
<http://pythonhosted.org/bob.kaldi/index.html>`_ or the `Latest Version <http://pythonhosted.org/bob.kaldi/index.html>`_ or the `Latest Version
<https://www.idiap.ch/software/bob/docs/latest/bioidiap/bob.kaldi/master/index.html>`_ <https://www.idiap.ch/software/bob/docs/latest/bioidiap/bob.kaldi/master/index.html>`_
of the documentation. For a list of tutorials on this or the other packages ob of the documentation. For a list of tutorials on this or the other packages of
Bob_, or information on submitting issues, asking questions and starting Bob_, or information on submitting issues, asking questions and starting
discussions, please visit its website. discussions, please visit its website.
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
import bob.io.audio import bob.io.audio
import tempfile import tempfile
import os import os
.. _bob.kaldi: .. _bob.kaldi:
...@@ -48,14 +48,14 @@ MFCC Extraction ...@@ -48,14 +48,14 @@ MFCC Extraction
--------------- ---------------
Two functions are implemented to extract MFCC features Two functions are implemented to extract MFCC features
`bob.kaldi.mfcc` and `bob.kaldi.mfcc_from_path`. The former function :py:any:`bob.kaldi.mfcc` and :py:any:`bob.kaldi.mfcc_from_path`. The former function
accepts the speech samples as `numpy.ndarray`, whereas the latter the accepts the speech samples as :py:any:`numpy.ndarray`, whereas the latter the
filename as `str`, returning the features as `numpy.ndarray`: filename as :py:any:`str`, returning the features as :py:any:`numpy.ndarray`:
1. `bob.kaldi.mfcc` 1. `bob.kaldi.mfcc`
.. doctest:: .. doctest::
>>> sample = pkg_resources.resource_filename('bob.kaldi', 'test/data/sample16k.wav') >>> sample = pkg_resources.resource_filename('bob.kaldi', 'test/data/sample16k.wav')
>>> data = bob.io.audio.reader(sample) >>> data = bob.io.audio.reader(sample)
>>> feat = bob.kaldi.mfcc(data.load()[0], data.rate, normalization=False) >>> feat = bob.kaldi.mfcc(data.load()[0], data.rate, normalization=False)
...@@ -63,20 +63,20 @@ filename as `str`, returning the features as `numpy.ndarray`: ...@@ -63,20 +63,20 @@ filename as `str`, returning the features as `numpy.ndarray`:
(317, 39) (317, 39)
2. `bob.kaldi.mfcc_from_path` 2. `bob.kaldi.mfcc_from_path`
.. doctest:: .. doctest::
>>> sample = pkg_resources.resource_filename('bob.kaldi', 'test/data/sample16k.wav') >>> sample = pkg_resources.resource_filename('bob.kaldi', 'test/data/sample16k.wav')
>>> feat = bob.kaldi.mfcc_from_path(sample) >>> feat = bob.kaldi.mfcc_from_path(sample)
>>> print (feat.shape) >>> print (feat.shape)
(317, 39) (317, 39)
==================== ====================
Speaker recognition Speaker recognition
==================== ====================
UBM training and evaluation UBM training and evaluation
--------------------------- ---------------------------
...@@ -105,13 +105,13 @@ Following guide describes how to run whole speaker recognition experiments: ...@@ -105,13 +105,13 @@ Following guide describes how to run whole speaker recognition experiments:
1. To run the UBM-GMM with MAP adaptation speaker recognition experiment, run: 1. To run the UBM-GMM with MAP adaptation speaker recognition experiment, run:
.. code-block:: sh .. code-block:: sh
verify.py -d 'mobio-audio-male' -p 'energy-2gauss' -e 'mfcc-kaldi' -a 'gmm-kaldi' -s exp-gmm-kaldi --groups {dev,eval} -R '/your/work/directory/' -T '/your/temp/directory' -vv verify.py -d 'mobio-audio-male' -p 'energy-2gauss' -e 'mfcc-kaldi' -a 'gmm-kaldi' -s exp-gmm-kaldi --groups {dev,eval} -R '/your/work/directory/' -T '/your/temp/directory' -vv
2. To run the ivector+plda speaker recognition experiment, run: 2. To run the ivector+plda speaker recognition experiment, run:
.. code-block:: sh .. code-block:: sh
verify.py -d 'mobio-audio-male' -p 'energy-2gauss' -e 'mfcc-kaldi' -a 'ivector-plda-kaldi' -s exp-ivector-plda-kaldi --groups {dev,eval} -R '/your/work/directory/' -T '/your/temp/directory' -vv verify.py -d 'mobio-audio-male' -p 'energy-2gauss' -e 'mfcc-kaldi' -a 'ivector-plda-kaldi' -s exp-ivector-plda-kaldi --groups {dev,eval} -R '/your/work/directory/' -T '/your/temp/directory' -vv
3. Results: 3. Results:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment