Mercurial > hg > vampy-host
comparison vamp/collect.py @ 143:79b050ca2fc2
Docs
author | Chris Cannam |
---|---|
date | Wed, 08 Jul 2015 15:02:53 +0100 |
parents | 1a494598ee2b |
children | 61834f9c4e46 |
comparison
equal
deleted
inserted
replaced
142:ee085cf5832d | 143:79b050ca2fc2 |
---|---|
130 "matrix", or "list". Which one is used depends on the structure of | 130 "matrix", or "list". Which one is used depends on the structure of |
131 features set out in the output descriptor for the requested plugin | 131 features set out in the output descriptor for the requested plugin |
132 output: | 132 output: |
133 | 133 |
134 * If the plugin output emits single-valued features at a fixed | 134 * If the plugin output emits single-valued features at a fixed |
135 sample-rate, then the "vector" element will be used. It will | 135 sample-rate, then the "vector" element will be used. It will |
136 contain a tuple of step time (the time in seconds between | 136 contain a tuple of step time (the time in seconds between |
137 consecutive feature values) and a one-dimensional NumPy array of | 137 consecutive feature values) and a one-dimensional NumPy array of |
138 feature values. An example of such a feature might be a loudness | 138 feature values. An example of such a feature might be a loudness |
139 curve against time. | 139 curve against time. |
140 | 140 |
141 * If the plugin output emits multiple-valued features, with an | 141 * If the plugin output emits multiple-valued features, with an |
142 equal number of bins per feature, at a fixed sample-rate, then | 142 equal number of bins per feature, at a fixed sample-rate, then |
143 the "matrix" element will be used. It will contain a tuple of | 143 the "matrix" element will be used. It will contain a tuple of |
144 step time (the time in seconds between consecutive feature | 144 step time (the time in seconds between consecutive feature |
145 values) and a two-dimensional NumPy array of feature values. An | 145 values) and a two-dimensional NumPy array of feature values. An |
146 example of such a feature might be a spectrogram. | 146 example of such a feature might be a spectrogram. |
147 | 147 |
148 * Otherwise, the "list" element will be used, and will contain a | 148 * Otherwise, the "list" element will be used, and will contain a |
149 list of features, where each feature is represented as a | 149 list of features, where each feature is represented as a |
150 dictionary containing a timestamp (always) and a duration | 150 dictionary containing a timestamp (always) and a duration |
151 (optionally), a label (string), and a 1-dimensional array of | 151 (optionally), a label (string), and a 1-dimensional array of |
152 float values. | 152 float values. |
153 | |
154 If you wish to override the processing step size, block size, or | |
155 process timestamp method, you may supply them as keyword arguments | |
156 with the keywords step_size (int), block_size (int), and | |
157 process_timestamp_method (choose from vamp.vampyhost.SHIFT_DATA, | |
158 vamp.vampyhost.SHIFT_TIMESTAMP, or vamp.vampyhost.NO_SHIFT). | |
153 | 159 |
154 If you would prefer to obtain features as they are calculated | 160 If you would prefer to obtain features as they are calculated |
155 (where the plugin supports this) and with the format in which the | 161 (where the plugin supports this) and with the format in which the |
156 plugin returns them, via an asynchronous generator function, use | 162 plugin returns them, via an asynchronous generator function, use |
157 vamp.process() instead. | 163 vamp.process() instead. |
158 | |
159 """ | 164 """ |
160 | 165 |
161 plugin, step_size, block_size = vamp.load.load_and_configure(data, sample_rate, plugin_key, parameters, **kwargs) | 166 plugin, step_size, block_size = vamp.load.load_and_configure(data, sample_rate, plugin_key, parameters, **kwargs) |
162 | 167 |
163 if output == "": | 168 if output == "": |