Install uv if needed, then run from the repository root:
uv sync --lockeduv sync installs the locked dependencies and the required Python version. Open the
local URL printed by marimo to use the notebook. model_performance_report.py evaluates
the committed predictions in outputs/predictions/. On first launch it downloads the source
videos and the pose and pair Parquet files into data/ for clip previews; the two videos are
about 31 GB each, so allow time and disk space for the initial download.
uv run marimo edit model_performance_report.pyYou can edit the marimo notebook from the browser with the above command, or just work on it in VSCode with the Marimo extension, just like Jupyter.
data/: video and parquet filesoutputs/: generated artifacts, model files, etcoutputs/predictions/<model_name>/<video_id>.csv: predicted circling spans, one file per video (VideoID,StartFrame,EndFrame, plus any model-specific columns).
ground_truth_annotations/: annotation workflow, finalized intervals, and supporting notebooks.feature_engineering/: reusable feature pipelines. Each feature group has its own package, documentation, checked-in sample data, and ignored generated outputs.tests/: regression tests for the model feature, span and evaluation functions.evaluation/: library for action segmentation evaluationexperiments/shared_features/: leave-one-video-out comparison of feature sets and learners on the shared pair-motion features (additive; themodels/detectors are unchanged). See experiments/README.md.models/logistic_regression/: frame-level logistic regression: features, training, per-frame scoring and post-processing into sustained spans.models/rule_based/: rule-based detector (closest-pair distance plus rotation) and the data-cleaning rules and notebook it relies on.models/xgboost/: marimo training notebook using centered 121-frame windows of the cleaned rule-based distance and rotation features, with 70/30 holdout and full-video evaluation.model_performance_report.py: evaluation metrics for every model inoutputs/predictions/, using the functions fromevaluation/evaluate.py, plus pose-overlay clip previews of predicted spans.merged_spans_review.py: review ground-truth circling spans against the source video, with buffered pose-overlay previews (drawing functions imported frommodel_performance_report.py).
The committed model is outputs/circling_baseline/model.joblib. To retrain it (writes the
model, metrics and report to outputs/circling_baseline/):
uv run python -m models.logistic_regression.trainTo score every frame (cached in outputs/circling_baseline/scores/) and write the
predicted spans to outputs/predictions/logistic_regression/:
uv run python -m models.logistic_regression.predict [--threshold 0.5] [--min-seconds 7.5] [--min-fraction 0.9]uv run marimo edit models/rule_based/detector.py # detector and results
uv run marimo edit models/rule_based/data_cleaning.py # tracking artifacts removed firstRunning the detector (uv run python models/rule_based/detector.py, or opening it in
marimo) writes its episodes to outputs/predictions/rule_based/.
uv run marimo edit models/xgboost/notebook.pyThe notebook samples all positive centers plus nearby negative frames, trains on
70% of the sampled rows, evaluates the 30% holdout, and scores both full videos.
It writes artifacts to outputs/xgboost/ and standard prediction CSVs to
outputs/predictions/xgboost/. On macOS, run brew install libomp first.
See models/xgboost/README.md for feature and evaluation details.
feature_engineering/pair_motion/ creates a frame-level pair table. It covers
body-length-normalized distance, facing, speed and closing rate, angular movement
(orbital and heading rates, corotation), and 0.5, 1, 2 and 4 s window summaries
(close fraction, orbit turns, mean distance). It expects the four validated pose
parquets in data/; they are local inputs and are not committed.
uv run python -m feature_engineering.pair_motion.build_features --data-dir dataThe full table is written to outputs/pair_motion/ (ignored). Feature definitions,
quality checks, parameters, and a small committed sample are kept alongside the
pipeline. See feature_engineering/pair_motion/README.md.
Nothing in models/ imports these features; any model can read the parquet and use
the columns it wants (feature_groups.py lists them by group).
experiments/shared_features/ scores these features, and the existing models' feature
sets, with leave-one-video-out validation (each video held out once) using the
same evaluation/ metrics and the same outputs/predictions/<name>/ format.
uv run python -m experiments.shared_features.dataset --data-dir ~/Downloads
uv run python -m experiments.shared_features.lovo --variants allSee experiments/README.md for the protocol, variants and results.