SmartSpectra C++ SDK
Measure human vitals from video with SmartSpectra C++ SDK.
Loading...
Searching...
No Matches
presage::smartspectra::lab::PreprocessingForegroundContainer< TDeviceType, TOperationMode, TIntegrationMode > Class Template Reference
Inheritance diagram for presage::smartspectra::lab::PreprocessingForegroundContainer< TDeviceType, TOperationMode, TIntegrationMode >:
presage::smartspectra::container::ForegroundContainer< TDeviceType, TOperationMode, TIntegrationMode > presage::smartspectra::container::Container< TDeviceType, TOperationMode, TIntegrationMode >

Public Types

typedef container::settings::Settings< TOperationMode, TIntegrationMode > SettingsType
using Base = container::ForegroundContainer<TDeviceType, TOperationMode, TIntegrationMode>
Public Types inherited from presage::smartspectra::container::ForegroundContainer< TDeviceType, TOperationMode, TIntegrationMode >
typedef container::settings::Settings< TOperationMode, TIntegrationMode > SettingsType
using Base = Container<TDeviceType, TOperationMode, TIntegrationMode>
Public Types inherited from presage::smartspectra::container::Container< TDeviceType, TOperationMode, TIntegrationMode >
typedef container::settings::Settings< TOperationMode, TIntegrationMode > SettingsType

Public Member Functions

 PreprocessingForegroundContainer (SettingsType settings)
absl::Status DrawDebugOverlays (cv::Mat &output_frame_bgr)
Public Member Functions inherited from presage::smartspectra::container::ForegroundContainer< TDeviceType, TOperationMode, TIntegrationMode >
 ForegroundContainer (SettingsType settings)
absl::Status Initialize () override
virtual absl::Status Run ()
Public Member Functions inherited from presage::smartspectra::container::Container< TDeviceType, TOperationMode, TIntegrationMode >
 Container (SettingsType settings)
absl::Status SetOnStatusChange (const std::function< absl::Status(physiology::StatusValue)> &on_status_change)
absl::Status SetOnStatusCode (const std::function< absl::Status(physiology::StatusValue)> &on_status_code)
absl::Status SetOnEdgeMetricsOutput (const std::function< absl::Status(const physiology::Metrics &, int64_t input_timestamp)> &on_edge_metrics_output)
absl::Status SetOnCoreMetricsOutput (const std::function< absl::Status(const physiology::MetricsBuffer &, int64_t input_timestamp)> &on_core_metrics_output)
absl::Status SetOnVideoOutput (const std::function< absl::Status(cv::Mat &output_frame, int64_t input_timestamp)> &on_video_output)
absl::Status SetOnFrameSentThrough (const std::function< absl::Status(bool frame_sent_through, int64_t input_timestamp)> &on_dropped_frame)
absl::Status SetOnCorePerformanceTelemetry (const std::function< absl::Status(double, double, int64_t)> &on_effective_core_fps_output)

Public Attributes

std::function< absl::Status(const nlohmann::json &, int64_t input_timestamp)> OnPreprocessedDataOutput

Protected Member Functions

std::string GetThirdGraphFileSuffix () const override
std::string GetGraphFilePrefix () const override
absl::Status InitializeOutputDataPollers () override
absl::Status HandleOutputData (int64_t frame_timestamp) override
Protected Member Functions inherited from presage::smartspectra::container::Container< TDeviceType, TOperationMode, TIntegrationMode >
absl::StatusOr< std::filesystem::path > GetGraphFilePath (bool binary_graph=true) const
absl::Status ComputeCorePerformanceTelemetry (const physiology::MetricsBuffer &metrics_buffer)
void AddFrameTimestampToBenchmarkingInfo (const mediapipe::Timestamp &timestamp)

Additional Inherited Members

Protected Attributes inherited from presage::smartspectra::container::ForegroundContainer< TDeviceType, TOperationMode, TIntegrationMode >
presage::smartspectra::container::output_stream_poller_wrapper::OutputStreamPollerWrapper core_metrics_poller
presage::smartspectra::container::output_stream_poller_wrapper::OutputStreamPollerWrapper edge_metrics_poller
bool keep_grabbing_frames
std::shared_ptr< video_source::VideoSourcevideo_source = nullptr
std::unique_ptr< video_source::CameraTunercamera_tuner = nullptr
bool tuning_enabled = false
const bool load_video
Protected Attributes inherited from presage::smartspectra::container::Container< TDeviceType, TOperationMode, TIntegrationMode >
SettingsType settings
mediapipe::CalculatorGraph graph
std::function< absl::Status(physiology::StatusValue)> OnStatusChange
std::function< absl::Status(physiology::StatusValue)> OnStatusCode
std::function< absl::Status(const physiology::Metrics &, int64_t input_timestamp)> OnEdgeMetricsOutput
std::function< absl::Status(const physiology::MetricsBuffer &, int64_t input_timestamp)> OnCoreMetricsOutput
std::function< absl::Status(cv::Mat &output_frame, int64_t input_timestamp)> OnVideoOutput
std::function< absl::Status(bool frame_sent_through, int64_t input_timestamp)> OnFrameSentThrough
std::optional< std::function< absl::Status(double fps, double latency_s, int64_t input_timestamp)> > OnCorePerformanceTelemetry = std::nullopt
platform_independence::DeviceContext< TDeviceType > device_context
bool initialized = false
bool running = false
physiology::StatusValue status
bool recording = false
cv::Mat output_frame_bgr
OperationContext< TOperationMode > operation_context

Member Function Documentation

◆ GetGraphFilePrefix()

template<platform_independence::DeviceType TDeviceType, container::settings::OperationMode TOperationMode, container::settings::IntegrationMode TIntegrationMode>
std::string presage::smartspectra::lab::PreprocessingForegroundContainer< TDeviceType, TOperationMode, TIntegrationMode >::GetGraphFilePrefix ( ) const
nodiscardoverrideprotectedvirtual

Prefix used when searching for graph files on disk.

Reimplemented from presage::smartspectra::container::Container< TDeviceType, TOperationMode, TIntegrationMode >.

◆ GetThirdGraphFileSuffix()

template<platform_independence::DeviceType TDeviceType, container::settings::OperationMode TOperationMode, container::settings::IntegrationMode TIntegrationMode>
std::string presage::smartspectra::lab::PreprocessingForegroundContainer< TDeviceType, TOperationMode, TIntegrationMode >::GetThirdGraphFileSuffix ( ) const
nodiscardoverrideprotectedvirtual

Retrieve the suffix used for the optional third graph file.

Reimplemented from presage::smartspectra::container::Container< TDeviceType, TOperationMode, TIntegrationMode >.

◆ HandleOutputData()

template<platform_independence::DeviceType TDeviceType, c::settings::OperationMode TOperationMode, c::settings::IntegrationMode TIntegrationMode>
absl::Status presage::smartspectra::lab::PreprocessingForegroundContainer< TDeviceType, TOperationMode, TIntegrationMode >::HandleOutputData ( int64_t frame_timestamp)
overrideprotectedvirtual

Handle metrics and video output for the given frame.

Called from Run() at each frame iteration.

Template Parameters
TDeviceType
TOperationMode
Parameters
frame_timestamp
Returns

Reimplemented from presage::smartspectra::container::ForegroundContainer< TDeviceType, TOperationMode, TIntegrationMode >.

◆ InitializeOutputDataPollers()

template<platform_independence::DeviceType TDeviceType, c::settings::OperationMode TOperationMode, c::settings::IntegrationMode TIntegrationMode>
absl::Status presage::smartspectra::lab::PreprocessingForegroundContainer< TDeviceType, TOperationMode, TIntegrationMode >::InitializeOutputDataPollers ( )
overrideprotectedvirtual

Setup MediaPipe pollers for metrics and video output.

Called from Run() to initialize the output data pollers.

Template Parameters
TDeviceType
TOperationMode
Parameters
frame_timestamp
Returns
status of the initialization

Reimplemented from presage::smartspectra::container::ForegroundContainer< TDeviceType, TOperationMode, TIntegrationMode >.

Member Data Documentation

◆ OnPreprocessedDataOutput

template<platform_independence::DeviceType TDeviceType, container::settings::OperationMode TOperationMode, container::settings::IntegrationMode TIntegrationMode>
std::function<absl::Status(const nlohmann::json&, int64_t input_timestamp)> presage::smartspectra::lab::PreprocessingForegroundContainer< TDeviceType, TOperationMode, TIntegrationMode >::OnPreprocessedDataOutput
Initial value:
=
[](const nlohmann::json&, int64_t input_timestamp){ return absl::OkStatus(); }

The documentation for this class was generated from the following files: