WGO Deploy Bot Cursor commited on
Commit
e9c2cd9
·
1 Parent(s): 317d0e7

Report continuous_f1 alongside mean_iou; document per-event vs run-level contract.

Browse files
Files changed (2) hide show
  1. README.md +9 -3
  2. localization/score.py +15 -1
README.md CHANGED
@@ -73,10 +73,16 @@ Return exactly `multiplicity` intervals per listed label. Echo the exact label s
73
 
74
  ## Scoring
75
 
76
- Official metrics for this task (no gold-aware snapping):
77
 
78
- - **Bound mean IoU** mean per-gold-event IoU after exact cross-label binding and within-duplicate optimal 1:1 assignment
79
- - **accuracy@0.5** / **accuracy@0.75** — fraction of gold events with IoU ≥ threshold
 
 
 
 
 
 
80
 
81
  Shipped code (this repo):
82
 
 
73
 
74
  ## Scoring
75
 
76
+ No gold-aware snapping. Report **both** layers:
77
 
78
+ | Layer | Metric | Definition |
79
+ |-------|--------|------------|
80
+ | **Per event** | **IoU** | Overlap / union of one gold interval vs its matched prediction (within-label 1:1 assignment; unmatched → 0) |
81
+ | **Run / split** | **mean IoU** | Mean of those per-event IoUs |
82
+ | **Run / split** | **continuous F1** | Same number under this protocol: when the model returns the requested multiplicities, \(N_g = N_p\), so continuous F1 \(= 2S/(N_g+N_p)\) collapses to mean IoU. Emitted as `continuous_f1` (= `mean_iou`) for consistency with free-segmentation continuous F1 |
83
+ | **Run / split** | **accuracy@0.5 / @0.75** | Fraction of gold events with IoU ≥ threshold |
84
+
85
+ **Takeaway:** IoU is the event-level unit; continuous F1 is the run-level summary of those IoUs (not a different scoring rule). Always quote both names when reporting, and keep accuracy@0.75 as the strict headline next to them.
86
 
87
  Shipped code (this repo):
88
 
localization/score.py CHANGED
@@ -212,17 +212,31 @@ def score_episode(
212
 
213
 
214
  def metrics_from_rows(rows: Sequence[dict[str, Any]]) -> dict[str, Any]:
 
 
 
 
 
 
 
 
 
 
 
215
  if not rows:
216
  return {
217
  "events": 0,
218
  "mean_iou": None,
 
219
  "accuracy_0_5": None,
220
  "accuracy_0_75": None,
221
  }
222
  ious = [float(row["iou"]) for row in rows]
 
223
  return {
224
  "events": len(rows),
225
- "mean_iou": sum(ious) / len(ious),
 
226
  "accuracy_0_5": sum(iou >= 0.5 for iou in ious) / len(ious),
227
  "accuracy_0_75": sum(iou >= 0.75 for iou in ious) / len(ious),
228
  }
 
212
 
213
 
214
  def metrics_from_rows(rows: Sequence[dict[str, Any]]) -> dict[str, Any]:
215
+ """Aggregate per-event IoUs into run-level metrics.
216
+
217
+ Reporting contract (localization given labels):
218
+ - Per event: ``iou`` on each gold event after within-label 1:1 assignment.
219
+ - Run / split: ``mean_iou`` is the mean of those per-event IoUs.
220
+ - ``continuous_f1`` is the same number under this protocol (Ng = Np when
221
+ the model returns the requested multiplicities): bound mean IoU ≡
222
+ continuous F1 under one-to-one binding. Both keys are always emitted.
223
+ - ``accuracy_0_5`` / ``accuracy_0_75``: fraction of gold events with
224
+ IoU ≥ threshold.
225
+ """
226
  if not rows:
227
  return {
228
  "events": 0,
229
  "mean_iou": None,
230
+ "continuous_f1": None,
231
  "accuracy_0_5": None,
232
  "accuracy_0_75": None,
233
  }
234
  ious = [float(row["iou"]) for row in rows]
235
+ mean_iou = sum(ious) / len(ious)
236
  return {
237
  "events": len(rows),
238
+ "mean_iou": mean_iou,
239
+ "continuous_f1": mean_iou,
240
  "accuracy_0_5": sum(iou >= 0.5 for iou in ious) / len(ious),
241
  "accuracy_0_75": sum(iou >= 0.75 for iou in ious) / len(ious),
242
  }