Mercurial > hg > svcore
comparison transform/FeatureExtractionModelTransformer.cpp @ 778:d373ced0e6e9
outputFeatureNo -> outputNo
author | Chris Cannam |
---|---|
date | Wed, 27 Mar 2013 15:07:27 +0000 |
parents | eea8049df526 |
children | 15cd67fcbdad |
comparison
equal
deleted
inserted
replaced
777:eea8049df526 | 778:d373ced0e6e9 |
---|---|
39 FeatureExtractionModelTransformer::FeatureExtractionModelTransformer(Input in, | 39 FeatureExtractionModelTransformer::FeatureExtractionModelTransformer(Input in, |
40 const Transform &transform) : | 40 const Transform &transform) : |
41 ModelTransformer(in, transform), | 41 ModelTransformer(in, transform), |
42 m_plugin(0), | 42 m_plugin(0), |
43 m_descriptor(0), | 43 m_descriptor(0), |
44 m_outputFeatureNo(0) | 44 m_outputNo(0) |
45 { | 45 { |
46 // SVDEBUG << "FeatureExtractionModelTransformer::FeatureExtractionModelTransformer: plugin " << pluginId << ", outputName " << m_transform.getOutput() << endl; | 46 // SVDEBUG << "FeatureExtractionModelTransformer::FeatureExtractionModelTransformer: plugin " << pluginId << ", outputName " << m_transform.getOutput() << endl; |
47 | 47 |
48 QString pluginId = transform.getPluginIdentifier(); | 48 QString pluginId = transform.getPluginIdentifier(); |
49 | 49 |
153 | 153 |
154 for (size_t i = 0; i < outputs.size(); ++i) { | 154 for (size_t i = 0; i < outputs.size(); ++i) { |
155 // SVDEBUG << "comparing output " << i << " name \"" << outputs[i].identifier << "\" with expected \"" << m_transform.getOutput() << "\"" << endl; | 155 // SVDEBUG << "comparing output " << i << " name \"" << outputs[i].identifier << "\" with expected \"" << m_transform.getOutput() << "\"" << endl; |
156 if (m_transform.getOutput() == "" || | 156 if (m_transform.getOutput() == "" || |
157 outputs[i].identifier == m_transform.getOutput().toStdString()) { | 157 outputs[i].identifier == m_transform.getOutput().toStdString()) { |
158 m_outputFeatureNo = i; | 158 m_outputNo = i; |
159 m_descriptor = new Vamp::Plugin::OutputDescriptor(outputs[i]); | 159 m_descriptor = new Vamp::Plugin::OutputDescriptor(outputs[i]); |
160 break; | 160 break; |
161 } | 161 } |
162 } | 162 } |
163 | 163 |
337 model = new SparseTimeValueModel | 337 model = new SparseTimeValueModel |
338 (modelRate, modelResolution, false); | 338 (modelRate, modelResolution, false); |
339 } | 339 } |
340 | 340 |
341 Vamp::Plugin::OutputList outputs = m_plugin->getOutputDescriptors(); | 341 Vamp::Plugin::OutputList outputs = m_plugin->getOutputDescriptors(); |
342 model->setScaleUnits(outputs[m_outputFeatureNo].unit.c_str()); | 342 model->setScaleUnits(outputs[m_outputNo].unit.c_str()); |
343 | 343 |
344 m_output = model; | 344 m_output = model; |
345 | 345 |
346 QString outputEventTypeURI = description.getOutputEventTypeURI(outputId); | 346 QString outputEventTypeURI = description.getOutputEventTypeURI(outputId); |
347 m_output->setRDFTypeURI(outputEventTypeURI); | 347 m_output->setRDFTypeURI(outputEventTypeURI); |
532 Vamp::Plugin::FeatureSet features = m_plugin->process | 532 Vamp::Plugin::FeatureSet features = m_plugin->process |
533 (buffers, Vamp::RealTime::frame2RealTime(blockFrame, sampleRate)); | 533 (buffers, Vamp::RealTime::frame2RealTime(blockFrame, sampleRate)); |
534 | 534 |
535 if (m_abandoned) break; | 535 if (m_abandoned) break; |
536 | 536 |
537 for (size_t fi = 0; fi < features[m_outputFeatureNo].size(); ++fi) { | 537 for (size_t fi = 0; fi < features[m_outputNo].size(); ++fi) { |
538 Vamp::Plugin::Feature feature = | 538 Vamp::Plugin::Feature feature = features[m_outputNo][fi]; |
539 features[m_outputFeatureNo][fi]; | |
540 addFeature(blockFrame, feature); | 539 addFeature(blockFrame, feature); |
541 } | 540 } |
542 | 541 |
543 if (blockFrame == contextStart || completion > prevCompletion) { | 542 if (blockFrame == contextStart || completion > prevCompletion) { |
544 setCompletion(completion); | 543 setCompletion(completion); |
549 } | 548 } |
550 | 549 |
551 if (!m_abandoned) { | 550 if (!m_abandoned) { |
552 Vamp::Plugin::FeatureSet features = m_plugin->getRemainingFeatures(); | 551 Vamp::Plugin::FeatureSet features = m_plugin->getRemainingFeatures(); |
553 | 552 |
554 for (size_t fi = 0; fi < features[m_outputFeatureNo].size(); ++fi) { | 553 for (size_t fi = 0; fi < features[m_outputNo].size(); ++fi) { |
555 Vamp::Plugin::Feature feature = | 554 Vamp::Plugin::Feature feature = features[m_outputNo][fi]; |
556 features[m_outputFeatureNo][fi]; | |
557 addFeature(blockFrame, feature); | 555 addFeature(blockFrame, feature); |
558 } | 556 } |
559 } | 557 } |
560 | 558 |
561 setCompletion(100); | 559 setCompletion(100); |