kodokan.store#
dol-backed stores for the pipeline’s artifacts (the analysis SSOT).
Two dict-like stores keyed by video_id:
pose_store()—video_id -> PoseSequence, each persisted as a tidy/long Parquet file (columnsfidx, frame, t_sec, person, keypoint, x, y, conf) with sequence metadata (fps, dims, backend, source_url, frame indices) carried in the Parquet schema metadata. Tidy/long Parquet is the analysis SSOT — columnar, compressed, and pandas/polars/DuckDB-native (research §6).segments_store()—video_id -> list[demo dicts]as JSON.
load_all_tidy() concatenates every clip’s table (adding a video_id column)
into one DataFrame for cross-clip analysis.
Functions
Integrity report for a single |
|
|
Row-level integrity checks on a tidy pose DataFrame. |
|
Concatenate every clip's tidy table (with a |
Reconstruct a |
|
|
A dict-like |
|
A dict-like |
Serialize a |
|
|
Convert a |
|
Run |
- kodokan.store.check_sequence_integrity(seq)[source]#
Integrity report for a single
PoseSequence(via its tidy table).- Return type:
- kodokan.store.check_tidy_integrity(df, *, width=None, height=None, oob_margin_frac=0.05)[source]#
Row-level integrity checks on a tidy pose DataFrame.
Returns counts of anomalies (all should be
0for a clean store):n_duplicate_rows: rows sharing a(fidx, person, keypoint)key (each such triple must be unique per clip).n_oob_xy: keypoints falling outside the frame by more thanoob_margin_fracof its size (only checked whenwidth/heightare given; a small margin is tolerated since limbs can extend just past frame).n_bad_conf: confidences outside[0, 1].n_nan_xy: non-finite coordinates (occluded rows should have been dropped).
- Return type:
- kodokan.store.load_all_tidy(store=None)[source]#
Concatenate every clip’s tidy table (with a
video_idcolumn) into one DataFrame.
- kodokan.store.parquet_bytes_to_sequence(data)[source]#
Reconstruct a
PoseSequencefrom Parquet bytes written above.- Return type:
- kodokan.store.pose_store(directory=None)[source]#
A dict-like
{video_id: PoseSequence}store backed by per-clip Parquet.
- kodokan.store.segments_store(directory=None)[source]#
A dict-like
{video_id: <json>}store for demo segments (and metadata).
- kodokan.store.sequence_to_parquet_bytes(seq)[source]#
Serialize a
PoseSequenceto Parquet bytes (tidy + schema metadata).- Return type:
- kodokan.store.sequence_to_tidy_df(seq, *, video_id=None, drop_missing=True)[source]#
Convert a
PoseSequenceto a tidy/long DataFrame.One row per (frame, person, keypoint).
fidxis the 0-based analyzed-frame position;frameis the source frame index. Avideo_idcolumn is added when given (used byload_all_tidy()).
- kodokan.store.store_integrity_report(store=None)[source]#
Run
check_sequence_integrity()over every clip in a pose store.Returns
{video_id: report}; a clip that fails to load records{"error": ...}rather than aborting the whole sweep.- Return type: