Commit Graph

23 Commits

Author SHA1 Message Date
Levi Neuwirth f8368ca861 apply ruff format to recent commits
Pure formatter drift picked up after running ruff format across the
tree. No behavioural changes: line-length unwrapping where strings
fit on one line, one blank-line separator added to _model.py.
2026-04-18 17:49:44 -04:00
Levi Neuwirth bcce5315be add neuropose reset subcommand for pipeline-wide state wipe
Three-layer module: find_neuropose_processes() scans the process
table via psutil for running watch/serve instances; terminate_processes()
SIGINTs with a configurable grace period before optional SIGKILL
escalation; wipe_state() clears $data_dir/in/, out/, failed/,
the .neuropose.lock file, and leftover .ingest_<uuid>/ staging dirs
while preserving the container directories themselves. reset_pipeline()
composes the three and refuses to wipe while any process survives
termination.

CLI wraps it with --yes/-y, --keep-failed, --force-kill,
--grace-seconds, and --dry-run/-n. Always prints a preview before
prompting; returns EXIT_USAGE=2 when survivors block the wipe.

Unblocks the Mac benchmark iteration loop where partially-complete
runs need to be cleared between experiments.
2026-04-18 17:15:24 -04:00
Levi Neuwirth cc9fcb4adb add Procrustes alignment to analyzer
procrustes_align in neuropose.analyzer.features — Kabsch closed-form
rigid alignment between two pose sequences, with per_frame and
per_sequence modes and an optional scale flag for cross-subject
comparisons. Returns aligned arrays plus an AlignmentDiagnostics
dataclass reporting rotation magnitude (mean and max), translation
magnitude (mean and max), and scale factor, so downstream code can
flag suspiciously large transforms.

Wired into every DTW entry point via a new keyword-only align
parameter — "none" (the default) preserves the 0.1 raw-coordinate
behaviour, while "procrustes_per_frame" and "procrustes_per_sequence"
route inputs through procrustes_align before DTW runs. Rejects
mismatched frame counts when alignment is requested (Procrustes
requires a 1:1 correspondence).

Phase 0 of TECHNICAL.md: closes one of the three methodological
gaps Paper C's pipeline is waiting on.
2026-04-18 17:11:53 -04:00
Levi Neuwirth fe8e417aa0 add Provenance subobject and LoadedModel
Captures the MeTRAbs SHA-256 and filename plus tensorflow /
tensorflow-metal / numpy / neuropose / python versions, and reserves
slots for seed, deterministic, and analysis_config. Populated
automatically by Estimator.process_video when the model was loaded via
load_model; propagates into JobResults and BenchmarkResult via the
existing output path. None on the injected-model test path where no
SHA is known.

_model.load_metrabs_model now returns a LoadedModel dataclass so the
estimator can bundle the TF handle with the pinned SHA without
re-hashing the tarball on every daemon startup. All test fakes and
the integration smoke tests updated to unwrap .model.

Bumps the optional schema_version field on VideoPredictions and
BenchmarkResult to default=CURRENT_VERSION so fresh writes stamp the
latest version; legacy payloads without it are migrated on load via
the chain registered in the previous commit.
2026-04-18 17:10:52 -04:00
Levi Neuwirth 9c549fd9e2 add neuropose.migrations for schema versioning
One shared CURRENT_VERSION across the three top-level serialised
payloads (VideoPredictions, JobResults, BenchmarkResult), with
per-schema registries populated via register_*_migration(from_version)
decorators. FutureSchemaError and MigrationNotFoundError surface bad
chains clearly. CURRENT_VERSION=2 with v1→v2 migrations registered
that add an optional provenance field to the payload dicts.

Tested standalone; io.py is wired through the migrator in a follow-up
commit that introduces the Provenance schema those migrations target.
2026-04-18 17:02:50 -04:00
Levi Neuwirth 2469c34676 add TECHNICAL.md engineering roadmap
Phase 0 (C-enabling pipeline work) → Phase 1 (Paper C clinical
validation) → Phase 2 (open-source release + Paper A), with Track 2
(clinical platform) as a contingent side track. Mirrors RESEARCH.md but
for engineering scope rather than methodology.
2026-04-18 17:00:36 -04:00
Levi Neuwirth 01b9ed9475 pin tf to ensure compatability with tensorflow-metal 2026-04-16 15:26:55 -04:00
Levi Neuwirth 8e1c8833f5 tooling 2026-04-15 11:41:27 -04:00
Levi Neuwirth d29f4f1b78 benchmarking and profiling scaffold 2026-04-14 20:32:29 -04:00
Levi Neuwirth b9a5f0d54c update tests 2026-04-14 15:15:13 -04:00
Levi Neuwirth 1925558354 docs build 2026-04-14 14:31:16 -04:00
Levi Neuwirth c4c9bffff8 linting and formatting 2026-04-14 13:50:11 -04:00
Levi Neuwirth 847fdd3a2b optional tensorflow-metal for apple silicon 2026-04-14 12:51:47 -04:00
Levi Neuwirth 62d0b0789c pin tensorflow, comprehensiveness 2026-04-14 09:39:12 -04:00
Levi Neuwirth 3720911dac deployment 2026-04-13 18:08:05 -04:00
Levi Neuwirth 507ff2906a cli 2026-04-13 16:36:10 -04:00
Levi Neuwirth 27464f681a interfacer 2026-04-13 16:01:46 -04:00
Levi Neuwirth 9bbbbd0d52 estimator 2026-04-13 12:40:50 -04:00
Levi Neuwirth 3d2b2fc68d i/o scaffold 2026-04-13 12:16:53 -04:00
Levi Neuwirth 5b722d3c6a ci 2026-04-13 12:04:48 -04:00
Levi Neuwirth cd6c8d5aee dev tooling 2026-04-13 11:59:18 -04:00
Levi Neuwirth b68ab9972f init neuropose 2026-04-13 11:55:14 -04:00
Levi Neuwirth 818678eb98 Initial commit 2026-04-13 15:02:43 +00:00