fix(demo): pace gait windows before buffering
Make the OpenGait-studio demo drop unpaced frames before they grow the silhouette window. Separate source-frame gap tracking from paced-frame stride tracking so runtime scheduling matches the documented demo-window-and-stride behavior. Add regressions for paced window growth and schedule-frame stride semantics.
This commit is contained in:
@@ -144,6 +144,21 @@ class TestSilhouetteWindow:
|
||||
window.push(sil, frame_idx=7, track_id=1)
|
||||
assert window.should_classify()
|
||||
|
||||
def test_should_classify_uses_schedule_frame_idx(self) -> None:
|
||||
"""Stride should be measured in paced/scheduled frames, not source frames."""
|
||||
window = SilhouetteWindow(window_size=2, stride=2, gap_threshold=50)
|
||||
sil = np.ones((64, 44), dtype=np.float32)
|
||||
|
||||
window.push(sil, frame_idx=0, track_id=1, schedule_frame_idx=0)
|
||||
window.push(sil, frame_idx=10, track_id=1, schedule_frame_idx=1)
|
||||
|
||||
assert window.should_classify()
|
||||
|
||||
window.mark_classified()
|
||||
window.push(sil, frame_idx=20, track_id=1, schedule_frame_idx=2)
|
||||
|
||||
assert not window.should_classify()
|
||||
|
||||
def test_should_classify_not_ready(self) -> None:
|
||||
"""should_classify should return False when window not ready."""
|
||||
window = SilhouetteWindow(window_size=5, stride=1, gap_threshold=10)
|
||||
|
||||
Reference in New Issue
Block a user