Handle Ego4D terminal voice endpoints
This commit is contained in:
@@ -114,6 +114,25 @@ class Ego4DAVCandidateTests(unittest.TestCase):
|
||||
with self.assertRaisesRegex(ValueError, "exactly one camera wearer"):
|
||||
load_clip_segments(clip)
|
||||
|
||||
def test_bounded_official_terminal_endpoint_is_preserved_and_audited(self) -> None:
|
||||
clip = fixture_clip()
|
||||
clip["clip_end_sec"] = 8.76
|
||||
rows, _ = derive_clip_candidates(clip, split="val", config=CandidateConfig())
|
||||
offset = next(
|
||||
row for row in rows
|
||||
if row["candidate_source"] == "WEARER_OFFSET" and row["event_time"] == 8.0
|
||||
)
|
||||
self.assertAlmostEqual(
|
||||
offset["temporal_evidence"]["terminal_voice_overrun_seconds"], 0.04
|
||||
)
|
||||
|
||||
def test_large_terminal_endpoint_overrun_is_rejected(self) -> None:
|
||||
clip = fixture_clip()
|
||||
clip["clip_end_sec"] = 11.95
|
||||
clip["camera_wearer"]["voice_segments"].append(segment("wearer", 11.8, 12.2))
|
||||
with self.assertRaisesRegex(ValueError, "exceeds the audited limit"):
|
||||
derive_clip_candidates(clip, split="val", config=CandidateConfig())
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
|
||||
Reference in New Issue
Block a user