Match EasyCom oracle labels to EgoSpeak sampling

This commit is contained in:
Xin Wang
2026-09-07 10:22:05 +08:00
parent 70e3aaaaf6
commit 2632402a70
4 changed files with 78 additions and 46 deletions

View File

@@ -301,7 +301,7 @@ def _load_validated_payload(
if oracle_analysis:
if (
dataset != "easycom"
or config.get("causal_policy") != "fully-observed-half-open-5hz-bins"
or config.get("causal_policy") != "egospeak-right-edge-current-state"
or config.get("uses_speech_labels") is not True
or config.get("oracle_analysis") is not True
):
@@ -441,13 +441,21 @@ def load_frame_set_features(
if len(frame_times) and float(frame_times[-1]) > float(times[-1]) + 1e-8:
raise ValueError(f"Person frame timeline extends beyond the reference: {path}")
# Match the sidecar's half-open policy: a frame stamped exactly at the
# state cutoff is not yet part of that state's observed prefix.
row_to_frame = torch.searchsorted(frame_times, times, right=False) - 1
# Normal visual observations must be strictly earlier than the cutoff.
# Oracle speech state is defined and sampled at the cutoff itself, so its
# explicit analysis-only format uses an inclusive current-state lookup.
row_to_frame = torch.searchsorted(
frame_times,
times,
right=oracle_analysis,
) - 1
chosen = torch.full(times.shape, float("nan"), dtype=torch.float64)
has_frame = row_to_frame >= 0
chosen[has_frame] = frame_times[row_to_frame[has_frame]]
if bool((chosen[has_frame] >= times[has_frame]).any()):
if oracle_analysis:
if bool((chosen[has_frame] > times[has_frame]).any()):
raise ValueError(f"Oracle person mapping selected future evidence: {path}")
elif bool((chosen[has_frame] >= times[has_frame]).any()):
raise ValueError(f"Person frame mapping selected future visual evidence: {path}")
previous_observation = None
if track_max_gap_seconds is not None: