SmartSpectra C++ SDK
Measure human vitals from video with SmartSpectra C++ SDK.
Loading...
Searching...
No Matches
lab Directory Reference

Directories

 
preprocessing

Files

 
preprocessing_foreground_container.hpp
 
preprocessing_foreground_container_impl.hpp
 
preprocessing_stream_and_packet_names.hpp

Detailed Description

Smart Spectra C++ Lab

This is a private/internal set of tools for experimentation with and testing of Physiology Edge and the Smart Spectra C++ SDK. Smart Spectra C++ Lab does NOT get published in the public GitHub SmartSpectra repository.

Main rules

  • Test whatcha need.
  • Solve problems.
  • Be scrappy.
  • Be fun.

What's already here

The preprocessing app & foreground container are here to provide exclusive access to just the preprocessing portion of the Edge graph. Currently, it only works with the JSON version of preprocessing. It takes video, frame folder, or webcam as input, then outputs JSONs to disk in either spot or continuous modes.

How to build?

Mostly follow the monorepo Build Instructions with one hugely-important addition: pass in -DBUILD_LAB_SUPPORT=ON to cmake during the configuration step. Otherwise, the preprocessing graphs will not be installed as part of the Physiology Edge dependency – and these are the ones Lab uses.

How to run?

After building you can locally run this command, just replace cmake-build-debug with the name of your build folder and <YOUR_API_KEY_HERE> with your API key.

cmake-build-debug/smartspectra/cpp/lab/preprocessing/preprocessing --also_log_to_stderr --api_key=<YOUR_API_KEY_HERE> --operation_mode=continuous

Use --operation_mode=continuous or --operation_mode=spot, depending on your needs.

Use --enable_phasic_bp to enable the blood pressure inference model if needed (will take a long wile to calibrate, though, so don't expect BP output right away).

For documentation on all command-line parameters, run

./cmake-build-debug/smartspectra/cpp/lab/preprocessing/preprocessing --help=main

Visual Debugging (Tracked Point Regions)

  • Purpose: Quickly verify point tracking regions (chest/abdomen/glutes/knees) overlaid on the original frames for tuning and troubleshooting.
  • Enable with --debug_pose_regions. This draws points, convex hull fill, outlines, and labels for all four regions continuously.

Examples:

  • Webcam (continuous):
    preprocessing --also_log_to_stderr --api_key=<YOUR_API_KEY_HERE> \
    --operation_mode=continuous --debug_pose_regions
  • File + timestamps (spot):
    preprocessing --also_log_to_stderr --api_key=<YOUR_API_KEY_HERE> \
    --operation_mode=spot --debug_pose_regions \
    --input_video_path="/path/to/video.mkv" \
    --input_video_time_path="/path/to/timestamps.txt"

Linux: Installed Executable

On Debian-based Linux, if C++ SDK is built within the monorepo (e.g. via docker shell) and packaged using cpack -G DEB, like it currently happens in CI on commit to any trunk (dev, test, main), instead of building, you can grab the package from s3 and instal it:

aws s3 cp s3://presage-project-files/Physiology/smartspectra/cpp/amd64/main/libsmartspectra-dev-1.0.0~rc10-dev-amd64.deb ./
sudo apt install ./libsmartspectra-dev-1.0.0~rc10-dev-amd64.deb

Then, it's even easier to run:

preprocessing --also_log_to_stderr --api_key=<YOUR_API_KEY_HERE> --operation_mode=continuous