Commit 91012f61 authored by Anthony Larcher's avatar Anthony Larcher
Browse files

move to 1.2

parent 32d386e7
......@@ -22,7 +22,7 @@
# along with SIDEKIT. If not, see <http://www.gnu.org/licenses/>.
"""
Copyright 2014-2016 Anthony Larcher and Sylvain Meignier
Copyright 2014-2017 Anthony Larcher and Sylvain Meignier
"""
from ctypes import *
......
......@@ -493,8 +493,6 @@
<span class="k">if</span> <span class="n">input_feature_filename</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span><span class="p">:</span>
<span class="bp">self</span><span class="o">.</span><span class="n">feature_filename_structure</span> <span class="o">=</span> <span class="n">input_feature_filename</span>
<span class="n">feature_filename</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">feature_filename_structure</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="n">show</span><span class="p">)</span>
<span class="nb">print</span><span class="p">(</span><span class="s1">&#39;feature_filename = &#39;</span><span class="p">,</span><span class="n">feature_filename</span><span class="p">)</span>
<span class="nb">print</span><span class="p">(</span><span class="s1">&#39;show = &#39;</span><span class="p">,</span><span class="n">show</span><span class="p">)</span>
<span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">dataset_list</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span><span class="p">:</span>
<span class="bp">self</span><span class="o">.</span><span class="n">previous_load</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">get_features</span><span class="p">(</span><span class="n">show</span><span class="p">,</span>
......@@ -532,7 +530,7 @@
<span class="sd"> &quot;&quot;&quot;</span>
<span class="k">if</span> <span class="n">input_feature_filename</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span><span class="p">:</span>
<span class="bp">self</span><span class="o">.</span><span class="n">feature_filename_structure</span> <span class="o">=</span> <span class="n">input_feature_filename</span>
<span class="nb">print</span><span class="p">(</span><span class="s2">&quot;open: &quot;</span><span class="p">,</span><span class="bp">self</span><span class="o">.</span><span class="n">feature_filename_structure</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="n">show</span><span class="p">))</span>
<span class="c1"># If no extractor for this source, open hdf5 file and return handler</span>
<span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">features_extractor</span> <span class="ow">is</span> <span class="kc">None</span><span class="p">:</span>
<span class="n">h5f</span> <span class="o">=</span> <span class="n">h5py</span><span class="o">.</span><span class="n">File</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">feature_filename_structure</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="n">show</span><span class="p">),</span> <span class="s2">&quot;r&quot;</span><span class="p">)</span>
......@@ -542,7 +540,6 @@
<span class="n">h5f</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">features_extractor</span><span class="o">.</span><span class="n">extract</span><span class="p">(</span><span class="n">show</span><span class="p">,</span> <span class="n">channel</span><span class="p">,</span> <span class="n">input_audio_filename</span><span class="o">=</span><span class="n">input_feature_filename</span><span class="p">)</span>
<span class="c1"># Get the selected segment</span>
<span class="nb">print</span><span class="p">(</span><span class="s2">&quot;show = &quot;</span><span class="p">,</span> <span class="n">show</span><span class="p">)</span>
<span class="n">dataset_length</span> <span class="o">=</span> <span class="n">h5f</span><span class="p">[</span><span class="n">show</span> <span class="o">+</span> <span class="s2">&quot;/&quot;</span> <span class="o">+</span> <span class="nb">next</span><span class="p">(</span><span class="n">h5f</span><span class="p">[</span><span class="n">show</span><span class="p">]</span><span class="o">.</span><span class="n">__iter__</span><span class="p">())]</span><span class="o">.</span><span class="n">shape</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span>
<span class="c1"># Deal with the case where start &lt; 0 or stop &gt; feat.shape[0]</span>
<span class="k">if</span> <span class="n">start</span> <span class="ow">is</span> <span class="kc">None</span><span class="p">:</span>
......
This diff is collapsed.
......@@ -27,7 +27,7 @@
<link rel="index" title="Index" href="../genindex.html" />
<link rel="search" title="Search" href="../search.html" />
<link rel="next" title="1. Save the features in HDF5 format" href="hdf5.html" />
<link rel="prev" title="How to manage the data: IdMap, Ndx, Key, Scores and StatServer" href="dataManagment.html" />
<link rel="prev" title="Parallel computation in SIDEKIT" href="parallel_computation.html" />
</head>
<body role="document">
<div class="related" role="navigation" aria-label="related navigation">
......@@ -43,7 +43,7 @@
<a href="hdf5.html" title="1. Save the features in HDF5 format"
accesskey="N">next</a> |</li>
<li class="right" >
<a href="dataManagment.html" title="How to manage the data: IdMap, Ndx, Key, Scores and StatServer"
<a href="parallel_computation.html" title="Parallel computation in SIDEKIT"
accesskey="P">previous</a> |</li>
<li class="nav-item nav-item-0"><a href="../index.html">SIDEKIT documentation</a> &#187;</li>
<li class="nav-item nav-item-1"><a href="index.html" >Tutorials</a> &#187;</li>
......@@ -53,8 +53,8 @@
<div class="sphinxsidebar" role="navigation" aria-label="main navigation">
<div class="sphinxsidebarwrapper">
<h4>Previous topic</h4>
<p class="topless"><a href="dataManagment.html"
title="previous chapter">How to manage the data: IdMap, Ndx, Key, Scores and StatServer</a></p>
<p class="topless"><a href="parallel_computation.html"
title="previous chapter">Parallel computation in SIDEKIT</a></p>
<h4>Next topic</h4>
<p class="topless"><a href="hdf5.html"
title="next chapter">1. Save the features in HDF5 format</a></p>
......@@ -139,7 +139,7 @@ acoustic features. The HDF5 format is the prefered serialization format in <stro
<a href="hdf5.html" title="1. Save the features in HDF5 format"
>next</a> |</li>
<li class="right" >
<a href="dataManagment.html" title="How to manage the data: IdMap, Ndx, Key, Scores and StatServer"
<a href="parallel_computation.html" title="Parallel computation in SIDEKIT"
>previous</a> |</li>
<li class="nav-item nav-item-0"><a href="../index.html">SIDEKIT documentation</a> &#187;</li>
<li class="nav-item nav-item-1"><a href="index.html" >Tutorials</a> &#187;</li>
......
......@@ -94,6 +94,11 @@
<li class="toctree-l2"><a class="reference internal" href="dataManagment.html#statserver">StatServer</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="parallel_computation.html">Parallel computation in SIDEKIT</a><ul>
<li class="toctree-l2"><a class="reference internal" href="parallel_computation.html#multiprocessing">Multiprocessing</a></li>
<li class="toctree-l2"><a class="reference internal" href="parallel_computation.html#id1">MPI</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="featureExtraction.html">Acoustic parametrization</a><ul>
<li class="toctree-l2"><a class="reference internal" href="hdf5.html">1. Save the features in HDF5 format</a></li>
<li class="toctree-l2"><a class="reference internal" href="featuresextractor.html">2. The FeaturesExtractor object</a></li>
......@@ -103,16 +108,23 @@
<li class="toctree-l1"><a class="reference internal" href="ubmTraining.html">Train a Universal Background Model</a><ul>
<li class="toctree-l2"><a class="reference internal" href="ubmTraining.html#training-using-em-split">1. Training using EM split</a></li>
<li class="toctree-l2"><a class="reference internal" href="ubmTraining.html#training-using-simple-em-with-fixed-number-of-distributions">2. Training using simple EM with fixed number of distributions</a></li>
<li class="toctree-l2"><a class="reference internal" href="ubmTraining.html#full-covariance-ubm">3 Full covariance UBM</a></li>
<li class="toctree-l2"><a class="reference internal" href="ubmTraining.html#training-using-em-split-on-several-nodes">3. Training using EM split on several nodes</a></li>
<li class="toctree-l2"><a class="reference internal" href="ubmTraining.html#full-covariance-ubm">4 Full covariance UBM</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="tv_estimation.html">Train an i-vector extractor</a><ul>
<li class="toctree-l2"><a class="reference internal" href="tv_estimation.html#using-a-single-process-on-one-machine">Using a single process on one machine</a></li>
<li class="toctree-l2"><a class="reference internal" href="tv_estimation.html#using-multiple-process-on-one-machine-with-python-multiprocessing">Using multiple process on one machine with Python MultiProcessing</a></li>
<li class="toctree-l2"><a class="reference internal" href="tv_estimation.html#using-multiple-process-on-multiple-nodes-with-mpi">Using multiple process on multiple nodes with MPI</a></li>
<li class="toctree-l2"><a class="reference internal" href="tv_estimation.html#get-to-know-the-algorithm-with-total-variability-raw">1. Get to know the algorithm with total_variability_raw</a></li>
<li class="toctree-l2"><a class="reference internal" href="tv_estimation.html#using-a-single-process-on-one-machine">2. Using a single process on one machine</a></li>
<li class="toctree-l2"><a class="reference internal" href="tv_estimation.html#using-multiple-process-on-one-machine-with-python-multiprocessing">3. Using multiple process on one machine with Python MultiProcessing</a></li>
<li class="toctree-l2"><a class="reference internal" href="tv_estimation.html#using-multiple-process-on-multiple-nodes-with-mpi">4. Using multiple process on multiple nodes with MPI</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="extractIVectors.html">Extract your I-Vectors</a><ul>
<li class="toctree-l2"><a class="reference internal" href="extractIVectors.html#extract-i-vectors-in-a-single-process">1. Extract i-vectors in a single process</a></li>
<li class="toctree-l2"><a class="reference internal" href="extractIVectors.html#extract-i-vectors-on-multiple-process-on-a-single-node">2. Extract i-vectors on multiple process on a single node</a></li>
<li class="toctree-l2"><a class="reference internal" href="extractIVectors.html#extract-i-vectors-on-multiple-nodes">3. Extract i-vectors on multiple nodes</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="extractIVectors.html">Extract your I-Vectors</a></li>
<li class="toctree-l1"><a class="reference internal" href="bnfExtraction.html">Bottleneck features extraction</a></li>
<li class="toctree-l1"><a class="reference internal" href="dnnStat.html">Phonetically aware Neural Network for speaker recognition</a></li>
</ul>
......
......@@ -44,6 +44,7 @@ What's here?
overview/index.rst
install/index.rst
api/envvar.rst
api/index.rst
tutorial/index.rst
addon/index.rst
......
......@@ -53,7 +53,7 @@ Set your own parameters
.. code:: python
distribNb = 512 # number of Gaussian distributions for each GMM
rsr2015Path = '/lium/corpus/vrac/RSR2015_V1/'
rsr2015Path = '/lium/corpus/audio/tel/en/RSR2015_v1/'
# Default for RSR2015
audioDir = os.path.join(rsr2015Path , 'sph/male')
......@@ -84,7 +84,7 @@ Process the audio to generate MFCC
.. code:: python
# Extract features
extractor = sidekit.FeaturesExtractor(audio_filename_structure="/lium/corpus/audio/tel/en/RSR2015_v1/sph/male/{}.wav",
extractor = sidekit.FeaturesExtractor(audio_filename_structure=audioDir + "/{}.sph",
feature_filename_structure="{}.h5",
sampling_frequency=16000,
lower_frequency=133.3333,
......
......@@ -5,6 +5,7 @@ Enter the SIDEKIT
:maxdepth: 2
dataManagment
parallel_computation
featureExtraction
ubmTraining
tv_estimation
......
......@@ -88,7 +88,42 @@ Indeed, this method doesn't use any FeaturesServer but takes a ndarray containin
as rows.
3 Full covariance UBM
3. Training using EM split on several nodes
-------------------------------------------
**SIDEKIT** allows parallel training of GMM using several nodes (machines) via the Message Passing Interface (MPI).
First, make sure MPI is installed on each node you intend to use.
Then enable the use of MPI by setting your environment variable to something like: ``SIDEKIT="mpi=true"``.
You're now ready to train your GMM by running:
.. code:: python
ubm = sidekit.Mixture()
sidekit.sidekit_mpi.EM_split(ubm=ubm,
features_server=fs,
feature_list=ubm_list,
distrib_nb=2048,
output_filename="ubm_tandem_mpi",
iterations=(1, 2, 2, 4, 4, 4, 4, 8, 8, 8, 8, 8, 8, 8, 8),
llk_gain=0.01,
save_partial=True,
ceil_cov=10,
floor_cov=1e-2,
num_thread=30)
Where:
- ``fs`` is a ``FeaturesServer`` object used to load the acoustic features
- ``ubm_list`` is a list of shows (sessions) to process
Parameter ``num_thread`` is related to Multiprocessing that is used to load the features at first on Node 0.
Note that Multiprocessing is not used later in the process.
Refer to the :ref:`MPI`. page to see how to launch your computation on several nodes.
4 Full covariance UBM
---------------------
In order to train full covariance GMMs you can first train a GMM with diagonal covariance
......
......@@ -21,7 +21,7 @@
# You should have received a copy of the GNU Lesser General Public License
# along with SIDEKIT. If not, see <http://www.gnu.org/licenses/>.
"""
Copyright 2014-2016 Sylvain Meignier and Anthony Larcher
Copyright 2014-2017 Sylvain Meignier and Anthony Larcher
:mod:`factor_analyser` provides methods to train different types of factor analysers
......@@ -40,7 +40,7 @@ from sidekit.mixture import Mixture
from sidekit.sidekit_wrappers import process_parallel_lists, deprecated, check_path_existance
def E_on_batch(stat0, stat1, ubm, F):
def e_on_batch(stat0, stat1, ubm, F):
"""
Compute statistics for the Expectation step on a batch of data
......@@ -83,7 +83,7 @@ def E_on_batch(stat0, stat1, ubm, F):
return e_h, e_hh
def E_worker(arg, q):
def e_worker(arg, q):
"""
Encapsulates the method that compute statistics for expectation step
......@@ -94,10 +94,10 @@ def E_worker(arg, q):
a factor loading matrix
:param q: output queue (a multiprocessing.Queue object)
"""
q.put(arg[:2] + E_on_batch(*arg))
q.put(arg[:2] + e_on_batch(*arg))
def E_gather(arg, q):
def e_gather(arg, q):
"""
Consumer that sums accumulators stored in the memory
......@@ -128,10 +128,11 @@ def iv_extract_on_batch(arg, q):
:param q: the output queue to fill (a multiprocessing.Queue object)
"""
batch_indices, stat0, stat1, ubm, F = arg
E_h, E_hh = E_on_batch(stat0, stat1, ubm, F)
E_h, E_hh = e_on_batch(stat0, stat1, ubm, F)
tv_rank = E_h.shape[1]
q.put((batch_indices,) + (E_h, E_hh[:, numpy.array([i * tv_rank-((i*(i-1))//2) for i in range(tv_rank)])]))
def iv_collect(arg, q):
"""
Consumer method that takes inputs from a queue and fill matrices with i-vectors
......@@ -157,9 +158,7 @@ def iv_collect(arg, q):
@process_parallel_lists
def fa_model_loop(batch_start,
mini_batch_indices,
r,
phi,
sigma,
factor_analyser,
stat0,
stat1,
e_h,
......@@ -170,33 +169,34 @@ def fa_model_loop(batch_start,
:param batch_start: index to start at in the list
:param mini_batch_indices: indices of the elements in the list (should start at zero)
:param r: rank of the matrix
:param phi: factor matrix
:param sigma: covariance matrix
:param factor_analyser: FactorAnalyser object
:param stat0: matrix of zero order statistics
:param stat1: matrix of first order statistics
:param e_h: accumulator
:param e_hh: accumulator
:param num_thread: number of parallel process to run
"""
if sigma.ndim == 2:
A = phi.T.dot(phi)
rank = factor_analyser.F.shape[1]
if factor_analyser.sigma.ndim == 2:
A = factor_analyser.F.T.dot(factor_analyser.F)
inv_lambda_unique = dict()
for sess in numpy.unique(stat0[:,0]):
for sess in numpy.unique(stat0[:, 0]):
inv_lambda_unique[sess] = scipy.linalg.inv(sess * A + numpy.eye(A.shape[0]))
tmp = numpy.zeros((phi.shape[1], phi.shape[1]), dtype=numpy.float32)
tmp = numpy.zeros((factor_analyser.F.shape[1], factor_analyser.F.shape[1]), dtype=numpy.float32)
for idx in mini_batch_indices:
if sigma.ndim == 1:
inv_lambda = scipy.linalg.inv(numpy.eye(r) + (phi.T * stat0[idx + batch_start, :]).dot(phi))
if factor_analyser.sigma.ndim == 1:
inv_lambda = scipy.linalg.inv(numpy.eye(rank) +
(factor_analyser.F.T * stat0[idx + batch_start, :]).dot(factor_analyser.F))
else:
inv_lambda = inv_lambda_unique[stat0[idx + batch_start, 0]]
aux = phi.T.dot(stat1[idx + batch_start, :])
aux = factor_analyser.F.T.dot(stat1[idx + batch_start, :])
numpy.dot(aux, inv_lambda, out=e_h[idx])
e_hh[idx] = inv_lambda + numpy.outer(e_h[idx], e_h[idx], tmp)
class FactorAnalyser:
"""
A class to train factor analyser such as total variability models and Probabilistic
......@@ -412,7 +412,7 @@ class FactorAnalyser:
ch = scipy.linalg.cholesky(_R)
self.F = self.F.dot(ch)
#Save the FactorAnalyser
# Save the FactorAnalyser
if it < nb_iter - 1:
self.write(output_file_name + "_it-{}.h5".format(it))
else:
......@@ -442,6 +442,7 @@ class FactorAnalyser:
:param nb_iter: number of EM iteration
:param min_div: boolean, if True, apply minimum divergence re-estimation
:param tv_init: initial matrix to start the EM iterations with
:param batch_size: number of sessions to process at once to reduce memory footprint
:param save_init: boolean, if True, save the initial matrix
:param output_file_name: name of the file where to save the matrix
"""
......@@ -493,7 +494,7 @@ class FactorAnalyser:
stat0 = fh['stat0'][batch_idx, :]
stat1 = fh['stat1'][batch_idx, :]
e_h, e_hh = E_on_batch(stat0, stat1, ubm, self.F)
e_h, e_hh = e_on_batch(stat0, stat1, ubm, self.F)
_R += numpy.sum(e_hh, axis=0)
_C += e_h.T.dot(stat1)
......@@ -529,7 +530,7 @@ class FactorAnalyser:
nb_iter=20,
min_div=True,
tv_init=None,
batch_size=1000,
batch_size=300,
save_init=False,
output_file_name=None,
num_thread=1):
......@@ -613,7 +614,7 @@ class FactorAnalyser:
pool = multiprocessing.Pool(num_thread + 2)
# put Consumer to work first
watcher = pool.apply_async(E_gather, ((_A, _C, _R), q))
watcher = pool.apply_async(e_gather, ((_A, _C, _R), q))
# fire off workers
jobs = []
......@@ -622,7 +623,7 @@ class FactorAnalyser:
# Create list of argument for a process
arg = fh["stat0"][batch_idx, :], fh["stat1"][batch_idx, :], ubm, self.F
job = pool.apply_async(E_worker, (arg, q))
job = pool.apply_async(e_worker, (arg, q))
jobs.append(job)
# collect results from the workers through the pool result queue
......@@ -659,8 +660,8 @@ class FactorAnalyser:
self.write(output_file_name + ".h5")
def extract_ivectors_single(self,
stat_server,
ubm,
stat_server,
uncertainty=False):
"""
Estimate i-vectors for a given StatServer using single process on a single node.
......@@ -708,20 +709,21 @@ class FactorAnalyser:
stat_server.stat0[sess, index_map]).dot(self.F))
Aux = self.F.T.dot(stat_server.stat1[sess, :])
iv_stat_server.stat1[sess, :] = Aux.dot(inv_lambda)
iv_sigma[sess, :] = numpy.diag(inv_lambda + numpy.outer(iv_stat_server.stat1[sess, :], iv_stat_server.stat1[sess, :]))
iv_sigma[sess, :] = numpy.diag(inv_lambda + numpy.outer(iv_stat_server.stat1[sess, :],
iv_stat_server.stat1[sess, :]))
if uncertainty:
return iv_stat_server, iv_sigma
else:
return iv_stat_server
def extract_ivectors_mp(self,
ubm,
stat_server_filename,
prefix='',
batch_size=300,
uncertainty=False,
num_thread=1):
def extract_ivectors(self,
ubm,
stat_server_filename,
prefix='',
batch_size=300,
uncertainty=False,
num_thread=1):
"""
Parallel extraction of i-vectors using multiprocessing module
......@@ -735,14 +737,11 @@ class FactorAnalyser:
"""
assert (isinstance(ubm, Mixture) and ubm.validate()), "Second argument must be a proper Mixture"
gmm_covariance = "diag" if ubm.invcov.ndim == 2 else "full"
tv_rank = self.F.shape[1]
# Set useful variables
with h5py.File(stat_server_filename, 'r') as fh: # open the first statserver to get size
_, sv_size = fh[prefix + 'stat1'].shape
feature_size = fh[prefix + 'stat1'].shape[1] // fh[prefix + 'stat0'].shape[1]
distrib_nb = fh[prefix + 'stat0'].shape[1]
nb_sessions = fh[prefix + "modelset"].shape[0]
iv_server = StatServer()
......@@ -786,7 +785,7 @@ class FactorAnalyser:
for job in jobs:
job.get()
#now we are done, kill the listener
# now we are done, kill the listener
q.put((None, None, None))
pool.close()
......@@ -868,9 +867,7 @@ class FactorAnalyser:
# loop on model id's
fa_model_loop(batch_start=0,
mini_batch_indices=numpy.arange(class_nb),
r=rank_f,
phi=self.F,
sigma=self.Sigma,
factor_analyser=self,
stat0=_stat0,
stat1=local_stat.stat1,
e_h=e_h,
......@@ -889,7 +886,6 @@ class FactorAnalyser:
# Update the residual covariance
self.Sigma = sigma_obs - self.F.dot(_C) / session_per_model.sum()
# Minimum Divergence step
self.F = self.F.dot(scipy.linalg.cholesky(_R))
......@@ -900,4 +896,3 @@ class FactorAnalyser:
self.write(output_file_name + "_it-{}.h5".format(it))
elif it == nb_iter - 1:
self.write(output_file_name + ".h5")
......@@ -21,7 +21,7 @@
# You should have received a copy of the GNU Lesser General Public License
# along with SIDEKIT. If not, see <http://www.gnu.org/licenses/>.
"""
Copyright 2014-2016 Sylvain Meignier and Anthony Larcher
Copyright 2014-2017 Sylvain Meignier and Anthony Larcher
:mod:`features_server` provides methods to manage features
......
......@@ -22,7 +22,7 @@
# along with SIDEKIT. If not, see <http://www.gnu.org/licenses/>.
"""
Copyright 2014-2016 Sylvain Meignier and Anthony Larcher
Copyright 2014-2017 Sylvain Meignier and Anthony Larcher
:mod:`features_server` provides methods to manage features
......@@ -429,8 +429,6 @@ class FeaturesServer(object):
if input_feature_filename is not None:
self.feature_filename_structure = input_feature_filename
feature_filename = self.feature_filename_structure.format(show)
print('feature_filename = ',feature_filename)
print('show = ',show)
if self.dataset_list is not None:
self.previous_load = self.get_features(show,
......@@ -468,7 +466,7 @@ class FeaturesServer(object):
"""
if input_feature_filename is not None:
self.feature_filename_structure = input_feature_filename
print("open: ",self.feature_filename_structure.format(show))
# If no extractor for this source, open hdf5 file and return handler
if self.features_extractor is None:
h5f = h5py.File(self.feature_filename_structure.format(show), "r")
......@@ -478,7 +476,6 @@ class FeaturesServer(object):
h5f = self.features_extractor.extract(show, channel, input_audio_filename=input_feature_filename)
# Get the selected segment
print("show = ", show)
dataset_length = h5f[show + "/" + next(h5f[show].__iter__())].shape[0]
# Deal with the case where start < 0 or stop > feat.shape[0]
if start is None:
......
......@@ -22,7 +22,7 @@
# along with SIDEKIT. If not, see <http://www.gnu.org/licenses/>.
"""
Copyright 2014-2016 Anthony Larcher and Sylvain Meignier
Copyright 2014-2017 Anthony Larcher and Sylvain Meignier
:mod:`frontend` provides methods to process an audio signal in order to extract
useful parameters for speaker verification.
......
......@@ -22,7 +22,7 @@
# along with SIDEKIT. If not, see <http://www.gnu.org/licenses/>.
"""
Copyright 2014-2016 Anthony Larcher and Sylvain Meignier
Copyright 2014-2017 Anthony Larcher and Sylvain Meignier
:mod:`frontend` provides methods to process an audio signal in order to extract
useful parameters for speaker verification.
......
......@@ -22,7 +22,7 @@
# along with SIDEKIT. If not, see <http://www.gnu.org/licenses/>.
"""
Copyright 2014-2016 Anthony Larcher
Copyright 2014-2017 Anthony Larcher
:mod:`frontend` provides methods to process an audio signal in order to extract
useful parameters for speaker verification.
......
......@@ -22,7 +22,7 @@
# along with SIDEKIT. If not, see <http://www.gnu.org/licenses/>.
"""
Copyright 2014-2016 Anthony Larcher and Sylvain Meignier
Copyright 2014-2017 Anthony Larcher and Sylvain Meignier
:mod:`frontend` provides methods to process an audio signal in order to extract
useful parameters for speaker verification.
......
Supports Markdown
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