radiance-nt commited on
Commit
c768a2e
·
1 Parent(s): 9bbf0b8

Make VPB public evaluation strict by default

Browse files
README.md CHANGED
@@ -65,7 +65,8 @@ Annotated semantic keyframes are converted into a canonical reference trajectory
65
 
66
  - global and terminal metrics are computed on the official `1 Hz` evaluation grid;
67
  - local direction metrics are computed directly on adjacent annotated semantic anchors;
68
- - metrics are first computed per record and then macro-averaged, preventing long videos from dominating the result.
 
69
 
70
  ### Metrics
71
 
@@ -196,15 +197,9 @@ The evaluator reports:
196
  - terminal metrics for four-bucket overall, seen merged, and unseen merged;
197
  - local direction AP for four-bucket overall, seen merged, and unseen merged.
198
 
199
- See `docs/evaluate_vlac_cut_on_vpb.md` for accepted prediction formats and complete metric definitions.
200
-
201
- ## Reference VLAC-Cut Results
202
 
203
- | Global MAE | Global PRC | Terminal Macro-F1 ↑ | Local Direction MacroAP ↑ |
204
- |---:|---:|---:|---:|
205
- | **7.3344** | **0.9230** | **73.75** | **71.01** |
206
-
207
- These values summarize the overall VPB evaluation. Terminal Macro-F1 and Local Direction MacroAP are reported in percent. Refer to the paper for per-bucket results and baseline comparisons.
208
 
209
  ## Citation
210
 
 
65
 
66
  - global and terminal metrics are computed on the official `1 Hz` evaluation grid;
67
  - local direction metrics are computed directly on adjacent annotated semantic anchors;
68
+ - global metrics are first computed per record and then averaged over metric-valid records, preventing long videos from dominating the result;
69
+ - prediction coverage is strict by default: missing curve points, terminal predictions, or local-direction anchor predictions stop evaluation unless `--allow-missing` is explicitly used for diagnostics.
70
 
71
  ### Metrics
72
 
 
197
  - terminal metrics for four-bucket overall, seen merged, and unseen merged;
198
  - local direction AP for four-bucket overall, seen merged, and unseen merged.
199
 
200
+ By default, the evaluator requires complete predictions for all selected benchmark records. Use `--allow-missing` only when you intentionally want a diagnostic report with coverage and missing-count fields.
 
 
201
 
202
+ See `docs/evaluate_vlac_cut_on_vpb.md` for accepted prediction formats and complete metric definitions.
 
 
 
 
203
 
204
  ## Citation
205
 
docs/evaluate_vlac_cut_on_vpb.md CHANGED
@@ -17,6 +17,8 @@ reconstructed from each dense video timeline:
17
  - terminal metrics: final progress threshold `90%`
18
  - local direction metrics: `AP+`, `AP-`, and `MacroAP_D` on adjacent
19
  `semantic_anchors` with `tau=0`
 
 
20
 
21
  For VLAC-Cut evaluation we feed the model frames sampled at 2Hz. This 2Hz input
22
  rate is a VLAC-Cut evaluation setting, not a benchmark-wide protocol
@@ -124,7 +126,7 @@ For each trajectory, the evaluator compares predictions against the released
124
  `dense_kinematic_progress` values at the selected 1Hz frames.
125
 
126
  - `MAE`: mean absolute error over valid points in one trajectory, then averaged
127
- equally over trajectories.
128
  - `PRC`: Spearman correlation between GT progress and predicted progress in one
129
  trajectory, then averaged equally over valid trajectories.
130
  - `VOC`: Spearman correlation between predicted progress and chronological
@@ -176,6 +178,12 @@ counts for predictions outside the nominal `[0, 100]` range. The nominal range
176
  counts are diagnostics only; predictions are not clipped unless `--clip-pred` is
177
  set.
178
 
 
 
 
 
 
 
179
  ## Quick Checks
180
 
181
  Run the evaluator self-test:
 
17
  - terminal metrics: final progress threshold `90%`
18
  - local direction metrics: `AP+`, `AP-`, and `MacroAP_D` on adjacent
19
  `semantic_anchors` with `tau=0`
20
+ - coverage requirement: complete predictions are required by default; use
21
+ `--allow-missing` only to produce a diagnostic report for incomplete runs
22
 
23
  For VLAC-Cut evaluation we feed the model frames sampled at 2Hz. This 2Hz input
24
  rate is a VLAC-Cut evaluation setting, not a benchmark-wide protocol
 
126
  `dense_kinematic_progress` values at the selected 1Hz frames.
127
 
128
  - `MAE`: mean absolute error over valid points in one trajectory, then averaged
129
+ equally over trajectories with at least one valid evaluated point.
130
  - `PRC`: Spearman correlation between GT progress and predicted progress in one
131
  trajectory, then averaged equally over valid trajectories.
132
  - `VOC`: Spearman correlation between predicted progress and chronological
 
178
  counts are diagnostics only; predictions are not clipped unless `--clip-pred` is
179
  set.
180
 
181
+ The evaluator is strict by default: if any selected trajectory lacks required
182
+ curve points, terminal predictions, or local-direction anchor predictions, the
183
+ command exits with an error before writing outputs. Add `--allow-missing` only
184
+ when debugging incomplete prediction files and intentionally writing a
185
+ diagnostic report.
186
+
187
  ## Quick Checks
188
 
189
  Run the evaluator self-test:
scripts/evaluate_vpb_predictions.py CHANGED
@@ -99,6 +99,11 @@ def parse_args() -> argparse.Namespace:
99
  action="store_true",
100
  help="Linearly interpolate missing prediction frames within each trajectory. This is not the strict default.",
101
  )
 
 
 
 
 
102
  parser.add_argument(
103
  "--self-test",
104
  action="store_true",
@@ -748,6 +753,65 @@ def build_report(
748
  }
749
 
750
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
751
  def point_ratio(item: dict[str, Any]) -> str:
752
  return f"{int(item.get('point_valid', 0))}/{int(item.get('point_base_total', 0))}"
753
 
@@ -772,9 +836,12 @@ def build_markdown(report: dict[str, Any]) -> str:
772
  lines.append(f"- sample_hz: `{config['sample_hz']}`")
773
  lines.append(f"- success_threshold: `{config['success_threshold_percent']}`")
774
  lines.append(f"- interpolate_missing: `{config['interpolate_missing']}`")
775
- lines.append("- Curve metrics are trajectory-equal means.")
 
 
776
  lines.append("- VOC is reported only for expert bucket rows.")
777
  lines.append("- Local Direction AP uses adjacent released `semantic_anchors`; predictions are linearly interpolated at anchor frames.")
 
778
  lines.append("")
779
 
780
  curve_rows: list[list[Any]] = []
@@ -988,6 +1055,7 @@ def run_self_test() -> None:
988
  assert report["curve"]["overall_4bucket"]["mae"] == 0.0
989
  assert report["terminal"]["overall_4bucket"]["tsa"] == 1.0
990
  assert report["local_direction_ap"]["overall_4bucket"]["ap_positive"] == 1.0
 
991
  print("[self-test] ok")
992
 
993
 
@@ -1029,6 +1097,7 @@ def main() -> None:
1029
  "sample_hz": float(args.sample_hz) if args.eval_points == "time_hz" else None,
1030
  "success_threshold_percent": float(args.success_threshold),
1031
  "interpolate_missing": bool(args.interpolate_missing),
 
1032
  "clip_pred": list(clip_range) if clip_range is not None else None,
1033
  }
1034
  report = build_report(
@@ -1037,6 +1106,14 @@ def main() -> None:
1037
  prediction_info=prediction_info,
1038
  config=config,
1039
  )
 
 
 
 
 
 
 
 
1040
  if args.out_json is not None:
1041
  dump_json(args.out_json, report)
1042
  if args.out_md is not None:
 
99
  action="store_true",
100
  help="Linearly interpolate missing prediction frames within each trajectory. This is not the strict default.",
101
  )
102
+ parser.add_argument(
103
+ "--allow-missing",
104
+ action="store_true",
105
+ help="Write a diagnostic report even when predictions do not cover every required evaluation point.",
106
+ )
107
  parser.add_argument(
108
  "--self-test",
109
  action="store_true",
 
753
  }
754
 
755
 
756
+ def validate_no_missing(report: dict[str, Any]) -> dict[str, Any]:
757
+ errors: list[str] = []
758
+
759
+ curve_sources = [("overall_4bucket", report["curve"]["overall_4bucket"])]
760
+ curve_sources.extend(
761
+ (bucket, item)
762
+ for bucket, item in report["curve"]["per_bucket"].items()
763
+ )
764
+ for scope, item in curve_sources:
765
+ if int(item.get("point_valid", 0)) != int(item.get("point_base_total", 0)):
766
+ errors.append(
767
+ f"curve.{scope}: point_valid={item.get('point_valid')} "
768
+ f"point_base_total={item.get('point_base_total')}"
769
+ )
770
+ if int(item.get("traj_with_valid_pred", 0)) != int(item.get("traj_base_total", 0)):
771
+ errors.append(
772
+ f"curve.{scope}: traj_with_valid_pred={item.get('traj_with_valid_pred')} "
773
+ f"traj_base_total={item.get('traj_base_total')}"
774
+ )
775
+
776
+ terminal_sources = [
777
+ ("overall_4bucket", report["terminal"]["overall_4bucket"]),
778
+ ("seen_merged", report["terminal"]["seen_merged"]),
779
+ ("unseen_merged", report["terminal"]["unseen_merged"]),
780
+ ]
781
+ terminal_sources.extend(
782
+ (bucket, item)
783
+ for bucket, item in report["terminal"]["per_bucket"].items()
784
+ )
785
+ for scope, item in terminal_sources:
786
+ if int(item.get("valid_final", 0)) != int(item.get("support", 0)) or int(item.get("missing_final", 0)) != 0:
787
+ errors.append(
788
+ f"terminal.{scope}: valid_final={item.get('valid_final')} "
789
+ f"support={item.get('support')} missing_final={item.get('missing_final')}"
790
+ )
791
+
792
+ direction_sources = [
793
+ ("overall_4bucket", report["local_direction_ap"]["overall_4bucket"]),
794
+ ("seen_merged", report["local_direction_ap"]["seen_merged"]),
795
+ ("unseen_merged", report["local_direction_ap"]["unseen_merged"]),
796
+ ]
797
+ direction_sources.extend(
798
+ (bucket, item)
799
+ for bucket, item in report["local_direction_ap"]["per_bucket"].items()
800
+ )
801
+ for scope, item in direction_sources:
802
+ if int(item.get("valid", 0)) != int(item.get("transition_total", 0)) or int(item.get("missing", 0)) != 0:
803
+ errors.append(
804
+ f"local_direction_ap.{scope}: valid={item.get('valid')} "
805
+ f"transition_total={item.get('transition_total')} missing={item.get('missing')}"
806
+ )
807
+
808
+ return {
809
+ "no_missing_check": not errors,
810
+ "error_count": len(errors),
811
+ "errors": errors,
812
+ }
813
+
814
+
815
  def point_ratio(item: dict[str, Any]) -> str:
816
  return f"{int(item.get('point_valid', 0))}/{int(item.get('point_base_total', 0))}"
817
 
 
836
  lines.append(f"- sample_hz: `{config['sample_hz']}`")
837
  lines.append(f"- success_threshold: `{config['success_threshold_percent']}`")
838
  lines.append(f"- interpolate_missing: `{config['interpolate_missing']}`")
839
+ lines.append(f"- allow_missing: `{config['allow_missing']}`")
840
+ lines.append(f"- no_missing_check: `{report['validation']['no_missing_check']}`")
841
+ lines.append("- Curve metrics are trajectory-equal means over metric-valid trajectories.")
842
  lines.append("- VOC is reported only for expert bucket rows.")
843
  lines.append("- Local Direction AP uses adjacent released `semantic_anchors`; predictions are linearly interpolated at anchor frames.")
844
+ lines.append("- By default, missing curve, terminal, or local-direction predictions stop evaluation; use `--allow-missing` only for diagnostics.")
845
  lines.append("")
846
 
847
  curve_rows: list[list[Any]] = []
 
1055
  assert report["curve"]["overall_4bucket"]["mae"] == 0.0
1056
  assert report["terminal"]["overall_4bucket"]["tsa"] == 1.0
1057
  assert report["local_direction_ap"]["overall_4bucket"]["ap_positive"] == 1.0
1058
+ assert validate_no_missing(report)["no_missing_check"] is True
1059
  print("[self-test] ok")
1060
 
1061
 
 
1097
  "sample_hz": float(args.sample_hz) if args.eval_points == "time_hz" else None,
1098
  "success_threshold_percent": float(args.success_threshold),
1099
  "interpolate_missing": bool(args.interpolate_missing),
1100
+ "allow_missing": bool(args.allow_missing),
1101
  "clip_pred": list(clip_range) if clip_range is not None else None,
1102
  }
1103
  report = build_report(
 
1106
  prediction_info=prediction_info,
1107
  config=config,
1108
  )
1109
+ report["validation"] = validate_no_missing(report)
1110
+ if not args.allow_missing and not report["validation"]["no_missing_check"]:
1111
+ preview = "\n".join(report["validation"]["errors"][:20])
1112
+ raise SystemExit(
1113
+ "Predictions do not cover every required evaluation item. "
1114
+ "Use --allow-missing only for a diagnostic report.\n"
1115
+ f"{preview}"
1116
+ )
1117
  if args.out_json is not None:
1118
  dump_json(args.out_json, report)
1119
  if args.out_md is not None: