comparison vamp/collect.py @ 151:5a6b8f4be9b9 tracks tip

Docs
author Chris Cannam
date Fri, 21 Apr 2017 14:33:57 +0100
parents 37d2fd57723e
children
comparison
equal deleted inserted replaced
150:37d2fd57723e 151:5a6b8f4be9b9
157 157
158 If the parameters dict is non-empty, the plugin will be configured 158 If the parameters dict is non-empty, the plugin will be configured
159 by setting its parameters according to the (string) key and 159 by setting its parameters according to the (string) key and
160 (float) value data found in the dict. 160 (float) value data found in the dict.
161 161
162 The results are returned in a dictionary which will always contain 162 The results are returned in a dictionary. This will always contain
163 exactly one element, whose key is one of the strings "vector", 163 exactly one of the keys "vector", "matrix", or "list". In addition
164 "matrix", "list", or "tracks". 164 it may optionally contain the key "tracks". Which of these is used
165 165 depends on the structure of features set out in the output
166 Which one is used depends on the structure of features set out in 166 descriptor for the requested plugin output, and sometimes on the
167 the output descriptor for the requested plugin output, and sometimes 167 features themselves, as follows:
168 on the features themselves: 168
169 169 * If the plugin output emits single-valued features at a fixed
170 * If the plugin output emits single-valued features continuously at 170 sample-rate, then the "vector" element will be used. It will contain
171 a fixed sample-rate starting at the beginning of the input, then the 171 a tuple of step time (the time in seconds between consecutive
172 "vector" element will be used. It will contain a tuple of step time 172 feature values) and a one-dimensional NumPy array of feature
173 (the time in seconds between consecutive feature values) and a 173 values. An example of such a feature might be a loudness curve
174 one-dimensional NumPy array of feature values. An example of such a 174 against time.
175 feature might be a loudness curve against time. 175
176 * If the above is true but it also happens that the plugin output
177 has gaps between some features, so that a single continuous vector
178 can't convey all the relevant information, then the "tracks" element
179 will additionally be used. It will contain a list of dictionaries,
180 one for each set of contiguous points in the output, each containing
181 elements "start" (start time in seconds), "step" (step time in
182 seconds), and "values" (a one-dimensional NumPy array of contiguous
183 feature values). An example of such a feature might be the output of
184 a pitch tracker that emits values only during pitched sections of
185 the input audio.
176 186
177 * If the plugin output emits multiple-valued features, with an 187 * If the plugin output emits multiple-valued features, with an
178 equal number of bins per feature, at a fixed sample-rate, then 188 equal number of bins per feature, at a fixed sample-rate, then
179 the "matrix" element will be used. It will contain a tuple of 189 the "matrix" element will be used. It will contain a tuple of
180 step time (the time in seconds between consecutive feature 190 step time (the time in seconds between consecutive feature
181 values) and a two-dimensional NumPy array of feature values. An 191 values) and a two-dimensional NumPy array of feature values. An
182 example of such a feature might be a spectrogram. 192 example of such a feature might be a spectrogram.
183 193
184 * If the plugin output emits single-valued features at a fixed
185 sample-rate but with gaps between features or a non-zero start time,
186 then the "tracks" element will be used. It will contain a list of
187 dictionaries, each containing a startTime, a stepTime, and a
188 one-dimensional NumPy array of contiguous feature values. An example
189 of such a feature might be a pitch tracker that emits values only
190 during pitched sections of the input audio.
191
192 * Otherwise, the "list" element will be used, and will contain a 194 * Otherwise, the "list" element will be used, and will contain a
193 list of features, where each feature is represented as a 195 list of features, where each feature is represented as a
194 dictionary containing a timestamp (always) and a duration 196 dictionary containing a timestamp (always) and a duration
195 (optionally), a label (string), and a 1-dimensional array of 197 (optionally), a label (string), and a 1-dimensional array of
196 float values. 198 float values.