Skip to content

fix: follow the animal in batch pose; keep foreign recordings out of Session Review - #240

Merged
gbradham merged 2 commits into
mainfrom
fix/review-foreign-recording
Nov 3, 2026
Merged

gbradham merged 2 commits into
mainfrom
fix/review-foreign-recording

Conversation

@gbradham

@gbradham gbradham commented Nov 2, 2026

Copy link
Copy Markdown
Member

Two fixes found on a batch of rat novel-object sessions (JP01–JP08).

Batch pose followed the objects, not the rat

The rat model also scores each dish in the arena as a small rat (~45 px skeleton vs ~220 px). The single-animal path kept the most confident detection, so the track sat on a dish until the rat was placed and jumped to one whenever it outscored the rat.

  • infer_video keeps every ranked candidate per frame and, once the animal's typical span is measured from the run (90th percentile of the widest skeleton per frame), prefers a candidate at least 40% of it (min_body_fraction, default 0.4; None restores the old ranking). A re-ranking, never a filter.
  • run_batch blanks frames left with only an undersized skeleton; _raw keeps them (written only when something was blanked), and the sidecar records a body_size block.
  • New pure-numpy module glider.vision.pose.body_size.

Real re-run of JP07 with rat-1.pt: rat frames 15,513 → 17,246, dish frames 4,690 → 21, jumps >100 px 254 → 0.

Session Review clamped videos to a stray recording's length

A Downloads folder holding an unrelated live recording (54 s) beside the tracked videos attached it to every video, so 11-minute sessions could only be scrubbed for 54 s. recording_filmed() rules out a recording whose own video is a different one; used by Session Review and cohort discovery. Recordings with no video, or sessions with none, behave as before.

Tests

  • New: tests/unit/vision/pose/test_body_size.py, two cohort tests.
  • Full unit suite: 6,425 passed. test_flow_clock::test_the_timing_thread_wakes_within_a_couple_of_ms also fails on main; test_delay_node_precision failed once under GPU load and passes alone.
  • ruff and black clean.

🤖 Generated with Claude Code

A folder holding a stray live recording beside tracked videos lent every one
of them that recording's timeline, so an 11-minute video could be scrubbed for
only the stray's 54 seconds. recording_filmed() rules out a recording whose own
video is a different one; Session Review and cohort discovery both use it.
A rat model over a novel-object arena scores each dish as a small rat, and the
single-animal path kept the most confident detection, so the track sat on a
dish before the rat was placed and jumped to one whenever it outscored the rat.
infer_video now keeps every candidate and, once the animal's typical span is
measured from the run, prefers one at least 40% of it. run_batch blanks frames
left with only an undersized skeleton, keeping them in _raw, and the sidecar
records the body_size block.
@gbradham
gbradham merged commit 8792a18 into main Nov 3, 2026
4 checks passed
@gbradham
gbradham deleted the fix/review-foreign-recording branch November 3, 2026 19:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant