Class PoseAnalysisResult#
Defined in File pose_analysis_result.hpp
Class Documentation#
-
class PoseAnalysisResult
Parses a .pose.json file written by analysis/run_pose.py (—out-format json) into a queryable in-memory structure, for drawing a live overlay during playback and plotting per-keypoint metrics over time.
Usage:
auto result = PoseAnalysisResult::load(jsonPath); if (result.is_valid()) { ... }
Public Functions
-
PoseAnalysisResult() = default
-
inline bool is_valid() const
-
inline bool has_any_detections() const
True if at least one frame has at least one detected subject. Distinct from is_valid() (which only means “the JSON parsed”): a result can be valid but empty if the pose model detected nobody in this camera’s footage for the whole session — callers use this to tell that case apart from “hasn’t been analyzed yet”.
-
inline const QString &source_video() const
-
inline const QString &model() const
The model id that produced this result (e.g. “yolov8n-pose.pt”), from the JSON’s top-level “model” field — empty for files written before this field existed (older, un-namespaced .pose.json files still load fine, they just report no model).
-
inline const QStringList &keypoint_names() const
-
inline const QVector<QPair<int, int>> &skeleton_edges() const
-
inline const QVector<PoseFrame> &frames() const
-
const PoseFrame *nearest_frame(int frameIndexEstimate) const
Nearest-frame lookup by frame_index estimate (e.g. derived from a video playback position). frames() is stored in the ascending frame_index order run_pose.py writes them in, so this is a binary search, not a linear scan. Returns nullptr if there are no frames.
Public Static Functions
-
static PoseAnalysisResult load(const QString &jsonPath)
Parses jsonPath. Returns a default-constructed (is_valid() == false) result if the file is missing or malformed.
-
PoseAnalysisResult() = default