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

◆ run_operation()

VisionAnalyzer::output_type MayaFlux::Yantra::VisionAnalyzer::run_operation ( const input_type &  input)
private

ComputeOperation adapter: uses input.data as the source container, pulls index out of Datum metadata (defaulting to 0), calls analyze_vision().

See analyze_vision() for the real API; query/context come from this instance's own configured state, not from the Datum, matching every other UniversalAnalyzer-family operation_function.

Definition at line 596 of file VisionAnalyzer.cpp.

597{
598 output_type output;
599 output.metadata = input.metadata;
600
601 if (const auto image = Kakshya::get_metadata_value<std::shared_ptr<Core::VKImage>>(input.metadata, "vision_image");
602 image && *image) {
603 output.metadata["vision_analysis"] = analyze_vision(*image);
604 return output;
605 }
606
607 if (!input.data) {
608 output.metadata["error"] = std::string("VisionAnalyzer: missing container");
609 return output;
610 }
611
612 const auto index = Kakshya::get_metadata_value<size_t>(input.metadata, "container_index").value_or(0);
613
614 output.metadata["vision_analysis"] = analyze_vision(input.data, index);
615 return output;
616}
Core::GlobalInputConfig input
Definition Config.cpp:42
IO::ImageData image
Definition Decoder.cpp:47
uint32_t index
Definition VKDevice.cpp:122
Kinesis::Vision::VisionAnalysis analyze_vision(const std::shared_ptr< Kakshya::SignalSourceContainer > &source, size_t index=0)
Real entry point: resolve the configured query against source, run it, run the GPU analysis.
std::optional< T > get_metadata_value(const std::unordered_map< std::string, std::any > &metadata, const std::string &key)
Get a value from a metadata map by key.
std::unordered_map< std::string, std::any > metadata
Associated metadata.
Definition DataIO.hpp:30

References analyze_vision(), MayaFlux::Kakshya::get_metadata_value(), image, index, input, and MayaFlux::Yantra::Datum< T >::metadata.

Referenced by VisionAnalyzer().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: