features_server.html 94.5 KB
Newer Older
Anthony Larcher's avatar
Anthony Larcher committed
1
2
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
Anthony Larcher's avatar
Anthony Larcher committed
3
4


Anthony Larcher's avatar
Anthony Larcher committed
5
6
7
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
Anthony Larcher's avatar
Anthony Larcher committed
8
    
9
    <title>features_server &mdash; SIDEKIT 1.1.6 documentation</title>
Anthony Larcher's avatar
Anthony Larcher committed
10
    
Anthony Larcher's avatar
Anthony Larcher committed
11
    <link rel="stylesheet" href="../_static/sphinxdoc.css" type="text/css" />
Anthony Larcher's avatar
Anthony Larcher committed
12
13
14
15
16
    <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
    
    <script type="text/javascript">
      var DOCUMENTATION_OPTIONS = {
        URL_ROOT:    '../',
17
        VERSION:     '1.1.6',
Anthony Larcher's avatar
Anthony Larcher committed
18
19
20
21
22
23
24
25
        COLLAPSE_INDEX: false,
        FILE_SUFFIX: '.html',
        HAS_SOURCE:  true
      };
    </script>
    <script type="text/javascript" src="../_static/jquery.js"></script>
    <script type="text/javascript" src="../_static/underscore.js"></script>
    <script type="text/javascript" src="../_static/doctools.js"></script>
26
    <link rel="top" title="SIDEKIT 1.1.6 documentation" href="../index.html" />
Anthony Larcher's avatar
Anthony Larcher committed
27
28
29
30
31
32
33
34
35
36
37
38
    <link rel="up" title="Module code" href="index.html" /> 
  </head>
  <body role="document">
    <div class="related" role="navigation" aria-label="related navigation">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="../genindex.html" title="General Index"
             accesskey="I">index</a></li>
        <li class="right" >
          <a href="../py-modindex.html" title="Python Module Index"
             >modules</a> |</li>
39
        <li class="nav-item nav-item-0"><a href="../index.html">SIDEKIT 1.1.6 documentation</a> &raquo;</li>
Anthony Larcher's avatar
Anthony Larcher committed
40
41
          <li class="nav-item nav-item-1"><a href="index.html" accesskey="U">Module code</a> &raquo;</li> 
      </ul>
Anthony Larcher's avatar
Anthony Larcher committed
42
43
44
45
46
47
    </div>
      <div class="sphinxsidebar" role="navigation" aria-label="main navigation">
        <div class="sphinxsidebarwrapper">
<div id="searchbox" style="display: none" role="search">
  <h3>Quick search</h3>
    <form class="search" action="../search.html" method="get">
Anthony Larcher's avatar
doc    
Anthony Larcher committed
48
49
      <input type="text" name="q" />
      <input type="submit" value="Go" />
Anthony Larcher's avatar
Anthony Larcher committed
50
51
52
      <input type="hidden" name="check_keywords" value="yes" />
      <input type="hidden" name="area" value="default" />
    </form>
Anthony Larcher's avatar
doc    
Anthony Larcher committed
53
54
55
    <p class="searchtip" style="font-size: 90%">
    Enter search terms or a module, class or function name.
    </p>
Anthony Larcher's avatar
Anthony Larcher committed
56
57
58
59
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
        </div>
      </div>
Anthony Larcher's avatar
Anthony Larcher committed
60
61
62
63
64

    <div class="document">
      <div class="documentwrapper">
        <div class="bodywrapper">
          <div class="body" role="main">
Anthony Larcher's avatar
Anthony Larcher committed
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
            
  <h1>Source code for features_server</h1><div class="highlight"><pre>
<span class="c"># -*- coding: utf-8 -*-</span>
<span class="c">#</span>
<span class="c"># This file is part of SIDEKIT.</span>
<span class="c">#</span>
<span class="c"># SIDEKIT is a python package for speaker verification.</span>
<span class="c"># Home page: http://www-lium.univ-lemans.fr/sidekit/</span>
<span class="c">#</span>
<span class="c"># SIDEKIT is a python package for speaker verification.</span>
<span class="c"># Home page: http://www-lium.univ-lemans.fr/sidekit/</span>
<span class="c">#    </span>
<span class="c"># SIDEKIT is free software: you can redistribute it and/or modify</span>
<span class="c"># it under the terms of the GNU LLesser General Public License as </span>
<span class="c"># published by the Free Software Foundation, either version 3 of the License, </span>
<span class="c"># or (at your option) any later version.</span>
<span class="c">#</span>
<span class="c"># SIDEKIT is distributed in the hope that it will be useful,</span>
<span class="c"># but WITHOUT ANY WARRANTY; without even the implied warranty of</span>
<span class="c"># MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span>
<span class="c"># GNU Lesser General Public License for more details.</span>
<span class="c">#</span>
<span class="c"># You should have received a copy of the GNU Lesser General Public License</span>
<span class="c"># along with SIDEKIT.  If not, see &lt;http://www.gnu.org/licenses/&gt;.</span>

<span class="sd">&quot;&quot;&quot;</span>
Anthony Larcher's avatar
minor    
Anthony Larcher committed
91
<span class="sd">Copyright 2014-2016 Sylvain Meignier and Anthony Larcher</span>
Anthony Larcher's avatar
Anthony Larcher committed
92
93
94
95

<span class="sd">    :mod:`features_server` provides methods to manage features</span>

<span class="sd">&quot;&quot;&quot;</span>
Anthony Larcher's avatar
Anthony Larcher committed
96
<span class="kn">import</span> <span class="nn">numpy</span>
Anthony Larcher's avatar
Anthony Larcher committed
97
<span class="kn">import</span> <span class="nn">logging</span>
Anthony Larcher's avatar
Anthony Larcher committed
98
99
100
101
102
103
<span class="kn">import</span> <span class="nn">h5py</span>

<span class="kn">from</span> <span class="nn">sidekit.frontend.features</span> <span class="kn">import</span> <span class="n">pca_dct</span><span class="p">,</span> <span class="n">shifted_delta_cepstral</span><span class="p">,</span> <span class="n">compute_delta</span><span class="p">,</span> <span class="n">framing</span><span class="p">,</span> <span class="n">dct_basis</span>
<span class="kn">from</span> <span class="nn">sidekit.frontend.vad</span> <span class="kn">import</span> <span class="n">label_fusion</span>
<span class="kn">from</span> <span class="nn">sidekit.frontend.normfeat</span> <span class="kn">import</span> <span class="n">cms</span><span class="p">,</span> <span class="n">cmvn</span><span class="p">,</span> <span class="n">stg</span><span class="p">,</span> <span class="n">cep_sliding_norm</span><span class="p">,</span> <span class="n">rasta_filt</span>
<span class="kn">from</span> <span class="nn">sidekit.sv_utils</span> <span class="kn">import</span> <span class="n">parse_mask</span>
Anthony Larcher's avatar
Anthony Larcher committed
104
105
106


<span class="n">__license__</span> <span class="o">=</span> <span class="s">&quot;LGPL&quot;</span>
Anthony Larcher's avatar
Anthony Larcher committed
107
<span class="n">__author__</span> <span class="o">=</span> <span class="s">&quot;Anthony Larcher &amp; Sylvain Meignier&quot;</span>
Anthony Larcher's avatar
Anthony Larcher committed
108
109
110
111
112
<span class="n">__copyright__</span> <span class="o">=</span> <span class="s">&quot;Copyright 2014-2016 Anthony Larcher&quot;</span>
<span class="n">__maintainer__</span> <span class="o">=</span> <span class="s">&quot;Anthony Larcher&quot;</span>
<span class="n">__email__</span> <span class="o">=</span> <span class="s">&quot;anthony.larcher@univ-lemans.fr&quot;</span>
<span class="n">__status__</span> <span class="o">=</span> <span class="s">&quot;Production&quot;</span>
<span class="n">__docformat__</span> <span class="o">=</span> <span class="s">&#39;reStructuredText&#39;</span>
Anthony Larcher's avatar
Anthony Larcher committed
113
114


Anthony Larcher's avatar
Anthony Larcher committed
115
<div class="viewcode-block" id="FeaturesServer"><a class="viewcode-back" href="../featuresserver.html#features_server.FeaturesServer">[docs]</a><span class="k">class</span> <span class="nc">FeaturesServer</span><span class="p">(</span><span class="nb">object</span><span class="p">):</span>
Anthony Larcher's avatar
Anthony Larcher committed
116
    <span class="sd">&quot;&quot;&quot;</span>
Anthony Larcher's avatar
Anthony Larcher committed
117
118
119
<span class="sd">    Management of features. FeaturesServer instances load datasets from a HDF5 files</span>
<span class="sd">    (that can be read from disk or produced by a FeaturesExtractor object)</span>
<span class="sd">    Datasets read from one or many files are concatenated and processed</span>
Anthony Larcher's avatar
Anthony Larcher committed
120
121
<span class="sd">    &quot;&quot;&quot;</span>

Anthony Larcher's avatar
Anthony Larcher committed
122
123
124
125
126
127
    <span class="k">def</span> <span class="nf">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span>
                 <span class="n">features_extractor</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span>
                 <span class="n">feature_filename_structure</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span>
                 <span class="n">sources</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span>
                 <span class="n">dataset_list</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span>
                 <span class="n">mask</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span>
Anthony Larcher's avatar
Anthony Larcher committed
128
                 <span class="n">feat_norm</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span>
Anthony Larcher's avatar
Anthony Larcher committed
129
                 <span class="n">global_cmvn</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span>
Anthony Larcher's avatar
Anthony Larcher committed
130
131
132
133
                 <span class="n">dct_pca</span><span class="o">=</span><span class="bp">False</span><span class="p">,</span>
                 <span class="n">dct_pca_config</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span>
                 <span class="n">sdc</span><span class="o">=</span><span class="bp">False</span><span class="p">,</span>
                 <span class="n">sdc_config</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span>
Anthony Larcher's avatar
Anthony Larcher committed
134
135
                 <span class="n">delta</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span>
                 <span class="n">double_delta</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span>
Anthony Larcher's avatar
Anthony Larcher committed
136
                 <span class="n">delta_filter</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span>
Anthony Larcher's avatar
Anthony Larcher committed
137
138
                 <span class="n">context</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span>
                 <span class="n">traps_dct_nb</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span>
Anthony Larcher's avatar
Anthony Larcher committed
139
                 <span class="n">rasta</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span>
Anthony Larcher's avatar
Anthony Larcher committed
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
                 <span class="n">keep_all_features</span><span class="o">=</span><span class="bp">True</span><span class="p">):</span>
        <span class="sd">&quot;&quot;&quot;</span>
<span class="sd">        Initialize a FeaturesServer for two cases:</span>
<span class="sd">        1. each call to load will load datasets from a single file. This mode requires to provide a dataset_list</span>
<span class="sd">        (lists of datasets to load from each file.</span>
<span class="sd">        2. each call to load will load datasets from several files (possibly several datasets from each file)</span>
<span class="sd">        and concatenate them. In this mode, you should provide a FeaturesServer for each source, thus, datasets</span>
<span class="sd">        read from each source can be post-processed independently before being concatenated with others. The dataset</span>
<span class="sd">        resulting from the concatenation from all sources is then post-processed.</span>

<span class="sd">        :param features_extractor: a FeaturesExtractor if required to extract features from audio file</span>
<span class="sd">        if None, data are loaded from an existing HDF5 file</span>
<span class="sd">        :param feature_filename_structure: structure of the filename to use to load HDF5 files</span>
<span class="sd">        :param sources: tuple of sources to load features different files (optional: for the case where datasets</span>
<span class="sd">        are loaded from several files and concatenated.</span>
<span class="sd">        :param dataset_list: string of the form &#39;[&quot;cep&quot;, &quot;fb&quot;, vad&quot;, energy&quot;, &quot;bnf&quot;]&#39; (only when loading datasets</span>
<span class="sd">        from a single file) list of datasets to load.</span>
<span class="sd">        :param mask: string of the form &#39;[1-3,10,15-20]&#39; mask to apply on the concatenated dataset</span>
<span class="sd">        to select specific components. In this example, coefficients 1,2,3,10,15,16,17,18,19,20 are kept</span>
<span class="sd">        In this example,</span>
<span class="sd">        :param feat_norm: tpye of normalization to apply as post-processing</span>
<span class="sd">        :param global_cmvn: boolean, if True, use a global mean and std when normalizing the frames</span>
<span class="sd">        :param dct_pca: if True, add temporal context by using a PCA-DCT approach</span>
<span class="sd">        :param dct_pca_config: configuration of the PCA-DCT, default is (12, 12, none)</span>
<span class="sd">        :param sdc: if True, compute shifted delta cepstra coefficients</span>
<span class="sd">        :param sdc_config: configuration to compute sdc coefficients, default is (1,3,7)</span>
<span class="sd">        :param delta: if True, append the first order derivative</span>
<span class="sd">        :param double_delta: if True, append the second order derivative</span>
<span class="sd">        :param delta_filter: coefficients of the filter used to compute delta coefficients</span>
<span class="sd">        :param context: add a left and right context, default is (0,0)</span>
<span class="sd">        :param traps_dct_nb: number of DCT coefficients to keep when computing TRAP coefficients</span>
<span class="sd">        :param rasta: if True, perform RASTA filtering</span>
<span class="sd">        :param keep_all_features: boolean, if True, keep all features, if False, keep frames according to the vad labels</span>
<span class="sd">        :return:</span>
Anthony Larcher's avatar
Anthony Larcher committed
174
<span class="sd">        &quot;&quot;&quot;</span>
Anthony Larcher's avatar
Anthony Larcher committed
175
176
177
178
        <span class="bp">self</span><span class="o">.</span><span class="n">features_extractor</span> <span class="o">=</span> <span class="bp">None</span>
        <span class="bp">self</span><span class="o">.</span><span class="n">feature_filename_structure</span> <span class="o">=</span> <span class="s">&#39;{}&#39;</span>
        <span class="bp">self</span><span class="o">.</span><span class="n">sources</span> <span class="o">=</span> <span class="p">()</span>
        <span class="bp">self</span><span class="o">.</span><span class="n">dataset_list</span> <span class="o">=</span> <span class="bp">None</span>
Anthony Larcher's avatar
Anthony Larcher committed
179

Anthony Larcher's avatar
Anthony Larcher committed
180
181
        <span class="c"># Post processing options</span>
        <span class="bp">self</span><span class="o">.</span><span class="n">mask</span> <span class="o">=</span> <span class="bp">None</span>
Anthony Larcher's avatar
Anthony Larcher committed
182
        <span class="bp">self</span><span class="o">.</span><span class="n">feat_norm</span> <span class="o">=</span> <span class="bp">None</span>
Anthony Larcher's avatar
Anthony Larcher committed
183
184
        <span class="bp">self</span><span class="o">.</span><span class="n">global_cmvn</span> <span class="o">=</span> <span class="bp">None</span>
        <span class="bp">self</span><span class="o">.</span><span class="n">dct_pca</span> <span class="o">=</span> <span class="bp">False</span>
Anthony Larcher's avatar
Anthony Larcher committed
185
186
187
188
189
        <span class="bp">self</span><span class="o">.</span><span class="n">dct_pca_config</span> <span class="o">=</span> <span class="p">(</span><span class="mi">12</span><span class="p">,</span> <span class="mi">12</span><span class="p">,</span> <span class="bp">None</span><span class="p">)</span>
        <span class="bp">self</span><span class="o">.</span><span class="n">sdc</span> <span class="o">=</span> <span class="bp">False</span>
        <span class="bp">self</span><span class="o">.</span><span class="n">sdc_config</span> <span class="o">=</span> <span class="p">(</span><span class="mi">1</span><span class="p">,</span> <span class="mi">3</span><span class="p">,</span> <span class="mi">7</span><span class="p">)</span>
        <span class="bp">self</span><span class="o">.</span><span class="n">delta</span> <span class="o">=</span> <span class="bp">False</span>
        <span class="bp">self</span><span class="o">.</span><span class="n">double_delta</span> <span class="o">=</span> <span class="bp">False</span>
Anthony Larcher's avatar
Anthony Larcher committed
190
191
192
        <span class="bp">self</span><span class="o">.</span><span class="n">delta_filter</span> <span class="o">=</span> <span class="n">numpy</span><span class="o">.</span><span class="n">array</span><span class="p">([</span><span class="o">.</span><span class="mi">25</span><span class="p">,</span> <span class="o">.</span><span class="mi">5</span><span class="p">,</span> <span class="o">.</span><span class="mi">25</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="o">-.</span><span class="mi">25</span><span class="p">,</span> <span class="o">-.</span><span class="mi">5</span><span class="p">,</span> <span class="o">-.</span><span class="mi">25</span><span class="p">])</span>
        <span class="bp">self</span><span class="o">.</span><span class="n">context</span> <span class="o">=</span> <span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="mi">0</span><span class="p">)</span>
        <span class="bp">self</span><span class="o">.</span><span class="n">traps_dct_nb</span> <span class="o">=</span> <span class="mi">0</span>
Anthony Larcher's avatar
Anthony Larcher committed
193
        <span class="bp">self</span><span class="o">.</span><span class="n">rasta</span> <span class="o">=</span> <span class="bp">False</span>
Anthony Larcher's avatar
Anthony Larcher committed
194
195
196
197
198
199
200
201
202
203
204
205
        <span class="bp">self</span><span class="o">.</span><span class="n">keep_all_features</span> <span class="o">=</span> <span class="bp">True</span>

        <span class="k">if</span> <span class="n">features_extractor</span> <span class="ow">is</span> <span class="ow">not</span> <span class="bp">None</span><span class="p">:</span>
            <span class="bp">self</span><span class="o">.</span><span class="n">features_extractor</span> <span class="o">=</span> <span class="n">features_extractor</span>
        <span class="k">if</span> <span class="n">feature_filename_structure</span> <span class="ow">is</span> <span class="ow">not</span> <span class="bp">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">feature_filename_structure</span>
        <span class="k">if</span> <span class="n">sources</span> <span class="ow">is</span> <span class="ow">not</span> <span class="bp">None</span><span class="p">:</span>
            <span class="bp">self</span><span class="o">.</span><span class="n">sources</span> <span class="o">=</span> <span class="n">sources</span>
        <span class="k">if</span> <span class="n">dataset_list</span> <span class="ow">is</span> <span class="ow">not</span> <span class="bp">None</span><span class="p">:</span>
            <span class="bp">self</span><span class="o">.</span><span class="n">dataset_list</span> <span class="o">=</span> <span class="n">dataset_list</span>
        <span class="k">if</span> <span class="n">mask</span> <span class="ow">is</span> <span class="ow">not</span> <span class="bp">None</span><span class="p">:</span>
            <span class="bp">self</span><span class="o">.</span><span class="n">mask</span> <span class="o">=</span> <span class="n">parse_mask</span><span class="p">(</span><span class="n">mask</span><span class="p">)</span>
Anthony Larcher's avatar
Anthony Larcher committed
206
207
        <span class="k">if</span> <span class="n">feat_norm</span> <span class="ow">is</span> <span class="ow">not</span> <span class="bp">None</span><span class="p">:</span>
            <span class="bp">self</span><span class="o">.</span><span class="n">feat_norm</span> <span class="o">=</span> <span class="n">feat_norm</span>
Anthony Larcher's avatar
Anthony Larcher committed
208
209
        <span class="k">if</span> <span class="n">global_cmvn</span> <span class="ow">is</span> <span class="ow">not</span> <span class="bp">None</span><span class="p">:</span>
            <span class="bp">self</span><span class="o">.</span><span class="n">global_cmvn</span> <span class="o">=</span> <span class="n">global_cmvn</span>
Anthony Larcher's avatar
Anthony Larcher committed
210
211
212
213
214
215
216
217
        <span class="k">if</span> <span class="n">dct_pca</span> <span class="ow">is</span> <span class="ow">not</span> <span class="bp">None</span><span class="p">:</span>
            <span class="bp">self</span><span class="o">.</span><span class="n">dct_pca</span> <span class="o">=</span> <span class="n">dct_pca</span>
        <span class="k">if</span> <span class="n">dct_pca_config</span> <span class="ow">is</span> <span class="ow">not</span> <span class="bp">None</span><span class="p">:</span>
            <span class="bp">self</span><span class="o">.</span><span class="n">dct_pca_config</span> <span class="o">=</span> <span class="n">dct_pca_config</span>
        <span class="k">if</span> <span class="n">sdc</span> <span class="ow">is</span> <span class="ow">not</span> <span class="bp">None</span><span class="p">:</span>
            <span class="bp">self</span><span class="o">.</span><span class="n">sdc</span> <span class="o">=</span> <span class="n">sdc</span>
        <span class="k">if</span> <span class="n">sdc_config</span> <span class="ow">is</span> <span class="ow">not</span> <span class="bp">None</span><span class="p">:</span>
            <span class="bp">self</span><span class="o">.</span><span class="n">sdc_config</span> <span class="o">=</span> <span class="n">sdc_config</span>
Anthony Larcher's avatar
Anthony Larcher committed
218
219
220
221
        <span class="k">if</span> <span class="n">delta</span> <span class="ow">is</span> <span class="ow">not</span> <span class="bp">None</span><span class="p">:</span>
            <span class="bp">self</span><span class="o">.</span><span class="n">delta</span> <span class="o">=</span> <span class="n">delta</span>
        <span class="k">if</span> <span class="n">double_delta</span> <span class="ow">is</span> <span class="ow">not</span> <span class="bp">None</span><span class="p">:</span>
            <span class="bp">self</span><span class="o">.</span><span class="n">double_delta</span> <span class="o">=</span> <span class="n">double_delta</span>
Anthony Larcher's avatar
Anthony Larcher committed
222
        <span class="k">if</span> <span class="n">delta_filter</span> <span class="ow">is</span> <span class="ow">not</span> <span class="bp">None</span><span class="p">:</span>
Anthony Larcher's avatar
Anthony Larcher committed
223
            <span class="bp">self</span><span class="o">.</span><span class="n">delta_filter</span> <span class="o">=</span> <span class="n">delta_filter</span>
Anthony Larcher's avatar
Anthony Larcher committed
224
225
226
227
        <span class="k">if</span> <span class="n">context</span> <span class="ow">is</span> <span class="ow">not</span> <span class="bp">None</span><span class="p">:</span>
            <span class="bp">self</span><span class="o">.</span><span class="n">context</span> <span class="o">=</span> <span class="n">context</span>
        <span class="k">if</span> <span class="n">traps_dct_nb</span> <span class="ow">is</span> <span class="ow">not</span> <span class="bp">None</span><span class="p">:</span>
            <span class="bp">self</span><span class="o">.</span><span class="n">traps_dct_nb</span> <span class="o">=</span> <span class="n">traps_dct_nb</span>
Anthony Larcher's avatar
Anthony Larcher committed
228
229
230
231
        <span class="k">if</span> <span class="n">rasta</span> <span class="ow">is</span> <span class="ow">not</span> <span class="bp">None</span><span class="p">:</span>
            <span class="bp">self</span><span class="o">.</span><span class="n">rasta</span> <span class="o">=</span> <span class="n">rasta</span>
        <span class="k">if</span> <span class="n">keep_all_features</span> <span class="ow">is</span> <span class="ow">not</span> <span class="bp">None</span><span class="p">:</span>
            <span class="bp">self</span><span class="o">.</span><span class="n">keep_all_features</span> <span class="o">=</span> <span class="n">keep_all_features</span>
Anthony Larcher's avatar
Anthony Larcher committed
232

Anthony Larcher's avatar
Anthony Larcher committed
233
        <span class="bp">self</span><span class="o">.</span><span class="n">show</span> <span class="o">=</span> <span class="s">&#39;empty&#39;</span>
Anthony Larcher's avatar
Anthony Larcher committed
234
235
236
        <span class="bp">self</span><span class="o">.</span><span class="n">input_feature_filename</span> <span class="o">=</span> <span class="s">&#39;empty&#39;</span>
        <span class="bp">self</span><span class="o">.</span><span class="n">start_stop</span> <span class="o">=</span> <span class="p">(</span><span class="bp">None</span><span class="p">,</span> <span class="bp">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">None</span>
Anthony Larcher's avatar
Anthony Larcher committed
237
238
239
240

    <span class="k">def</span> <span class="nf">__repr__</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
        <span class="sd">&quot;&quot;&quot;</span>

Anthony Larcher's avatar
Anthony Larcher committed
241
<span class="sd">        :return: a string to display the object</span>
Anthony Larcher's avatar
Anthony Larcher committed
242
<span class="sd">        &quot;&quot;&quot;</span>
Anthony Larcher's avatar
Anthony Larcher committed
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
        <span class="n">ch</span> <span class="o">=</span> <span class="s">&#39;</span><span class="se">\t</span><span class="s"> show: {} </span><span class="se">\n\n</span><span class="s">&#39;</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">show</span><span class="p">)</span>
        <span class="n">ch</span> <span class="o">+=</span> <span class="s">&#39;</span><span class="se">\t</span><span class="s"> input_feature_filename: {} </span><span class="se">\n\n</span><span class="s">&#39;</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">input_feature_filename</span><span class="p">)</span>
        <span class="n">ch</span> <span class="o">+=</span> <span class="s">&#39;</span><span class="se">\t</span><span class="s"> feature_filename_structure: {} </span><span class="se">\n</span><span class="s">&#39;</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">feature_filename_structure</span><span class="p">)</span>
        <span class="n">ch</span> <span class="o">+=</span> <span class="s">&#39;</span><span class="se">\t</span><span class="s">  </span><span class="se">\n</span><span class="s">&#39;</span>
        <span class="n">ch</span> <span class="o">+=</span> <span class="s">&#39;</span><span class="se">\t</span><span class="s">  </span><span class="se">\n\n</span><span class="s">&#39;</span>
        <span class="n">ch</span> <span class="o">+=</span> <span class="s">&#39;</span><span class="se">\t</span><span class="s"> Post processing options: </span><span class="se">\n</span><span class="s">&#39;</span>
        <span class="n">ch</span> <span class="o">+=</span> <span class="s">&#39;</span><span class="se">\t\t</span><span class="s"> mask: {}  </span><span class="se">\n</span><span class="s">&#39;</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">mask</span><span class="p">)</span>
        <span class="n">ch</span> <span class="o">+=</span> <span class="s">&#39;</span><span class="se">\t\t</span><span class="s"> feat_norm: {} </span><span class="se">\n</span><span class="s">&#39;</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">feat_norm</span><span class="p">)</span>
        <span class="n">ch</span> <span class="o">+=</span> <span class="s">&#39;</span><span class="se">\t\t</span><span class="s"> dct_pca: {}, dct_pca_config: {} </span><span class="se">\n</span><span class="s">&#39;</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">dct_pca</span><span class="p">,</span>
                                                               <span class="bp">self</span><span class="o">.</span><span class="n">dct_pca_config</span><span class="p">)</span>
        <span class="n">ch</span> <span class="o">+=</span> <span class="s">&#39;</span><span class="se">\t\t</span><span class="s"> sdc: {}, sdc_config: {} </span><span class="se">\n</span><span class="s">&#39;</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">sdc</span><span class="p">,</span>
                                                       <span class="bp">self</span><span class="o">.</span><span class="n">sdc_config</span><span class="p">)</span>
        <span class="n">ch</span> <span class="o">+=</span> <span class="s">&#39;</span><span class="se">\t\t</span><span class="s"> delta: {}, double_delta: {}, delta_filter: {} </span><span class="se">\n</span><span class="s">&#39;</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">delta</span><span class="p">,</span>
                                                                             <span class="bp">self</span><span class="o">.</span><span class="n">double_delta</span><span class="p">,</span>
                                                                             <span class="bp">self</span><span class="o">.</span><span class="n">delta_filter</span><span class="p">)</span>
        <span class="n">ch</span> <span class="o">+=</span> <span class="s">&#39;</span><span class="se">\t\t</span><span class="s"> rasta: {} </span><span class="se">\n</span><span class="s">&#39;</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">rasta</span><span class="p">)</span>
        <span class="n">ch</span> <span class="o">+=</span> <span class="s">&#39;</span><span class="se">\t\t</span><span class="s"> keep_all_features: {} </span><span class="se">\n</span><span class="s">&#39;</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">keep_all_features</span><span class="p">)</span>
Anthony Larcher's avatar
Anthony Larcher committed
260

Anthony Larcher's avatar
Anthony Larcher committed
261
262
263
        <span class="k">return</span> <span class="n">ch</span>

<div class="viewcode-block" id="FeaturesServer.post_processing"><a class="viewcode-back" href="../featuresserver.html#features_server.FeaturesServer.post_processing">[docs]</a>    <span class="k">def</span> <span class="nf">post_processing</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">feat</span><span class="p">,</span> <span class="n">label</span><span class="p">,</span> <span class="n">global_mean</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span> <span class="n">global_std</span><span class="o">=</span><span class="bp">None</span><span class="p">):</span>
Anthony Larcher's avatar
Anthony Larcher committed
264
        <span class="sd">&quot;&quot;&quot;</span>
Anthony Larcher's avatar
Anthony Larcher committed
265
266
267
268
269
270
271
272
273
<span class="sd">        After cepstral coefficients, filter banks or bottleneck parameters are computed or read from file</span>
<span class="sd">        post processing is applied.</span>

<span class="sd">        :param feat: the matrix of acoustic parameters to post-process</span>
<span class="sd">        :param label: the VAD labels for the acoustic parameters</span>
<span class="sd">        :param global_mean: vector or mean to use for normalization</span>
<span class="sd">        :param global_std: vector of standard deviation to use for normalization</span>

<span class="sd">        :return: the matrix of acoustic parameters ingand their VAD labels after post-process</span>
Anthony Larcher's avatar
Anthony Larcher committed
274
<span class="sd">        &quot;&quot;&quot;</span>
Anthony Larcher's avatar
Anthony Larcher committed
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
        <span class="c"># Apply a mask on the features</span>
        <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">mask</span> <span class="ow">is</span> <span class="ow">not</span> <span class="bp">None</span><span class="p">:</span>
            <span class="n">feat</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">_mask</span><span class="p">(</span><span class="n">feat</span><span class="p">)</span>

        <span class="c"># Perform RASTA filtering if required</span>
        <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">rasta</span><span class="p">:</span>
            <span class="n">feat</span><span class="p">,</span> <span class="n">label</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">_rasta</span><span class="p">(</span><span class="n">feat</span><span class="p">,</span> <span class="n">label</span><span class="p">)</span>

        <span class="c"># Add temporal context</span>
        <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">delta</span> <span class="ow">or</span> <span class="bp">self</span><span class="o">.</span><span class="n">double_delta</span><span class="p">:</span>
            <span class="n">feat</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">_delta_and_2delta</span><span class="p">(</span><span class="n">feat</span><span class="p">)</span>
        <span class="k">elif</span> <span class="bp">self</span><span class="o">.</span><span class="n">dct_pca</span><span class="p">:</span>
            <span class="n">feat</span> <span class="o">=</span> <span class="n">pca_dct</span><span class="p">(</span><span class="n">feat</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">dct_pca_config</span><span class="p">[</span><span class="mi">0</span><span class="p">],</span> <span class="bp">self</span><span class="o">.</span><span class="n">dct_pca_config</span><span class="p">[</span><span class="mi">1</span><span class="p">],</span> <span class="bp">self</span><span class="o">.</span><span class="n">dct_pca_config</span><span class="p">[</span><span class="mi">2</span><span class="p">])</span>
        <span class="k">elif</span> <span class="bp">self</span><span class="o">.</span><span class="n">sdc</span><span class="p">:</span>
            <span class="n">feat</span> <span class="o">=</span> <span class="n">shifted_delta_cepstral</span><span class="p">(</span><span class="n">feat</span><span class="p">,</span> <span class="n">d</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">sdc_config</span><span class="p">[</span><span class="mi">0</span><span class="p">],</span> <span class="n">P</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">sdc_config</span><span class="p">[</span><span class="mi">1</span><span class="p">],</span> <span class="n">k</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">sdc_config</span><span class="p">[</span><span class="mi">2</span><span class="p">])</span>

Anthony Larcher's avatar
Anthony Larcher committed
291
        <span class="c"># Smooth the labels and fuse the channels if more than one.</span>
Anthony Larcher's avatar
Anthony Larcher committed
292
        <span class="n">logging</span><span class="o">.</span><span class="n">debug</span><span class="p">(</span><span class="s">&#39;Smooth the labels and fuse the channels if more than one&#39;</span><span class="p">)</span>
Anthony Larcher's avatar
Anthony Larcher committed
293
        <span class="n">label</span> <span class="o">=</span> <span class="n">label_fusion</span><span class="p">(</span><span class="n">label</span><span class="p">)</span>
Anthony Larcher's avatar
Anthony Larcher committed
294
295
296
297
298
299
        
        <span class="c"># Normalize the data</span>
        <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">feat_norm</span> <span class="ow">is</span> <span class="bp">None</span><span class="p">:</span>
            <span class="n">logging</span><span class="o">.</span><span class="n">debug</span><span class="p">(</span><span class="s">&#39;no norm&#39;</span><span class="p">)</span>
        <span class="k">else</span><span class="p">:</span>
            <span class="bp">self</span><span class="o">.</span><span class="n">_normalize</span><span class="p">(</span><span class="n">label</span><span class="p">,</span> <span class="n">feat</span><span class="p">,</span> <span class="n">global_mean</span><span class="p">,</span> <span class="n">global_std</span><span class="p">)</span>
Anthony Larcher's avatar
Anthony Larcher committed
300

Anthony Larcher's avatar
Anthony Larcher committed
301
        <span class="c"># if not self.keep_all_features, only selected features and labels are kept</span>
Anthony Larcher's avatar
Anthony Larcher committed
302
303
        <span class="k">if</span> <span class="ow">not</span> <span class="bp">self</span><span class="o">.</span><span class="n">keep_all_features</span><span class="p">:</span>
            <span class="n">logging</span><span class="o">.</span><span class="n">debug</span><span class="p">(</span><span class="s">&#39;no keep all&#39;</span><span class="p">)</span>
Anthony Larcher's avatar
Anthony Larcher committed
304
305
            <span class="n">feat</span> <span class="o">=</span> <span class="n">feat</span><span class="p">[</span><span class="n">label</span><span class="p">]</span>
            <span class="n">label</span> <span class="o">=</span> <span class="n">label</span><span class="p">[</span><span class="n">label</span><span class="p">]</span>
Anthony Larcher's avatar
Anthony Larcher committed
306

Anthony Larcher's avatar
doc    
Anthony Larcher committed
307
308
        <span class="k">return</span> <span class="n">feat</span><span class="p">,</span> <span class="n">label</span>
</div>
Anthony Larcher's avatar
Anthony Larcher committed
309
310
311
312
    <span class="k">def</span> <span class="nf">_mask</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">cep</span><span class="p">):</span>
        <span class="sd">&quot;&quot;&quot;</span>
<span class="sd">        Keep only the MFCC index present in the filter list</span>
<span class="sd">        :param cep: acoustic parameters to filter</span>
Anthony Larcher's avatar
Anthony Larcher committed
313

Anthony Larcher's avatar
Anthony Larcher committed
314
<span class="sd">        :return: return the list of MFCC given by filter list</span>
Anthony Larcher's avatar
Anthony Larcher committed
315
<span class="sd">        &quot;&quot;&quot;</span>
Anthony Larcher's avatar
Anthony Larcher committed
316
317
318
319
        <span class="k">if</span> <span class="nb">len</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">mask</span><span class="p">)</span> <span class="o">==</span> <span class="mi">0</span><span class="p">:</span>
            <span class="k">raise</span> <span class="ne">Exception</span><span class="p">(</span><span class="s">&#39;filter list is empty&#39;</span><span class="p">)</span>
        <span class="n">logging</span><span class="o">.</span><span class="n">debug</span><span class="p">(</span><span class="s">&#39;applied mask&#39;</span><span class="p">)</span>
        <span class="k">return</span> <span class="n">cep</span><span class="p">[:,</span> <span class="bp">self</span><span class="o">.</span><span class="n">mask</span><span class="p">]</span>
Anthony Larcher's avatar
Anthony Larcher committed
320

Anthony Larcher's avatar
Anthony Larcher committed
321
322
323
    <span class="k">def</span> <span class="nf">_normalize</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">label</span><span class="p">,</span> <span class="n">cep</span><span class="p">,</span> <span class="n">global_mean</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span> <span class="n">global_std</span><span class="o">=</span><span class="bp">None</span><span class="p">):</span>
        <span class="sd">&quot;&quot;&quot;</span>
<span class="sd">        Normalize acoustic parameters in place</span>
Anthony Larcher's avatar
Anthony Larcher committed
324

Anthony Larcher's avatar
Anthony Larcher committed
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
<span class="sd">        :param label: vad labels to use for normalization</span>
<span class="sd">        :param cep: acoustic parameters to normalize</span>
<span class="sd">        :param global_mean: mean vector to use if provided</span>
<span class="sd">        :param global_std: standard deviation vector to use if provided</span>
<span class="sd">        &quot;&quot;&quot;</span>
        <span class="c"># Perform feature normalization on the entire session.</span>
        <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">feat_norm</span> <span class="ow">is</span> <span class="bp">None</span><span class="p">:</span>
            <span class="n">logging</span><span class="o">.</span><span class="n">debug</span><span class="p">(</span><span class="s">&#39;no norm&#39;</span><span class="p">)</span>
            <span class="k">pass</span>
        <span class="k">elif</span> <span class="bp">self</span><span class="o">.</span><span class="n">feat_norm</span> <span class="o">==</span> <span class="s">&#39;cms&#39;</span><span class="p">:</span>
            <span class="n">logging</span><span class="o">.</span><span class="n">debug</span><span class="p">(</span><span class="s">&#39;cms norm&#39;</span><span class="p">)</span>
            <span class="n">cms</span><span class="p">(</span><span class="n">cep</span><span class="p">,</span> <span class="n">label</span><span class="p">,</span> <span class="n">global_mean</span><span class="p">)</span>
        <span class="k">elif</span> <span class="bp">self</span><span class="o">.</span><span class="n">feat_norm</span> <span class="o">==</span> <span class="s">&#39;cmvn&#39;</span><span class="p">:</span>
            <span class="n">logging</span><span class="o">.</span><span class="n">debug</span><span class="p">(</span><span class="s">&#39;cmvn norm&#39;</span><span class="p">)</span>
            <span class="n">cmvn</span><span class="p">(</span><span class="n">cep</span><span class="p">,</span> <span class="n">label</span><span class="p">,</span> <span class="n">global_mean</span><span class="p">,</span> <span class="n">global_std</span><span class="p">)</span>
        <span class="k">elif</span> <span class="bp">self</span><span class="o">.</span><span class="n">feat_norm</span> <span class="o">==</span> <span class="s">&#39;stg&#39;</span><span class="p">:</span>
            <span class="n">logging</span><span class="o">.</span><span class="n">debug</span><span class="p">(</span><span class="s">&#39;stg norm&#39;</span><span class="p">)</span>
            <span class="n">stg</span><span class="p">(</span><span class="n">cep</span><span class="p">,</span> <span class="n">label</span><span class="o">=</span><span class="n">label</span><span class="p">)</span>
        <span class="k">elif</span> <span class="bp">self</span><span class="o">.</span><span class="n">feat_norm</span> <span class="o">==</span> <span class="s">&#39;cmvn_sliding&#39;</span><span class="p">:</span>
            <span class="n">logging</span><span class="o">.</span><span class="n">debug</span><span class="p">(</span><span class="s">&#39;sliding cmvn norm&#39;</span><span class="p">)</span>
            <span class="n">cep_sliding_norm</span><span class="p">(</span><span class="n">cep</span><span class="p">,</span> <span class="n">label</span><span class="o">=</span><span class="n">label</span><span class="p">,</span> <span class="n">win</span><span class="o">=</span><span class="mi">301</span><span class="p">,</span> <span class="n">center</span><span class="o">=</span><span class="bp">True</span><span class="p">,</span> <span class="nb">reduce</span><span class="o">=</span><span class="bp">True</span><span class="p">)</span>
        <span class="k">elif</span> <span class="bp">self</span><span class="o">.</span><span class="n">feat_norm</span> <span class="o">==</span> <span class="s">&#39;cms_sliding&#39;</span><span class="p">:</span>
            <span class="n">logging</span><span class="o">.</span><span class="n">debug</span><span class="p">(</span><span class="s">&#39;sliding cms norm&#39;</span><span class="p">)</span>
            <span class="n">cep_sliding_norm</span><span class="p">(</span><span class="n">cep</span><span class="p">,</span> <span class="n">label</span><span class="o">=</span><span class="n">label</span><span class="p">,</span> <span class="n">win</span><span class="o">=</span><span class="mi">301</span><span class="p">,</span> <span class="n">center</span><span class="o">=</span><span class="bp">True</span><span class="p">,</span> <span class="nb">reduce</span><span class="o">=</span><span class="bp">False</span><span class="p">)</span>
Anthony Larcher's avatar
Anthony Larcher committed
349
        <span class="k">else</span><span class="p">:</span>
Anthony Larcher's avatar
Anthony Larcher committed
350
            <span class="n">logging</span><span class="o">.</span><span class="n">warning</span><span class="p">(</span><span class="s">&#39;Wrong feature normalisation type&#39;</span><span class="p">)</span>
Anthony Larcher's avatar
Anthony Larcher committed
351

Anthony Larcher's avatar
Anthony Larcher committed
352
    <span class="k">def</span> <span class="nf">_delta_and_2delta</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">cep</span><span class="p">):</span>
Anthony Larcher's avatar
Anthony Larcher committed
353
        <span class="sd">&quot;&quot;&quot;</span>
Anthony Larcher's avatar
Anthony Larcher committed
354
355
356
357
<span class="sd">        Add deltas and double deltas.</span>
<span class="sd">        :param cep: a matrix of cepstral cefficients</span>

<span class="sd">        :return: the cepstral coefficient stacked with deltas and double deltas</span>
Anthony Larcher's avatar
Anthony Larcher committed
358
<span class="sd">        &quot;&quot;&quot;</span>
Anthony Larcher's avatar
Anthony Larcher committed
359
360
361
362
363
364
365
366
367
        <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">delta</span><span class="p">:</span>
            <span class="n">logging</span><span class="o">.</span><span class="n">debug</span><span class="p">(</span><span class="s">&#39;add delta&#39;</span><span class="p">)</span>
            <span class="n">delta</span> <span class="o">=</span> <span class="n">compute_delta</span><span class="p">(</span><span class="n">cep</span><span class="p">,</span> <span class="n">filt</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">delta_filter</span><span class="p">)</span>
            <span class="n">cep</span> <span class="o">=</span> <span class="n">numpy</span><span class="o">.</span><span class="n">column_stack</span><span class="p">((</span><span class="n">cep</span><span class="p">,</span> <span class="n">delta</span><span class="p">))</span>
            <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">double_delta</span><span class="p">:</span>
                <span class="n">logging</span><span class="o">.</span><span class="n">debug</span><span class="p">(</span><span class="s">&#39;add delta delta&#39;</span><span class="p">)</span>
                <span class="n">double_delta</span> <span class="o">=</span> <span class="n">compute_delta</span><span class="p">(</span><span class="n">delta</span><span class="p">,</span> <span class="n">filt</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">delta_filter</span><span class="p">)</span>
                <span class="n">cep</span> <span class="o">=</span> <span class="n">numpy</span><span class="o">.</span><span class="n">column_stack</span><span class="p">((</span><span class="n">cep</span><span class="p">,</span> <span class="n">double_delta</span><span class="p">))</span>
        <span class="k">return</span> <span class="n">cep</span>
Anthony Larcher's avatar
Anthony Larcher committed
368
369
370
371
372
373
374
375

    <span class="k">def</span> <span class="nf">_rasta</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">cep</span><span class="p">,</span> <span class="n">label</span><span class="p">):</span>
        <span class="sd">&quot;&quot;&quot;</span>
<span class="sd">        Performs RASTA filtering if required.</span>
<span class="sd">        The two first frames are copied from the third to keep</span>
<span class="sd">        the length consistent</span>
<span class="sd">        !!! if vad is None: label[] is empty</span>

Anthony Larcher's avatar
Anthony Larcher committed
376
377
<span class="sd">        :param cep: the acoustic features to filter</span>
<span class="sd">        :param label: the VAD label</span>
Anthony Larcher's avatar
Anthony Larcher committed
378
379
380
<span class="sd">        :return:</span>
<span class="sd">        &quot;&quot;&quot;</span>
        <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">rasta</span><span class="p">:</span>
Anthony Larcher's avatar
Anthony Larcher committed
381
            <span class="n">logging</span><span class="o">.</span><span class="n">debug</span><span class="p">(</span><span class="s">&#39;perform RASTA </span><span class="si">%s</span><span class="s">&#39;</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">rasta</span><span class="p">)</span>
Anthony Larcher's avatar
Anthony Larcher committed
382
383
384
385
386
            <span class="n">cep</span> <span class="o">=</span> <span class="n">rasta_filt</span><span class="p">(</span><span class="n">cep</span><span class="p">)</span>
            <span class="n">cep</span><span class="p">[:</span><span class="mi">2</span><span class="p">,</span> <span class="p">:]</span> <span class="o">=</span> <span class="n">cep</span><span class="p">[</span><span class="mi">2</span><span class="p">,</span> <span class="p">:]</span>
            <span class="n">label</span><span class="p">[:</span><span class="mi">2</span><span class="p">]</span> <span class="o">=</span> <span class="n">label</span><span class="p">[</span><span class="mi">2</span><span class="p">]</span>
        <span class="k">return</span> <span class="n">cep</span><span class="p">,</span> <span class="n">label</span>

Anthony Larcher's avatar
Anthony Larcher committed
387
<div class="viewcode-block" id="FeaturesServer.get_context"><a class="viewcode-back" href="../featuresserver.html#features_server.FeaturesServer.get_context">[docs]</a>    <span class="k">def</span> <span class="nf">get_context</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">feat</span><span class="p">,</span> <span class="n">start</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span> <span class="n">stop</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span> <span class="n">label</span><span class="o">=</span><span class="bp">None</span><span class="p">):</span>
Anthony Larcher's avatar
Anthony Larcher committed
388
        <span class="sd">&quot;&quot;&quot;</span>
Anthony Larcher's avatar
Anthony Larcher committed
389
390
<span class="sd">        Add a left annd right context to each frame.</span>
<span class="sd">        First and last frames are duplicated to provide context at the begining and at the end</span>
Anthony Larcher's avatar
Anthony Larcher committed
391

Anthony Larcher's avatar
Anthony Larcher committed
392
393
394
395
<span class="sd">        :param feat: sequence of feature frames (one fame per line)</span>
<span class="sd">        :param start: index of the first frame of the selected segment</span>
<span class="sd">        :param stop: index of the last frame of the selected segment</span>
<span class="sd">        :param label: vad label if available</span>
Anthony Larcher's avatar
Anthony Larcher committed
396

Anthony Larcher's avatar
Anthony Larcher committed
397
<span class="sd">        :return: a sequence of frames with their left and right context</span>
Anthony Larcher's avatar
Anthony Larcher committed
398
<span class="sd">        &quot;&quot;&quot;</span>
Anthony Larcher's avatar
Anthony Larcher committed
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
        <span class="k">if</span> <span class="n">start</span> <span class="ow">is</span> <span class="bp">None</span><span class="p">:</span>
            <span class="n">start</span> <span class="o">=</span> <span class="mi">0</span>
        <span class="k">if</span> <span class="n">stop</span> <span class="ow">is</span> <span class="bp">None</span><span class="p">:</span>
            <span class="n">stop</span> <span class="o">=</span> <span class="n">feat</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="n">context_feat</span> <span class="o">=</span> <span class="n">framing</span><span class="p">(</span>
            <span class="n">numpy</span><span class="o">.</span><span class="n">pad</span><span class="p">(</span><span class="n">feat</span><span class="p">,</span>
                      <span class="p">((</span><span class="nb">max</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">context</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span> <span class="o">-</span> <span class="n">start</span><span class="p">,</span> <span class="mi">0</span><span class="p">),</span> <span class="nb">max</span><span class="p">(</span><span class="n">stop</span> <span class="o">-</span> <span class="n">feat</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="o">+</span> <span class="bp">self</span><span class="o">.</span><span class="n">context</span><span class="p">[</span><span class="mi">1</span><span class="p">]</span> <span class="o">+</span> <span class="mi">1</span><span class="p">,</span> <span class="mi">0</span><span class="p">)),</span>
                       <span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="mi">0</span><span class="p">)),</span>
                      <span class="n">mode</span><span class="o">=</span><span class="s">&#39;edge&#39;</span><span class="p">)[</span><span class="n">start</span> <span class="o">-</span> <span class="bp">self</span><span class="o">.</span><span class="n">context</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span> <span class="o">+</span> <span class="nb">max</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">context</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span> <span class="o">-</span> <span class="n">start</span><span class="p">,</span> <span class="mi">0</span><span class="p">)</span>
            <span class="p">:</span><span class="n">stop</span> <span class="o">+</span> <span class="bp">self</span><span class="o">.</span><span class="n">context</span><span class="p">[</span><span class="mi">1</span><span class="p">]</span> <span class="o">+</span> <span class="nb">max</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">context</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span> <span class="o">-</span> <span class="n">start</span><span class="p">,</span> <span class="mi">0</span><span class="p">),</span> <span class="p">:],</span>
            <span class="n">win_size</span><span class="o">=</span><span class="mi">1</span><span class="o">+</span><span class="nb">sum</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">context</span><span class="p">)</span>
        <span class="p">)</span><span class="o">.</span><span class="n">reshape</span><span class="p">(</span><span class="o">-</span><span class="mi">1</span><span class="p">,</span> <span class="p">(</span><span class="mi">1</span><span class="o">+</span><span class="nb">sum</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">context</span><span class="p">))</span> <span class="o">*</span> <span class="n">feat</span><span class="o">.</span><span class="n">shape</span><span class="p">[</span><span class="mi">1</span><span class="p">])</span>

        <span class="k">if</span> <span class="n">label</span> <span class="ow">is</span> <span class="ow">not</span> <span class="bp">None</span><span class="p">:</span>
            <span class="n">context_label</span> <span class="o">=</span> <span class="n">label</span><span class="p">[</span><span class="n">start</span><span class="p">:</span><span class="n">stop</span><span class="p">]</span>
Anthony Larcher's avatar
Anthony Larcher committed
414
        <span class="k">else</span><span class="p">:</span>
Anthony Larcher's avatar
Anthony Larcher committed
415
416
            <span class="n">context_label</span> <span class="o">=</span> <span class="bp">None</span>

Anthony Larcher's avatar
doc    
Anthony Larcher committed
417
418
        <span class="k">return</span> <span class="n">context_feat</span><span class="p">,</span> <span class="n">context_label</span>
</div>
Anthony Larcher's avatar
Anthony Larcher committed
419
<div class="viewcode-block" id="FeaturesServer.get_traps"><a class="viewcode-back" href="../featuresserver.html#features_server.FeaturesServer.get_traps">[docs]</a>    <span class="k">def</span> <span class="nf">get_traps</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">feat</span><span class="p">,</span> <span class="n">start</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span> <span class="n">stop</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span> <span class="n">label</span><span class="o">=</span><span class="bp">None</span><span class="p">):</span>
Anthony Larcher's avatar
Anthony Larcher committed
420
        <span class="sd">&quot;&quot;&quot;</span>
Anthony Larcher's avatar
Anthony Larcher committed
421
422
423
424
425
426
427
428
429
<span class="sd">        Compute TRAP parameters. The input frames are concatenated to add their left and right context,</span>
<span class="sd">        a Hamming window is applied and a DCT reduces the dimensionality of the resulting vector.</span>

<span class="sd">        :param feat: input acoustic parameters to process</span>
<span class="sd">        :param start: index of the first frame of the selected segment</span>
<span class="sd">        :param stop: index of the last frame of the selected segment</span>
<span class="sd">        :param label: vad label if available</span>

<span class="sd">        :return: a sequence of TRAP parameters</span>
Anthony Larcher's avatar
Anthony Larcher committed
430
431
<span class="sd">        &quot;&quot;&quot;</span>

Anthony Larcher's avatar
Anthony Larcher committed
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
        <span class="k">if</span> <span class="n">start</span> <span class="ow">is</span> <span class="bp">None</span><span class="p">:</span>
            <span class="n">start</span> <span class="o">=</span> <span class="mi">0</span>
        <span class="k">if</span> <span class="n">stop</span> <span class="ow">is</span> <span class="bp">None</span><span class="p">:</span>
            <span class="n">stop</span> <span class="o">=</span> <span class="n">feat</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="n">context_feat</span> <span class="o">=</span> <span class="n">framing</span><span class="p">(</span>
            <span class="n">numpy</span><span class="o">.</span><span class="n">pad</span><span class="p">(</span>
                      <span class="n">feat</span><span class="p">,</span> 
                      <span class="p">((</span><span class="bp">self</span><span class="o">.</span><span class="n">context</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span><span class="o">-</span><span class="n">start</span><span class="p">,</span> <span class="n">stop</span> <span class="o">-</span> <span class="n">feat</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="o">+</span> <span class="bp">self</span><span class="o">.</span><span class="n">context</span><span class="p">[</span><span class="mi">1</span><span class="p">]</span> <span class="o">+</span> <span class="mi">1</span><span class="p">),</span> <span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="mi">0</span><span class="p">)),</span>
                      <span class="n">mode</span><span class="o">=</span><span class="s">&#39;edge&#39;</span>
                      <span class="p">)[</span><span class="n">start</span><span class="o">-</span><span class="bp">self</span><span class="o">.</span><span class="n">context</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span>
                        <span class="o">+</span> <span class="nb">max</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">context</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span><span class="o">-</span><span class="n">start</span><span class="p">,</span> <span class="mi">0</span><span class="p">):</span><span class="n">stop</span> <span class="o">+</span> <span class="bp">self</span><span class="o">.</span><span class="n">context</span><span class="p">[</span><span class="mi">1</span><span class="p">]</span> <span class="o">+</span> <span class="nb">max</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">context</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span><span class="o">-</span><span class="n">start</span><span class="p">,</span> <span class="mi">0</span><span class="p">),:],</span>
            <span class="n">win_size</span><span class="o">=</span><span class="mi">1</span><span class="o">+</span><span class="nb">sum</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">context</span><span class="p">)</span>
        <span class="p">)</span><span class="o">.</span><span class="n">transpose</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="mi">2</span><span class="p">,</span> <span class="mi">1</span><span class="p">)</span>
        <span class="n">hamming_dct</span> <span class="o">=</span> <span class="p">(</span><span class="n">dct_basis</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">traps_dct_nb</span><span class="p">,</span> <span class="nb">sum</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">context</span><span class="p">)</span> <span class="o">+</span> <span class="mi">1</span><span class="p">)</span>
                       <span class="o">*</span> <span class="n">numpy</span><span class="o">.</span><span class="n">hamming</span><span class="p">(</span><span class="nb">sum</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">context</span><span class="p">)</span> <span class="o">+</span> <span class="mi">1</span><span class="p">))</span><span class="o">.</span><span class="n">T</span>

        <span class="k">if</span> <span class="n">label</span> <span class="ow">is</span> <span class="ow">not</span> <span class="bp">None</span><span class="p">:</span>
            <span class="n">context_label</span> <span class="o">=</span> <span class="n">label</span><span class="p">[</span><span class="n">start</span><span class="p">:</span><span class="n">stop</span><span class="p">]</span>
        <span class="k">else</span><span class="p">:</span>
            <span class="n">context_label</span> <span class="o">=</span> <span class="bp">None</span>
Anthony Larcher's avatar
Anthony Larcher committed
453

Anthony Larcher's avatar
Anthony Larcher committed
454
455
456
        <span class="k">return</span> <span class="n">numpy</span><span class="o">.</span><span class="n">dot</span><span class="p">(</span>
            <span class="n">context_feat</span><span class="o">.</span><span class="n">reshape</span><span class="p">(</span><span class="o">-</span><span class="mi">1</span><span class="p">,</span> <span class="n">hamming_dct</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="n">hamming_dct</span>
Anthony Larcher's avatar
doc    
Anthony Larcher committed
457
458
        <span class="p">)</span><span class="o">.</span><span class="n">reshape</span><span class="p">(</span><span class="n">context_feat</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="o">-</span><span class="mi">1</span><span class="p">),</span> <span class="n">context_label</span>
</div>
Anthony Larcher's avatar
Anthony Larcher committed
459
<div class="viewcode-block" id="FeaturesServer.load"><a class="viewcode-back" href="../featuresserver.html#features_server.FeaturesServer.load">[docs]</a>    <span class="k">def</span> <span class="nf">load</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">show</span><span class="p">,</span> <span class="n">channel</span><span class="o">=</span><span class="mi">0</span><span class="p">,</span> <span class="n">input_feature_filename</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span> <span class="n">label</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span> <span class="n">start</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span> <span class="n">stop</span><span class="o">=</span><span class="bp">None</span><span class="p">):</span>
Anthony Larcher's avatar
Anthony Larcher committed
460
        <span class="sd">&quot;&quot;&quot;</span>
Anthony Larcher's avatar
Anthony Larcher committed
461
<span class="sd">        Depending of the setting of the FeaturesServer, can either:</span>
Anthony Larcher's avatar
Anthony Larcher committed
462

Anthony Larcher's avatar
Anthony Larcher committed
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
<span class="sd">        1. Get the datasets from a single HDF5 file</span>
<span class="sd">            The HDF5 file is loaded from disk or processed on the fly</span>
<span class="sd">            via the FeaturesExtractor of the current FeaturesServer</span>

<span class="sd">        2. Load datasets from multiple input HDF5 files. The datasets are post-processed separately, then concatenated</span>
<span class="sd">            and post-process</span>

<span class="sd">        :param show: ID of the show to load (should be the same for each HDF5 file to read from)</span>
<span class="sd">        :param channel: audio channel index in case the parameters are extracted from an audio file</span>
<span class="sd">        :param input_feature_filename: name of the input feature file in case it is independent from the ID of the show</span>
<span class="sd">        :param label: vad labels</span>
<span class="sd">        :param start: index of the first frame of the selected segment</span>
<span class="sd">        :param stop: index of the last frame of the selected segment</span>

<span class="sd">        :return: acoustic parameters and their vad labels</span>
Anthony Larcher's avatar
Anthony Larcher committed
478
<span class="sd">        &quot;&quot;&quot;</span>
Anthony Larcher's avatar
Anthony Larcher committed
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504

        <span class="c"># In case the name of the input file does not include the ID of the show</span>
        <span class="c"># (i.e., feature_filename_structure does not include {})</span>
        <span class="c"># self.audio_filename_structure is updated to use the input_feature_filename</span>
        <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">show</span> <span class="o">==</span> <span class="n">show</span> \
                <span class="ow">and</span> <span class="bp">self</span><span class="o">.</span><span class="n">input_feature_filename</span> <span class="o">==</span> <span class="n">input_feature_filename</span>\
                <span class="ow">and</span> <span class="bp">self</span><span class="o">.</span><span class="n">start_stop</span> <span class="o">==</span> <span class="p">(</span><span class="n">start</span><span class="p">,</span> <span class="n">stop</span><span class="p">)</span>  \
                <span class="ow">and</span> <span class="bp">self</span><span class="o">.</span><span class="n">previous_load</span> <span class="ow">is</span> <span class="ow">not</span> <span class="bp">None</span><span class="p">:</span>
            <span class="n">logging</span><span class="o">.</span><span class="n">debug</span><span class="p">(</span><span class="s">&#39;return previous load&#39;</span><span class="p">)</span>
            <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">previous_load</span>

        <span class="bp">self</span><span class="o">.</span><span class="n">show</span> <span class="o">=</span> <span class="n">show</span>
        <span class="bp">self</span><span class="o">.</span><span class="n">input_feature_filename</span> <span class="o">=</span> <span class="n">input_feature_filename</span>
        <span class="bp">self</span><span class="o">.</span><span class="n">start_stop</span> <span class="o">=</span> <span class="p">(</span><span class="n">start</span><span class="p">,</span> <span class="n">stop</span><span class="p">)</span>

        <span class="n">feature_filename</span> <span class="o">=</span> <span class="bp">None</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="bp">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="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="bp">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>
                                                   <span class="n">channel</span><span class="o">=</span><span class="n">channel</span><span class="p">,</span>
                                                   <span class="n">input_feature_filename</span><span class="o">=</span><span class="n">feature_filename</span><span class="p">,</span>
                                                   <span class="n">label</span><span class="o">=</span><span class="n">label</span><span class="p">,</span>
                                                   <span class="n">start</span><span class="o">=</span><span class="n">start</span><span class="p">,</span> <span class="n">stop</span><span class="o">=</span><span class="n">stop</span><span class="p">)</span>
Anthony Larcher's avatar
Anthony Larcher committed
505
        <span class="k">else</span><span class="p">:</span>
Anthony Larcher's avatar
Anthony Larcher committed
506
507
508
509
510
            <span class="n">logging</span><span class="o">.</span><span class="n">info</span><span class="p">(</span><span class="s">&#39;Extract tandem features from multiple sources&#39;</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_tandem_features</span><span class="p">(</span><span class="n">show</span><span class="p">,</span>
                                                          <span class="n">channel</span><span class="o">=</span><span class="n">channel</span><span class="p">,</span>
                                                          <span class="n">label</span><span class="o">=</span><span class="n">label</span><span class="p">,</span>
                                                          <span class="n">start</span><span class="o">=</span><span class="n">start</span><span class="p">,</span> <span class="n">stop</span><span class="o">=</span><span class="n">stop</span><span class="p">)</span>
Anthony Larcher's avatar
doc    
Anthony Larcher committed
511
512
        <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">previous_load</span>
</div>
Anthony Larcher's avatar
Anthony Larcher committed
513
<div class="viewcode-block" id="FeaturesServer.get_features"><a class="viewcode-back" href="../featuresserver.html#features_server.FeaturesServer.get_features">[docs]</a>    <span class="k">def</span> <span class="nf">get_features</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">show</span><span class="p">,</span> <span class="n">channel</span><span class="o">=</span><span class="mi">0</span><span class="p">,</span> <span class="n">input_feature_filename</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span> <span class="n">label</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span> <span class="n">start</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span> <span class="n">stop</span><span class="o">=</span><span class="bp">None</span><span class="p">):</span>
Anthony Larcher's avatar
Anthony Larcher committed
514
        <span class="sd">&quot;&quot;&quot;</span>
Anthony Larcher's avatar
Anthony Larcher committed
515
516
517
518
519
520
521
522
523
524
525
526
<span class="sd">        Get the datasets from a single HDF5 file</span>
<span class="sd">        The HDF5 file is loaded from disk or processed on the fly</span>
<span class="sd">        via the FeaturesExtractor of the current FeaturesServer</span>

<span class="sd">        :param show: ID of the show</span>
<span class="sd">        :param channel: index of the channel to read</span>
<span class="sd">        :param input_feature_filename: name of the input file in case it does not include the ID of the show</span>
<span class="sd">        :param label: vad labels</span>
<span class="sd">        :param start: index of the first frame of the selected segment</span>
<span class="sd">        :param stop: index of the last frame of the selected segment</span>

<span class="sd">        :return: acoustic parameters and their vad labels</span>
Anthony Larcher's avatar
Anthony Larcher committed
527
528
<span class="sd">        &quot;&quot;&quot;</span>
        <span class="sd">&quot;&quot;&quot;</span>
Anthony Larcher's avatar
Anthony Larcher committed
529
530
531
<span class="sd">        Si le nom du fichier d&#39;entrée est totalement indépendant du show</span>
<span class="sd">        -&gt; si feature_filename_structure ne contient pas &quot;{}&quot;</span>
<span class="sd">        on peut mettre à jour: self.audio_filename_structure pour entrer directement le nom du fichier de feature</span>
Anthony Larcher's avatar
Anthony Larcher committed
532
<span class="sd">        &quot;&quot;&quot;</span>
Anthony Larcher's avatar
Anthony Larcher committed
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
        <span class="k">if</span> <span class="n">input_feature_filename</span> <span class="ow">is</span> <span class="ow">not</span> <span class="bp">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="c"># 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="bp">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="s">&quot;r&quot;</span><span class="p">)</span>

        <span class="c"># If an extractor is provided for this source, extract features and return an hdf5 handler</span>
        <span class="k">else</span><span class="p">:</span>
            <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="c">#logging.debug(&quot;*** show: &quot;+show)</span>

        <span class="c"># Get the selected segment</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="s">&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="c"># 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="bp">None</span><span class="p">:</span>
            <span class="n">start</span> <span class="o">=</span> <span class="mi">0</span>
        <span class="n">pad_begining</span> <span class="o">=</span> <span class="o">-</span><span class="n">start</span> <span class="k">if</span> <span class="n">start</span> <span class="o">&lt;</span> <span class="mi">0</span> <span class="k">else</span> <span class="mi">0</span>
        <span class="n">start</span> <span class="o">=</span> <span class="nb">max</span><span class="p">(</span><span class="n">start</span><span class="p">,</span> <span class="mi">0</span><span class="p">)</span>

        <span class="k">if</span> <span class="n">stop</span> <span class="ow">is</span> <span class="bp">None</span><span class="p">:</span>
            <span class="n">stop</span> <span class="o">=</span> <span class="n">dataset_length</span>
        <span class="n">pad_end</span> <span class="o">=</span> <span class="n">stop</span> <span class="o">-</span> <span class="n">dataset_length</span> <span class="k">if</span> <span class="n">stop</span> <span class="o">&gt;</span> <span class="n">dataset_length</span> <span class="k">else</span> <span class="mi">0</span>
        <span class="n">stop</span> <span class="o">=</span> <span class="nb">min</span><span class="p">(</span><span class="n">stop</span><span class="p">,</span> <span class="n">dataset_length</span><span class="p">)</span>

        <span class="n">global_cmvn</span> <span class="o">=</span>  <span class="bp">self</span><span class="o">.</span><span class="n">global_cmvn</span> <span class="ow">and</span> <span class="ow">not</span> <span class="p">(</span><span class="n">start</span> <span class="ow">is</span> <span class="bp">None</span> <span class="ow">or</span> <span class="n">stop</span> <span class="ow">is</span> <span class="bp">None</span><span class="p">)</span>

        <span class="c"># Get the data between start and stop</span>
        <span class="c"># Concatenate all required datasets</span>
        <span class="n">feat</span> <span class="o">=</span> <span class="p">[]</span>
        <span class="n">global_mean</span> <span class="o">=</span> <span class="p">[]</span>
        <span class="n">global_std</span> <span class="o">=</span> <span class="p">[]</span>
        <span class="k">if</span> <span class="s">&quot;energy&quot;</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">dataset_list</span><span class="p">:</span>
            <span class="n">feat</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">h5f</span><span class="p">[</span><span class="s">&quot;/&quot;</span><span class="o">.</span><span class="n">join</span><span class="p">((</span><span class="n">show</span><span class="p">,</span> <span class="s">&quot;energy&quot;</span><span class="p">))]</span><span class="o">.</span><span class="n">value</span><span class="p">[</span><span class="n">start</span><span class="p">:</span><span class="n">stop</span><span class="p">,</span> <span class="n">numpy</span><span class="o">.</span><span class="n">newaxis</span><span class="p">])</span>
            <span class="n">global_mean</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">h5f</span><span class="p">[</span><span class="s">&quot;/&quot;</span><span class="o">.</span><span class="n">join</span><span class="p">((</span><span class="n">show</span><span class="p">,</span> <span class="s">&quot;energy_mean&quot;</span><span class="p">))]</span><span class="o">.</span><span class="n">value</span><span class="p">)</span>
            <span class="n">global_std</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">h5f</span><span class="p">[</span><span class="s">&quot;/&quot;</span><span class="o">.</span><span class="n">join</span><span class="p">((</span><span class="n">show</span><span class="p">,</span> <span class="s">&quot;energy_std&quot;</span><span class="p">))]</span><span class="o">.</span><span class="n">value</span><span class="p">)</span>
        <span class="k">if</span> <span class="s">&quot;cep&quot;</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">dataset_list</span><span class="p">:</span>
            <span class="n">feat</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">h5f</span><span class="p">[</span><span class="s">&quot;/&quot;</span><span class="o">.</span><span class="n">join</span><span class="p">((</span><span class="n">show</span><span class="p">,</span> <span class="s">&quot;cep&quot;</span><span class="p">))][</span><span class="n">start</span><span class="p">:</span><span class="n">stop</span><span class="p">,</span> <span class="p">:])</span>
            <span class="n">global_mean</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">h5f</span><span class="p">[</span><span class="s">&quot;/&quot;</span><span class="o">.</span><span class="n">join</span><span class="p">((</span><span class="n">show</span><span class="p">,</span> <span class="s">&quot;cep_mean&quot;</span><span class="p">))]</span><span class="o">.</span><span class="n">value</span><span class="p">)</span>
            <span class="n">global_std</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">h5f</span><span class="p">[</span><span class="s">&quot;/&quot;</span><span class="o">.</span><span class="n">join</span><span class="p">((</span><span class="n">show</span><span class="p">,</span> <span class="s">&quot;cep_std&quot;</span><span class="p">))]</span><span class="o">.</span><span class="n">value</span><span class="p">)</span>
        <span class="k">if</span> <span class="s">&quot;fb&quot;</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">dataset_list</span><span class="p">:</span>
            <span class="n">feat</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">h5f</span><span class="p">[</span><span class="s">&quot;/&quot;</span><span class="o">.</span><span class="n">join</span><span class="p">((</span><span class="n">show</span><span class="p">,</span> <span class="s">&quot;fb&quot;</span><span class="p">))][</span><span class="n">start</span><span class="p">:</span><span class="n">stop</span><span class="p">,</span> <span class="p">:])</span>
            <span class="n">global_mean</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">h5f</span><span class="p">[</span><span class="s">&quot;/&quot;</span><span class="o">.</span><span class="n">join</span><span class="p">((</span><span class="n">show</span><span class="p">,</span> <span class="s">&quot;fb_mean&quot;</span><span class="p">))]</span><span class="o">.</span><span class="n">value</span><span class="p">)</span>
            <span class="n">global_std</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">h5f</span><span class="p">[</span><span class="s">&quot;/&quot;</span><span class="o">.</span><span class="n">join</span><span class="p">((</span><span class="n">show</span><span class="p">,</span> <span class="s">&quot;fb_std&quot;</span><span class="p">))]</span><span class="o">.</span><span class="n">value</span><span class="p">)</span>
        <span class="k">if</span> <span class="s">&quot;bnf&quot;</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">dataset_list</span><span class="p">:</span>
            <span class="n">feat</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">h5f</span><span class="p">[</span><span class="s">&quot;/&quot;</span><span class="o">.</span><span class="n">join</span><span class="p">((</span><span class="n">show</span><span class="p">,</span> <span class="s">&quot;bnf&quot;</span><span class="p">))][</span><span class="n">start</span><span class="p">:</span><span class="n">stop</span><span class="p">,</span> <span class="p">:])</span>
            <span class="n">global_mean</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">h5f</span><span class="p">[</span><span class="s">&quot;/&quot;</span><span class="o">.</span><span class="n">join</span><span class="p">((</span><span class="n">show</span><span class="p">,</span> <span class="s">&quot;bnf_mean&quot;</span><span class="p">))]</span><span class="o">.</span><span class="n">value</span><span class="p">)</span>
            <span class="n">global_std</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">h5f</span><span class="p">[</span><span class="s">&quot;/&quot;</span><span class="o">.</span><span class="n">join</span><span class="p">((</span><span class="n">show</span><span class="p">,</span> <span class="s">&quot;bnf_std&quot;</span><span class="p">))]</span><span class="o">.</span><span class="n">value</span><span class="p">)</span>
        <span class="n">feat</span> <span class="o">=</span> <span class="n">numpy</span><span class="o">.</span><span class="n">hstack</span><span class="p">(</span><span class="n">feat</span><span class="p">)</span>
        <span class="n">global_mean</span> <span class="o">=</span> <span class="n">numpy</span><span class="o">.</span><span class="n">hstack</span><span class="p">(</span><span class="n">global_mean</span><span class="p">)</span>
        <span class="n">global_std</span> <span class="o">=</span> <span class="n">numpy</span><span class="o">.</span><span class="n">hstack</span><span class="p">(</span><span class="n">global_std</span><span class="p">)</span>

        <span class="k">if</span> <span class="n">label</span> <span class="ow">is</span> <span class="bp">None</span><span class="p">:</span>
            <span class="k">if</span> <span class="s">&quot;/&quot;</span><span class="o">.</span><span class="n">join</span><span class="p">((</span><span class="n">show</span><span class="p">,</span> <span class="s">&quot;vad&quot;</span><span class="p">))</span> <span class="ow">in</span> <span class="n">h5f</span><span class="p">:</span>
                <span class="n">label</span> <span class="o">=</span> <span class="n">h5f</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s">&quot;/&quot;</span><span class="o">.</span><span class="n">join</span><span class="p">((</span><span class="n">show</span><span class="p">,</span> <span class="s">&quot;vad&quot;</span><span class="p">)))</span><span class="o">.</span><span class="n">value</span><span class="o">.</span><span class="n">astype</span><span class="p">(</span><span class="s">&#39;bool&#39;</span><span class="p">)</span><span class="o">.</span><span class="n">squeeze</span><span class="p">()[</span><span class="n">start</span><span class="p">:</span><span class="n">stop</span><span class="p">]</span>
Anthony Larcher's avatar
Anthony Larcher committed
589
            <span class="k">else</span><span class="p">:</span>
Anthony Larcher's avatar
Anthony Larcher committed
590
591
592
593
594
595
596
597
598
599
600
601
602
                <span class="n">label</span> <span class="o">=</span> <span class="n">numpy</span><span class="o">.</span><span class="n">ones</span><span class="p">(</span><span class="n">feat</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="n">dtype</span><span class="o">=</span><span class="s">&#39;bool&#39;</span><span class="p">)</span>
        <span class="c"># Pad the segment if needed</span>
        <span class="n">feat</span> <span class="o">=</span> <span class="n">numpy</span><span class="o">.</span><span class="n">pad</span><span class="p">(</span><span class="n">feat</span><span class="p">,</span> <span class="p">((</span><span class="n">pad_begining</span><span class="p">,</span> <span class="n">pad_end</span><span class="p">),</span> <span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="mi">0</span><span class="p">)),</span> <span class="n">mode</span><span class="o">=</span><span class="s">&#39;edge&#39;</span><span class="p">)</span>
        <span class="n">label</span> <span class="o">=</span> <span class="n">numpy</span><span class="o">.</span><span class="n">pad</span><span class="p">(</span><span class="n">label</span><span class="p">,</span> <span class="p">((</span><span class="n">pad_begining</span><span class="p">,</span> <span class="n">pad_end</span><span class="p">)),</span> <span class="n">mode</span><span class="o">=</span><span class="s">&#39;edge&#39;</span><span class="p">)</span>
        <span class="n">stop</span> <span class="o">+=</span> <span class="n">pad_begining</span> <span class="o">+</span> <span class="n">pad_end</span>

        <span class="n">h5f</span><span class="o">.</span><span class="n">close</span><span class="p">()</span>
        <span class="c"># Post-process the features and return the features and vad label</span>
        <span class="k">if</span> <span class="n">global_cmvn</span><span class="p">:</span>
            <span class="n">feat</span><span class="p">,</span> <span class="n">label</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">post_processing</span><span class="p">(</span><span class="n">feat</span><span class="p">,</span> <span class="n">label</span><span class="p">,</span> <span class="n">global_mean</span><span class="p">,</span> <span class="n">global_std</span><span class="p">)</span>
        <span class="k">else</span><span class="p">:</span>
            <span class="n">feat</span><span class="p">,</span> <span class="n">label</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">post_processing</span><span class="p">(</span><span class="n">feat</span><span class="p">,</span> <span class="n">label</span><span class="p">)</span>

Anthony Larcher's avatar
doc    
Anthony Larcher committed
603
604
        <span class="k">return</span> <span class="n">feat</span><span class="p">,</span> <span class="n">label</span>
</div>
Anthony Larcher's avatar
Anthony Larcher committed
605
606
607
608
609
610
611
612
613
614
615
<div class="viewcode-block" id="FeaturesServer.get_tandem_features"><a class="viewcode-back" href="../featuresserver.html#features_server.FeaturesServer.get_tandem_features">[docs]</a>    <span class="k">def</span> <span class="nf">get_tandem_features</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">show</span><span class="p">,</span> <span class="n">channel</span><span class="o">=</span><span class="mi">0</span><span class="p">,</span> <span class="n">label</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span> <span class="n">start</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span> <span class="n">stop</span><span class="o">=</span><span class="bp">None</span><span class="p">):</span>
        <span class="sd">&quot;&quot;&quot;</span>
<span class="sd">        Read acoustic parameters from multiple HDF5 files (from disk or extracted by FeaturesExtractor objects).</span>

<span class="sd">        :param show: Id of the show</span>
<span class="sd">        :param channel: index of the channel</span>
<span class="sd">        :param label: vad labels</span>
<span class="sd">        :param start: index of the first frame of the selected segment</span>
<span class="sd">        :param stop: index of the last frame of the selected segment</span>

<span class="sd">        :return: acoustic parameters and their vad labels</span>
Anthony Larcher's avatar
Anthony Larcher committed
616
<span class="sd">        &quot;&quot;&quot;</span>
Anthony Larcher's avatar
Anthony Larcher committed
617
618
619
620
621
622
623
624
        <span class="c"># Each source has its own sources (including subserver) that provides features and label</span>
        <span class="n">features</span> <span class="o">=</span> <span class="p">[]</span>
        <span class="k">for</span> <span class="n">features_server</span><span class="p">,</span> <span class="n">get_vad</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">sources</span><span class="p">:</span>
            <span class="c"># Get features from this source</span>
            <span class="n">feat</span><span class="p">,</span> <span class="n">lbl</span> <span class="o">=</span> <span class="n">features_server</span><span class="o">.</span><span class="n">get_features</span><span class="p">(</span><span class="n">show</span><span class="p">,</span> <span class="n">channel</span><span class="o">=</span><span class="n">channel</span><span class="p">,</span> <span class="n">label</span><span class="o">=</span><span class="n">label</span><span class="p">,</span> <span class="n">start</span><span class="o">=</span><span class="n">start</span><span class="p">,</span> <span class="n">stop</span><span class="o">=</span><span class="n">stop</span><span class="p">)</span>
            <span class="k">if</span> <span class="n">get_vad</span><span class="p">:</span>
                <span class="n">label</span> <span class="o">=</span> <span class="n">lbl</span>
            <span class="n">features</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">feat</span><span class="p">)</span>
Anthony Larcher's avatar
Anthony Larcher committed
625

Anthony Larcher's avatar
Anthony Larcher committed
626
627
628
629
630
631
632
        <span class="n">features</span> <span class="o">=</span> <span class="n">numpy</span><span class="o">.</span><span class="n">hstack</span><span class="p">(</span><span class="n">features</span><span class="p">)</span>

        <span class="c"># If the VAD is not required, return all labels at True</span>
        <span class="k">if</span> <span class="n">label</span> <span class="ow">is</span> <span class="bp">None</span><span class="p">:</span>
            <span class="n">label</span> <span class="o">=</span> <span class="n">numpy</span><span class="o">.</span><span class="n">ones</span><span class="p">(</span><span class="n">feat</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="n">dtype</span><span class="o">=</span><span class="s">&#39;bool&#39;</span><span class="p">)</span>

        <span class="c"># Apply the final post-processing on the concatenated features</span>
Anthony Larcher's avatar
doc    
Anthony Larcher committed
633
634
        <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">post_processing</span><span class="p">(</span><span class="n">features</span><span class="p">,</span> <span class="n">label</span><span class="p">)</span>
</div>
Anthony Larcher's avatar
Anthony Larcher committed
635
636
637
638
639
640
641
642
643
644
645
646
647
<div class="viewcode-block" id="FeaturesServer.mean_std"><a class="viewcode-back" href="../featuresserver.html#features_server.FeaturesServer.mean_std">[docs]</a>    <span class="k">def</span> <span class="nf">mean_std</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">show</span><span class="p">,</span> <span class="n">channel</span><span class="o">=</span><span class="mi">0</span><span class="p">,</span> <span class="n">start</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span> <span class="n">stop</span><span class="o">=</span><span class="bp">None</span><span class="p">):</span>
        <span class="sd">&quot;&quot;&quot;</span>
<span class="sd">        Compute the mean and standard deviation vectors for a segment of acoustic features</span>

<span class="sd">        :param show: the ID of the show</span>
<span class="sd">        :param channel: the index of the channel</span>
<span class="sd">        :param start: index of the first frame of the selected segment</span>
<span class="sd">        :param stop: index of the last frame of the selected segment</span>

<span class="sd">        :return: the number of frames, the mean of the frames and their standard deviation</span>
<span class="sd">        &quot;&quot;&quot;</span>
        <span class="n">feat</span><span class="p">,</span> <span class="n">_</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">load</span><span class="p">(</span><span class="n">show</span><span class="p">,</span> <span class="n">channel</span><span class="o">=</span><span class="n">channel</span><span class="p">,</span> <span class="n">start</span><span class="o">=</span><span class="n">start</span><span class="p">,</span> <span class="n">stop</span><span class="o">=</span><span class="n">stop</span><span class="p">)</span>
        <span class="k">return</span> <span class="n">feat</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="n">feat</span><span class="o">.</span><span class="n">sum</span><span class="p">(</span><span class="n">axis</span><span class="o">=</span><span class="mi">0</span><span class="p">),</span> <span class="n">numpy</span><span class="o">.</span><span class="n">sum</span><span class="p">(</span><span class="n">feat</span><span class="o">**</span><span class="mi">2</span><span class="p">,</span> <span class="n">axis</span><span class="o">=</span><span class="mi">0</span><span class="p">)</span></div></div>
Anthony Larcher's avatar
Anthony Larcher committed
648
</pre></div>
Anthony Larcher's avatar
Anthony Larcher committed
649
650

          </div>
Anthony Larcher's avatar
Anthony Larcher committed
651
652
653
654
655
656
657
658
659
660
661
662
663
        </div>
      </div>
      <div class="clearer"></div>
    </div>
    <div class="related" role="navigation" aria-label="related navigation">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="../genindex.html" title="General Index"
             >index</a></li>
        <li class="right" >
          <a href="../py-modindex.html" title="Python Module Index"
             >modules</a> |</li>
664
        <li class="nav-item nav-item-0"><a href="../index.html">SIDEKIT 1.1.6 documentation</a> &raquo;</li>
Anthony Larcher's avatar
Anthony Larcher committed
665
666
667
668
          <li class="nav-item nav-item-1"><a href="index.html" >Module code</a> &raquo;</li> 
      </ul>
    </div>
    <div class="footer" role="contentinfo">
Anthony Larcher's avatar
Anthony Larcher committed
669
        &copy; Copyright 2014-16, Anthony LARCHER &amp; Sylvain MEIGNIER &amp; Kong Aik LEE.
Anthony Larcher's avatar
doc    
Anthony Larcher committed
670
      Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.3.1.
Anthony Larcher's avatar
Anthony Larcher committed
671
672
    </div>
  </body>
Anthony Larcher's avatar
Anthony Larcher committed
673
</html>