MayaFlux 0.3.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches

◆ set_extraction_parameter()

template<ComputeData InputType = std::vector<Kakshya::DataVariant>, ComputeData OutputType = std::vector<std::vector<double>>>
void MayaFlux::Yantra::FeatureExtractor< InputType, OutputType >::set_extraction_parameter ( const std::string &  name,
std::any  value 
)
inlineoverrideprotected

Handle extractor-specific parameters.

Definition at line 319 of file FeatureExtractor.hpp.

320 {
321 if (name == "method") {
322 if (auto* method_str = std::any_cast<std::string>(&value)) {
323 m_method = string_to_method(*method_str);
324 return;
325 }
326 if (auto* method_enum = std::any_cast<ExtractionMethod>(&value)) {
327 m_method = *method_enum;
328 return;
329 }
330 error<std::invalid_argument>(Journal::Component::Yantra, Journal::Context::ComputeMatrix, std::source_location::current(), "Method parameter must be string or ExtractionMethod enum");
331 }
332
333 if (name == "window_size") {
334 if (auto* size = std::any_cast<uint32_t>(&value)) {
335 m_window_size = *size;
337 return;
338 }
339 }
340 if (name == "hop_size") {
341 if (auto* size = std::any_cast<uint32_t>(&value)) {
342 m_hop_size = *size;
344 return;
345 }
346 }
347
348 base_type::set_extraction_parameter(name, std::move(value));
349 }
void validate_parameters() const
Validate extraction parameters.
static ExtractionMethod string_to_method(const std::string &str)
Convert string to extraction method enum.
virtual void set_extraction_parameter(const std::string &name, std::any value)
Extraction-specific parameter handling (override for custom parameters)
@ ComputeMatrix
Compute operations (Yantra - algorithms, matrices, DSP)
@ Yantra
DSP algorithms, computational units, matrix operations, Grammar.