Spaces:
Running
Running
physiq UI update
Browse files- PHYSIQ_FRONTEND_INTEGRATION_REPORT.md +69 -132
- app.py +6 -3
- docs/ADDING_EVALUATION_METRICS.md +46 -244
- physiq_frontend_regression.py +18 -1
- src/display/leaderboard.py +3 -0
- src/display/table_layout.py +7 -2
- src/tasks/physiq_display.py +15 -4
- vg_rank_history_browser_regression.py +18 -7
PHYSIQ_FRONTEND_INTEGRATION_REPORT.md
CHANGED
|
@@ -1,136 +1,73 @@
|
|
| 1 |
-
# PhysIQ
|
| 2 |
|
| 3 |
-
|
| 4 |
-
Worker edits, manifest edits, commits or scoring changes.
|
| 5 |
|
| 6 |
-
##
|
| 7 |
|
| 8 |
-
|
| 9 |
-
`ada421f`, `264d9d9`, `361c9fd`. The new metric is **three separate Physics-IQ
|
| 10 |
-
motion-overlap components**, not one composite score:
|
| 11 |
-
|
| 12 |
-
| Exact emitted key | Visible label | Direction / range |
|
| 13 |
| --- | --- | --- |
|
| 14 |
-
| `PhysIQ/Spatial-IoU` | PhysIQ Spatial IoU |
|
| 15 |
-
| `PhysIQ/SpatioTemporal-IoU` | PhysIQ Spatiotemporal IoU |
|
| 16 |
-
| `PhysIQ/Weighted-Spatial-Iou` | PhysIQ Weighted Spatial IoU |
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
|
| 58 |
-
|
| 59 |
-
|
| 60 |
-
|
| 61 |
-
|
| 62 |
-
|
| 63 |
-
|
| 64 |
-
|
| 65 |
-
-
|
| 66 |
-
|
| 67 |
-
-
|
| 68 |
-
|
| 69 |
-
-
|
| 70 |
-
|
| 71 |
-
|
| 72 |
-
|
| 73 |
-
-
|
| 74 |
-
|
| 75 |
-
-
|
| 76 |
-
|
| 77 |
-
|
| 78 |
-
|
| 79 |
-
|
| 80 |
-
All fixtures were local and synthetic. Browser tests blocked external URLs and
|
| 81 |
-
used an isolated Chrome profile; no production tasks or GPU scoring were run.
|
| 82 |
-
|
| 83 |
-
| Check | Result |
|
| 84 |
-
| --- | --- |
|
| 85 |
-
| `physiq_frontend_regression.py` | 5/5 PASS |
|
| 86 |
-
| `frontend_labels_refresh_regression.py` | 12/12 PASS |
|
| 87 |
-
| `identity_history_regression.py` | 21/21 PASS |
|
| 88 |
-
| `publication_order_regression.py` | 25/25 PASS |
|
| 89 |
-
| `traceability_regression.py` | 34/34 PASS |
|
| 90 |
-
| `vg_selection_regression.py` | 9/9 PASS |
|
| 91 |
-
| `vg_rank_history_browser_regression.py` | PASS: PhysIQ raw precision/ties/zero/missing/reverse ranking/highlight/manual response refresh; actual old/new History zero/blank/finite cells; existing PMF/SSIM/LPIPS tests |
|
| 92 |
-
| Browser responsive History | 13 tables × 5 viewports (1920/1440/1280/768/390): one horizontal scroll owner, final column reachable, no page overflow; light/dark active header assertions PASS |
|
| 93 |
-
| `frontend_rank_history_regression.py` | 4/5 PASS; existing VG manifest equality check fails (see below) |
|
| 94 |
-
| `optional_novel_regression.py` | 7/8 PASS with explicit NODE_BINARY; existing minimal Node DOM mock lacks MutationObserver (see below) |
|
| 95 |
-
| `staging_regression.py` | Full run: 16 tests, 3 subtest failures and 1 error; reasons below, not an all-green suite |
|
| 96 |
-
| Isolated all-track submission/History/publication staging check | PASS for all seven tasks, rerunning the existing test with only its temporary synthetic 7-day allowance set to 100 in memory; no source/config files changed |
|
| 97 |
-
| `git diff --check` | PASS (only Windows line-ending informational warnings) |
|
| 98 |
-
|
| 99 |
-
Existing limitations were not silently changed:
|
| 100 |
-
|
| 101 |
-
1. Worker `361c9fd` changed VG manifests without changing evaluator selection JSON.
|
| 102 |
-
Full manifests contain 15,411 scene IDs versus 15,173 selected IDs; Mini
|
| 103 |
-
manifests contain 801 versus 683. The preexisting exact-set comparison fails
|
| 104 |
-
on the current checked-out Worker. No touched file changes either input. This
|
| 105 |
-
needs collaborator review before treating the latest VG input contract as
|
| 106 |
-
consistent; not a PhysIQ display failure.
|
| 107 |
-
2. The optional-novel Node-only test's old DOM mock fails with
|
| 108 |
-
`ReferenceError: MutationObserver is not defined`. Repeating it using the
|
| 109 |
-
**unmodified HEAD** `public_table_js` reproduces the same failure. Its other
|
| 110 |
-
seven checks pass. Real Chrome tests cover both sort directions, missing-last,
|
| 111 |
-
precision and refresh successfully. No unrelated harness refactor was made.
|
| 112 |
-
3. Full staging encounters three fixture/contract problems outside PhysIQ:
|
| 113 |
-
its all-track loop raises the 24-hour allowance but not the 7-day allowance,
|
| 114 |
-
so after ten synthetic submissions the MT/FP subtests hit `orcid_7d (10/10)`;
|
| 115 |
-
its Worker aggregation fixture supplies only primary/overall-error rather
|
| 116 |
-
than Future Prediction's mandatory complete training metrics; and the
|
| 117 |
-
existing FP manifest says `primary_metric=pmf` while both plugins use
|
| 118 |
-
`pmf_novel`. None of those inputs or mechanisms was changed here. The focused
|
| 119 |
-
PhysIQ tests execute the real extracted aggregators with complete FP fixture
|
| 120 |
-
metrics and confirm that the fixed-key aggregator drops PhysIQ.
|
| 121 |
-
Rerunning the all-track submission/History/publication test with an in-memory
|
| 122 |
-
temporary `ORCID_EVALUATIONS_7D=100` passes all seven tracks, confirming that
|
| 123 |
-
its quota failures do not originate in the metric display integration.
|
| 124 |
-
|
| 125 |
-
## Recommendation
|
| 126 |
-
|
| 127 |
-
**GO for this Frontend-only, optional-metric display change** for the confirmed
|
| 128 |
-
VG/MT/Properties output contract. It does not require Worker restart or score
|
| 129 |
-
migration. Normal Frontend deployment still interrupts its own browser sessions;
|
| 130 |
-
refresh those sessions after deployment. No deployment was performed here.
|
| 131 |
-
|
| 132 |
-
**Not an unconditional end-to-end VG release approval:** the already-present
|
| 133 |
-
manifest/selection mismatch must be reviewed separately. **NO-GO for claiming
|
| 134 |
-
Future Prediction PhysIQ support** until an approved Worker aggregation extension
|
| 135 |
-
preserves its final keys and defines optional-novel coverage. No workaround or
|
| 136 |
-
Worker change is included in this task.
|
|
|
|
| 1 |
+
# PhysIQ 表头简化及 Future Prediction 调查
|
| 2 |
|
| 3 |
+
2026-10-25;仅本地 Frontend / 文档 / 测试修改,Worker HEAD 为 `361c9fd`。
|
|
|
|
| 4 |
|
| 5 |
+
## 显示名称
|
| 6 |
|
| 7 |
+
| 精确内部 key(未修改) | 原显示名 | 新显示名 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8 |
| --- | --- | --- |
|
| 9 |
+
| `PhysIQ/Spatial-IoU` | PhysIQ Spatial IoU | SP IoU |
|
| 10 |
+
| `PhysIQ/SpatioTemporal-IoU` | PhysIQ Spatiotemporal IoU | ST IoU |
|
| 11 |
+
| `PhysIQ/Weighted-Spatial-Iou` | PhysIQ Weighted Spatial IoU | WS IoU |
|
| 12 |
+
|
| 13 |
+
[原论文](https://arxiv.org/html/2501.09038v1)和
|
| 14 |
+
[官方实现](https://github.com/google-deepmind/physics-IQ-benchmark/blob/main/physiq/calculate_and_write_metrics_to_csv.py)
|
| 15 |
+
使用完整术语;未发现这三个紧凑名称是官方统一缩写,故明确将 SP/ST/WS 作为本项目 UI 简称。
|
| 16 |
+
完整名称与含义放在主榜 / History 表头 Tooltip 和指标说明中。
|
| 17 |
+
Properties 加 `NV`(Novel View)、`RI`(Reinitialized Rendering)前缀,最长表头 9 字符。
|
| 18 |
+
主榜、History 和公共报告共享同一名称映射,位置仍在旧指标之后。
|
| 19 |
+
原 key、数值、聚合、三位小数、排序方向、动态 RANK、选中高亮和缺失留空规则不变。
|
| 20 |
+
|
| 21 |
+
## Future Prediction:适用,但最终聚合丢字段
|
| 22 |
+
|
| 23 |
+
### 已确认的源码事实
|
| 24 |
+
|
| 25 |
+
1. VG 四个 Plugin、Motion Transfer、Properties 和 Future Prediction 均调用
|
| 26 |
+
`Worker/src/tasks/_utils/image_metrics.py::evaluate_camera_metrics`,实际已计算三个分量。
|
| 27 |
+
2. FP `src/tasks/task_future_prediction/__init__.py::_submitted_targets` / `_test_frames_by_camera`
|
| 28 |
+
根据 GT 的 `transforms_train/val/test.json` 确定训练 / 新视角及对应测试帧,要求预测有对应 RGB。
|
| 29 |
+
`evaluate_scene` 按同一相机、同一帧名配对;公共相机函数按帧号排序并检查帧数、对齐尺寸。
|
| 30 |
+
3. `physiq.py::_iter_motion_masks` 从 RGB 在线生成背景差分运动 Mask,不需要用户或 GT 另交 Mask。
|
| 31 |
+
核心要求 `[1,F,3,H,W]`、至少两帧、两段视频对齐;与 VG 使用的是同一计算函数。
|
| 32 |
+
FP 使用静态训练 / 新视角,不评估 `CineCamera_Moving`,不存在因此不能计算的问题。
|
| 33 |
+
4. FP `_average_metrics` 保留全部相机 key;`evaluate_scene` 生成
|
| 34 |
+
`PhysIQ/Spatial-IoU_train`、`PhysIQ/Spatial-IoU_novel` 等六项,并进入 Case Progress。
|
| 35 |
+
5. 但 `aggregate_metrics` 只遍历 `psnr/ssim/lpips/pmf`,丢弃 PhysIQ。
|
| 36 |
+
Terminal / History 保存的是聚合结果,因此**仅补 Frontend 列不能显示实际最终分数**。
|
| 37 |
+
提取执行真实聚合函数的隔离测试也确认了这一点。
|
| 38 |
+
|
| 39 |
+
因此:不是 FP 不适用,也不是没有计算;是已计算的指标尚未打通最终输出。
|
| 40 |
+
这次只检查源码和隔离数据,没有检查生产提交的真实图片或保证所有具体提交内容均有效。
|
| 41 |
+
这些分量衡量选定帧段的运动一致性;不等于重新执行原论文完整数据集、物理方差标定或综合得分协议。
|
| 42 |
+
|
| 43 |
+
### 最小补齐方案(仅建议,未实施)
|
| 44 |
+
|
| 45 |
+
- Worker `aggregate_metrics` 为三个新分量增加独立的 train / novel 聚合组,按已有 Case 等权均值、六位小数输出。
|
| 46 |
+
- 保持旧四项的强制完整性检查不变;不要把新项直接塞进旧必填列表,否则恢复旧 Progress 可能导致原本有效任务失败。
|
| 47 |
+
- 新项仅在对应组所有成功 Case 都有有限数值时输出,否则该组为 None;缺失 novel 仍为空。
|
| 48 |
+
`evaluate_scene` 可同步初始化 novel 的三个新 key 为 None,统一 Case 输出契约。
|
| 49 |
+
- Frontend 再声明六个精确的带后缀 key、短标签、方向和历史可选列;不从 Progress 计算替代成绩。
|
| 50 |
+
- 无需改 Manifest 的 Case 集、图像读取、Mask 算法或主指标;旧记录不回填、不重算。
|
| 51 |
+
- 当前 Worker 已在 FP 每次评分时执行 PhysIQ,故补聚合本身不增加图像下载或 GPU 计算,只有少量数值归约和 JSON 字段开销。
|
| 52 |
+
Mask 计算现有依赖是 Torch,`FRAME_CHUNK_SIZE=64`、默认降采样 4;不需要新增模型或第三方 Mask 服务。
|
| 53 |
+
未运行 GPU 基准,不能给出实测耗时;历史 Worker 版本若尚未计算则另当别论。
|
| 54 |
+
|
| 55 |
+
**以上 Worker 修改需另行授权,本次未实现;FP 前端列保持不添加。**
|
| 56 |
+
|
| 57 |
+
## 修改文件
|
| 58 |
+
|
| 59 |
+
- `src/tasks/physiq_display.py`:短名称、完整解释、NV/RI 映射。
|
| 60 |
+
- `src/display/leaderboard.py::render_leaderboard`:主榜完整表头提示。
|
| 61 |
+
- `src/display/table_layout.py::table_resize_js`:短名称识别,History 共用提示和原数值格式。
|
| 62 |
+
- `app.py::_property_novel_columns` / `_property_reinit_columns`:按原 key 前缀选择列,不再依赖旧长标签;更新简称说明。
|
| 63 |
+
- `docs/ADDING_EVALUATION_METRICS.md`:重写为中文速查表,分 Worker / Frontend,保留最小测试与历史兼容说明。
|
| 64 |
+
- `physiq_frontend_regression.py`、`vg_rank_history_browser_regression.py`:更新名称断言及完整 Tooltip / 紧凑表头检查。
|
| 65 |
+
|
| 66 |
+
## 本次验证
|
| 67 |
+
|
| 68 |
+
- PhysIQ 专项:6/6 通过;前端标签 / 刷新:12/12 通过;VG 选择器:9/9 通过。
|
| 69 |
+
- 原有排名 / 原始精度 / 物理参数排序展示检查:4/4 通过;身份 / History 回归:21/21 通过。
|
| 70 |
+
- 浏览器:三个简称、表头完整提示、SP/ST 选择、原始精度 / 同分、零值、缺失项正反排序、动态 RANK、高亮和实际手动刷新通过。
|
| 71 |
+
- 主榜 / History 紧凑表头及零分 / 历史空白单元格通过;13 张 History 表 × 5 个窗口宽度滚动检查通过。
|
| 72 |
+
- 本次不重复执行此前已定位失败的 VG manifest 一致性检查或旧 Node 模拟器检查;不声称全仓回归全绿。
|
| 73 |
+
- 未修改 Worker、评分公式、生产记录;未部署、��启、重算、推送或提交 Git commit。
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app.py
CHANGED
|
@@ -236,7 +236,8 @@ def _property_novel_columns() -> list[str]:
|
|
| 236 |
"Novel PSNR",
|
| 237 |
"Novel SSIM",
|
| 238 |
"Novel LPIPS",
|
| 239 |
-
*[
|
|
|
|
| 240 |
"Scenes",
|
| 241 |
"Updated At",
|
| 242 |
"Submission",
|
|
@@ -252,7 +253,8 @@ def _property_reinit_columns() -> list[str]:
|
|
| 252 |
"Reinit PSNR",
|
| 253 |
"Reinit SSIM",
|
| 254 |
"Reinit LPIPS",
|
| 255 |
-
*[
|
|
|
|
| 256 |
"Scenes",
|
| 257 |
"Updated At",
|
| 258 |
"Submission",
|
|
@@ -1033,7 +1035,8 @@ def _render_subtask(task_name: str) -> list:
|
|
| 1033 |
with gr.Accordion("About this track & metrics", open=False, elem_classes="info-panel metric-guide utility-panel"):
|
| 1034 |
gr.Markdown(spec.description)
|
| 1035 |
if getattr(spec, "optional_metric_columns", ()):
|
| 1036 |
-
gr.Markdown("**PhysIQ:**
|
|
|
|
| 1037 |
"are separate motion-mask overlap metrics in [0, 1] (higher is better), "
|
| 1038 |
"not a composite Physics-IQ score. Older results without them are blank.")
|
| 1039 |
primary = getattr(spec, 'column_display_names', {}).get(spec.primary_metric, spec.primary_metric)
|
|
|
|
| 236 |
"Novel PSNR",
|
| 237 |
"Novel SSIM",
|
| 238 |
"Novel LPIPS",
|
| 239 |
+
*[TASKS["propertyEstimation"].column_display_names[key]
|
| 240 |
+
for key in TASKS["propertyEstimation"].optional_metric_columns if key.startswith("novel_")],
|
| 241 |
"Scenes",
|
| 242 |
"Updated At",
|
| 243 |
"Submission",
|
|
|
|
| 253 |
"Reinit PSNR",
|
| 254 |
"Reinit SSIM",
|
| 255 |
"Reinit LPIPS",
|
| 256 |
+
*[TASKS["propertyEstimation"].column_display_names[key]
|
| 257 |
+
for key in TASKS["propertyEstimation"].optional_metric_columns if key.startswith("reinit_")],
|
| 258 |
"Scenes",
|
| 259 |
"Updated At",
|
| 260 |
"Submission",
|
|
|
|
| 1035 |
with gr.Accordion("About this track & metrics", open=False, elem_classes="info-panel metric-guide utility-panel"):
|
| 1036 |
gr.Markdown(spec.description)
|
| 1037 |
if getattr(spec, "optional_metric_columns", ()):
|
| 1038 |
+
gr.Markdown("**PhysIQ:** SP IoU = Spatial IoU; ST IoU = Spatiotemporal IoU; "
|
| 1039 |
+
"WS IoU = Weighted Spatial IoU. NV = Novel View; RI = Reinitialized Rendering. These "
|
| 1040 |
"are separate motion-mask overlap metrics in [0, 1] (higher is better), "
|
| 1041 |
"not a composite Physics-IQ score. Older results without them are blank.")
|
| 1042 |
primary = getattr(spec, 'column_display_names', {}).get(spec.primary_metric, spec.primary_metric)
|
docs/ADDING_EVALUATION_METRICS.md
CHANGED
|
@@ -1,265 +1,67 @@
|
|
| 1 |
-
#
|
| 2 |
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
repository; other paths are relative to this Frontend repository. Never use
|
| 6 |
-
production records as writable test fixtures.
|
| 7 |
|
| 8 |
-
##
|
| 9 |
|
| 10 |
-
|
| 11 |
-
loads aligned frames, computes PSNR/SSIM/LPIPS, PMF, and the three PhysIQ IoUs.
|
| 12 |
-
`Worker/src/tasks/_utils/physiq.py::_compute_physiq_score` (also exported as
|
| 13 |
-
`_compute_physiq_metrics`) returns Python scalars from `compute_physiq_iou_tensors`.
|
| 14 |
-
Camera performance JSONL also includes the camera's metric dictionary; this is
|
| 15 |
-
not the source from which the Frontend computes submission scores.
|
| 16 |
-
2. **Case assembly:** VG `Worker/src/tasks/video_generation/utils.py::evaluate_scene`
|
| 17 |
-
and Motion Transfer `Worker/src/tasks/motion_transfer/utils.py::evaluate_scene`
|
| 18 |
-
average every returned key across selected cameras and round to six decimals.
|
| 19 |
-
Properties `rendering_utils.py::evaluate_image_scene` does the same; its task
|
| 20 |
-
`__init__.py::evaluate_scene` prefixes each rendering key with `novel_` or
|
| 21 |
-
`reinit_`. Future Prediction `task_future_prediction/__init__.py::evaluate_scene`
|
| 22 |
-
prefixes camera-average keys with `_train` / `_novel` suffixes.
|
| 23 |
-
3. **Progress:** `Worker/src/worker/runner.py::_add_scene_result` writes the entire
|
| 24 |
-
Case dictionary to `scene_results[scene_id].metrics` in
|
| 25 |
-
`/data/queue/progress/<submission_id>.json`. Preflight validation is not scoring.
|
| 26 |
-
4. **Submission aggregation:** `runner.py::_process_submission` calls
|
| 27 |
-
`task.aggregate(per_scene_metrics)` once all required Cases succeed. The
|
| 28 |
-
`TaskPlugin.aggregate` wrapper and `_default_aggregate` are in
|
| 29 |
-
`Worker/src/tasks/base.py`. Default aggregation is an arithmetic mean per key
|
| 30 |
-
over Cases supplying it, rounded to six decimals, not a frame-weighted mean.
|
| 31 |
-
Properties uses `parameter_utils.py::aggregate_parameter_metrics`, which also
|
| 32 |
-
emits count and population-standard-deviation fields per key.
|
| 33 |
-
Future Prediction has a **fixed-key custom aggregator**; see the warning below.
|
| 34 |
-
5. **Terminal and History:** `Worker/src/worker/lease.py::finalize` receives `metrics=agg`
|
| 35 |
-
and `score=agg.get(task.primary_metric)`. `runner.py::_append_history` includes
|
| 36 |
-
the complete `metrics` field via `_HISTORY_FIELDS`, calling
|
| 37 |
-
`Worker/src/storage/local.py::append_history`. Use `complete_path`,
|
| 38 |
-
`progress_path`, `history_path` and the history APIs, not guessed filenames;
|
| 39 |
-
History storage is sharded and legacy formats remain supported.
|
| 40 |
-
A failed submission can have Case metrics in Progress but no aggregate metrics.
|
| 41 |
-
6. **Frontend read:** `src/leaderboard/read_evals.py::load_task_leaderboard` combines
|
| 42 |
-
published History entries and supported legacy results; it does not publish
|
| 43 |
-
every successful submission. `load_task_history` reads the owner's terminal
|
| 44 |
-
records. `src/storage/local.py` handles result/History files. Both readers use
|
| 45 |
-
`_display_col_name` and `_format_metric_cell`.
|
| 46 |
-
7. **Presentation:** `src/display/leaderboard.py::render_leaderboard` renders public
|
| 47 |
-
HTML. `public_table_js` handles local sorting, dynamic rank, active headers and
|
| 48 |
-
refresh-state preservation. History uses Gradio Dataframes through
|
| 49 |
-
`app.py::_dataframe`; `src/display/table_layout.py::table_resize_js` provides
|
| 50 |
-
three-decimal formatting and resizable widths. Properties has separate novel,
|
| 51 |
-
reinit and material views in `app.py`, so its projection helpers also matter.
|
| 52 |
-
`src/submission/public_metrics.py` controls public report/detail metric groups.
|
| 53 |
-
|
| 54 |
-
## B. Worker changes: required versus conditional
|
| 55 |
-
|
| 56 |
-
Required for a genuinely new metric:
|
| 57 |
-
|
| 58 |
-
- Implement/import the computation, emit a stable numeric output key, and test
|
| 59 |
-
known inputs, zero, non-finite/error handling, CPU/GPU behavior and determinism.
|
| 60 |
-
- Ensure each intended task returns the key from its Case evaluator. Calling a
|
| 61 |
-
shared camera function alone is not proof that the submission saves the key.
|
| 62 |
-
- Inspect `aggregate_fn`: an open-key mean propagates added keys automatically;
|
| 63 |
-
a fixed whitelist needs explicit approved changes. Specify missing-Case policy,
|
| 64 |
-
split coverage, averaging weights, precision, units and metric direction.
|
| 65 |
-
- Verify a synthetic Case's Progress, aggregate, terminal `metrics`, and History.
|
| 66 |
-
Do not change the primary metric merely to add an auxiliary column.
|
| 67 |
-
|
| 68 |
-
Conditional:
|
| 69 |
-
|
| 70 |
-
- Update task `leaderboard_columns` and metadata when the Worker uses them as an
|
| 71 |
-
output/display contract. Current Worker PhysIQ computation emits keys despite
|
| 72 |
-
those lists still declaring only the older metrics.
|
| 73 |
-
- Update manifests only if they actually encode the changed contract/input
|
| 74 |
-
protocol. Current manifests are not a metric-direction registration mechanism;
|
| 75 |
-
adding a display column does not require changing Cases, task names or track IDs.
|
| 76 |
-
- Serialization changes are not required for an ordinary scalar key already
|
| 77 |
-
carried in `metrics`; top-level allowlists only need changes for new top-level
|
| 78 |
-
fields (outside this integration's scope).
|
| 79 |
-
- Review provenance/config versions and fair comparison policy if the metric
|
| 80 |
-
changes rather than merely becoming visible. Do not mix resumed old/new Case
|
| 81 |
-
definitions and silently claim complete coverage.
|
| 82 |
-
|
| 83 |
-
### Confirmed PhysIQ contract and coverage
|
| 84 |
-
|
| 85 |
-
The latest audited Worker is `361c9fd`; `ada421f` added computation, `264d9d9`
|
| 86 |
-
renamed its output keys. **It does not implement a single composite Physics-IQ
|
| 87 |
-
score.** Preserve the exact spelling/capitalization of the recorded keys:
|
| 88 |
-
|
| 89 |
-
| Camera / VG / MT key | Frontend label | Meaning |
|
| 90 |
| --- | --- | --- |
|
| 91 |
-
| `
|
| 92 |
-
| `
|
| 93 |
-
| `
|
| 94 |
-
|
| 95 |
-
|
| 96 |
-
|
| 97 |
-
inference, configurable crop/resize, default `DOWNSAMPLE_FACTOR=4`, and streaming
|
| 98 |
-
mask chunks. This frontend integration does not alter geometry or algorithms.
|
| 99 |
-
|
| 100 |
-
- **VG:** all four static/moving × full/mini tracks save all three keys.
|
| 101 |
-
- **Motion Transfer:** saves all three keys, same camera-mean and Case-mean path.
|
| 102 |
-
- **Properties:** saves `novel_<key>` and `reinit_<key>` (six components), plus the
|
| 103 |
-
existing aggregator's `_count`/`_std` fields. Display the six recorded means, not
|
| 104 |
-
a frontend-created combined score. No PhysIQ parameter-estimation metric exists.
|
| 105 |
-
- **Future Prediction:** camera/Case results contain suffixed keys, but
|
| 106 |
-
`aggregate_metrics` explicitly iterates only `psnr`, `ssim`, `lpips`, `pmf`.
|
| 107 |
-
**PhysIQ is dropped before terminal/History. No column is enabled for this task.**
|
| 108 |
-
Extending that aggregator and its optional-novel coverage rules requires a
|
| 109 |
-
separate Worker change/approval, not a frontend substitution from Progress.
|
| 110 |
-
|
| 111 |
-
## C. Frontend extension points
|
| 112 |
-
|
| 113 |
-
### Declaration, label, order and missing values
|
| 114 |
-
|
| 115 |
-
For existing tasks, metadata lives in `src/tasks/<task>/__init__.py`; the registry
|
| 116 |
-
is `src/tasks/__init__.py`. This integration centralizes optional PhysIQ additions
|
| 117 |
-
in `src/tasks/physiq_display.py::register_physiq_display`, called once per registered
|
| 118 |
-
task. Its actual structures are:
|
| 119 |
-
|
| 120 |
-
```python
|
| 121 |
-
PHYSIQ_LABELS = {
|
| 122 |
-
"PhysIQ/Spatial-IoU": "PhysIQ Spatial IoU",
|
| 123 |
-
"PhysIQ/SpatioTemporal-IoU": "PhysIQ Spatiotemporal IoU",
|
| 124 |
-
"PhysIQ/Weighted-Spatial-Iou": "PhysIQ Weighted Spatial IoU",
|
| 125 |
-
}
|
| 126 |
-
```
|
| 127 |
-
|
| 128 |
-
`register_physiq_display` appends supported keys to `task.leaderboard_columns`
|
| 129 |
-
without duplicates and sets `column_display_names`, `metric_directions` (raw key
|
| 130 |
-
to bool, True means higher) and `optional_metric_columns`. These are Frontend
|
| 131 |
-
presentation attributes, not persisted schema fields or new Worker APIs.
|
| 132 |
-
|
| 133 |
-
For another optional metric, declare its exact emitted keys, labels, direction
|
| 134 |
-
and order on the relevant Frontend task. Reuse these attributes rather than
|
| 135 |
-
extending PhysIQ coverage to tasks that do not save it. The existing primary
|
| 136 |
-
column is still promoted first by the reader. Appended metrics appear after all
|
| 137 |
-
previous metrics, before non-metric metadata columns.
|
| 138 |
-
|
| 139 |
-
`_format_metric_cell` validates declared optional values as finite numbers,
|
| 140 |
-
rejecting bool, malformed objects and NaN/Infinity without changing stored data.
|
| 141 |
-
`load_task_history` converts their missing values to empty cells. Public rendering
|
| 142 |
-
uses the DataFrame `optional_metric_columns` attrs for blank presentation; other
|
| 143 |
-
metrics retain their previous missing-value policy. No range clamping or invented
|
| 144 |
-
substitute score is performed.
|
| 145 |
-
|
| 146 |
-
### Numeric sorting, dynamic RANK, highlighting, refresh
|
| 147 |
-
|
| 148 |
-
`load_task_leaderboard` provides:
|
| 149 |
-
|
| 150 |
-
- `metric_sort_values`: original recorded numbers, keyed by submission (or legacy
|
| 151 |
-
Team/Method tuple), not rounded display text.
|
| 152 |
-
- `metric_directions`: visible column label to higher-is-better bool, with explicit
|
| 153 |
-
task declarations overriding the old metric-name heuristics.
|
| 154 |
-
- `submission_times`: existing stable tie-break inputs.
|
| 155 |
|
| 156 |
-
|
| 157 |
-
`data-rank-direction` and cells' `data-sort`. `public_table_js::rankTable` ranks
|
| 158 |
-
finite values with stable submission-time/ID ties, marks the selected header
|
| 159 |
-
`ranking-metric`, leaves missing values last under both sort directions, and
|
| 160 |
-
shows `-` ranks if the selected metric has no valid values. Refresh preserves the
|
| 161 |
-
selected metric through existing component state. **No new JS sorting engine or
|
| 162 |
-
server ranking change is needed.** Keep attrs when projecting DataFrames.
|
| 163 |
|
| 164 |
-
|
| 165 |
|
| 166 |
-
|
| 167 |
-
|
| 168 |
-
|
| 169 |
-
|
| 170 |
-
-
|
| 171 |
-
`app.py::_property_novel_columns` / `_property_reinit_columns` to include the
|
| 172 |
-
matching optional labels after LPIPS, used by both leaderboard and History.
|
| 173 |
-
Do not put rendering metrics into material tables.
|
| 174 |
-
- Public metric widths are existing 180px (260px for parameter tables). History
|
| 175 |
-
uses `column_width`/`initialWidthFor` and the existing single scroll owner.
|
| 176 |
-
`table_resize_js` recognizes `PhysIQ` for metric formatting/direction badges.
|
| 177 |
-
Adding a long name alone does not justify globally changing every column width.
|
| 178 |
-
- Track notes describe the three components only for supported tasks. Queue
|
| 179 |
-
remains unchanged because it does not display the full metric set.
|
| 180 |
-
|
| 181 |
-
## D. Backward compatibility
|
| 182 |
|
| 183 |
-
|
| 184 |
-
|
| 185 |
-
|
| 186 |
-
| `0` | `0.000`, a valid sortable/rankable value |
|
| 187 |
-
| Absent / None | Empty metric cell; no invented zero; missing rank `-` |
|
| 188 |
-
| NaN / Infinity / malformed / bool | Empty optional metric cell; excluded from ranking |
|
| 189 |
|
| 190 |
-
|
| 191 |
-
|
| 192 |
-
|
| 193 |
-
|
| 194 |
-
|
| 195 |
|
| 196 |
-
##
|
| 197 |
|
| 198 |
-
|
| 199 |
-
|
| 200 |
-
|
| 201 |
-
|
| 202 |
-
|
| 203 |
-
|
| 204 |
-
|
| 205 |
-
|
| 206 |
-
|
| 207 |
-
|
| 208 |
-
9. Verify horizontal scrolling at desktop/mobile widths and affected regressions.
|
| 209 |
-
10. Document contract gaps and deployment readiness; do not deploy as part of tests.
|
| 210 |
|
| 211 |
-
|
| 212 |
-
|
| 213 |
-
|
| 214 |
|
| 215 |
-
##
|
| 216 |
|
| 217 |
-
|
| 218 |
|
| 219 |
```powershell
|
| 220 |
..\.venv-frontend\Scripts\python.exe physiq_frontend_regression.py
|
| 221 |
-
..\.venv-frontend\Scripts\python.exe frontend_rank_history_regression.py
|
| 222 |
..\.venv-frontend\Scripts\python.exe frontend_labels_refresh_regression.py
|
| 223 |
-
..\.venv-frontend\Scripts\python.exe identity_history_regression.py
|
| 224 |
-
..\.venv-frontend\Scripts\python.exe publication_order_regression.py
|
| 225 |
-
..\.venv-frontend\Scripts\python.exe traceability_regression.py
|
| 226 |
-
..\.venv-frontend\Scripts\python.exe optional_novel_regression.py
|
| 227 |
-
..\.venv-frontend\Scripts\python.exe vg_selection_regression.py
|
| 228 |
-
..\.venv-frontend\Scripts\python.exe staging_regression.py
|
| 229 |
..\.venv-frontend\Scripts\python.exe vg_rank_history_browser_regression.py
|
| 230 |
```
|
| 231 |
|
| 232 |
-
|
| 233 |
-
|
| 234 |
-
|
| 235 |
-
|
| 236 |
-
|
| 237 |
-
`physiq_frontend_regression.py` compares actual Worker AST keys, supported tracks,
|
| 238 |
-
column order, unchanged primary, mixed records, zero/invalid/missing values,
|
| 239 |
-
original precision and report exposure. The browser script validates actual
|
| 240 |
-
PhysIQ sorting/rank/highlight/refresh, mixed History display and single horizontal
|
| 241 |
-
scroll owners across five viewport sizes, alongside existing PMF/SSIM/LPIPS checks.
|
| 242 |
-
|
| 243 |
-
Do not silently weaken unrelated failed tests. The current Worker `361c9fd`
|
| 244 |
-
changed VG manifests without updating `selected_full.json`/`selected_mini.json`;
|
| 245 |
-
the existing manifest equality regression reports that mismatch separately.
|
| 246 |
-
That is not repaired by adding a Frontend metric column.
|
| 247 |
-
The full staging suite also has outdated aggregation fixtures, an FP primary
|
| 248 |
-
metric manifest mismatch, and an all-track fixture that exceeds its default
|
| 249 |
-
7-day quota. The Node-only optional-novel DOM mock lacks `MutationObserver` even
|
| 250 |
-
with Node installed. These must not be mistaken for passing tests; see
|
| 251 |
-
`PHYSIQ_FRONTEND_INTEGRATION_REPORT.md` for the fresh results and scope limitations.
|
| 252 |
-
|
| 253 |
-
## G. Common mistakes
|
| 254 |
-
|
| 255 |
-
- Normalizing `Weighted-Spatial-Iou` to `Weighted-Spatial-IoU` in the stored-key
|
| 256 |
-
lookup: it silently hides real data. Normalize labels, not recorded keys.
|
| 257 |
-
- Calling three overlap components a composite Physics-IQ score.
|
| 258 |
-
- Assuming shared camera computation guarantees custom aggregation keeps a key.
|
| 259 |
-
- Forgetting prefix/suffix handling, public report groups or Properties projections.
|
| 260 |
-
- Treating `value or 0` as missing handling; zero and absent are different.
|
| 261 |
-
- Sorting formatted strings or three-decimal values instead of raw numbers.
|
| 262 |
-
- Guessing direction from a paper title, or changing `primary_metric` accidentally.
|
| 263 |
-
- Requiring every historical row to have a newly introduced optional key.
|
| 264 |
-
- Adding a column to every task despite absent final metrics.
|
| 265 |
-
- Changing persistent schemas/Worker algorithms to solve a display-only request.
|
|
|
|
| 1 |
+
# 新增评测指标:开发速查
|
| 2 |
|
| 3 |
+
下表中的 `Worker/` 指兄弟仓库 `PhysInOne-Leaderboard-Worker/`,其余路径属于 Frontend。
|
| 4 |
+
只新增辅助指标时,不改 `primary_metric`、任务名、track ID 或历史成绩。
|
|
|
|
|
|
|
| 5 |
|
| 6 |
+
## 一、Worker:先确认指标能进入最终结果
|
| 7 |
|
| 8 |
+
| 文件位置 / 函数 | 修改内容 | 是否必须 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 9 |
| --- | --- | --- |
|
| 10 |
+
| `Worker/src/tasks/_utils/image_metrics.py::evaluate_camera_metrics` | 图像指标在这里接入计算函数,并返回精确的数值 key;非图像指标进入对应 Plugin 的 Case 函数 | 新增计算时必须;已有输出无需改 |
|
| 11 |
+
| `Worker/src/tasks/<任务>/` 中的 `evaluate_scene` | 将相机结果汇总为 Case 结果;核对前后缀、视角和取帧范围 | 必须检查 |
|
| 12 |
+
| `Worker/src/tasks/base.py::_default_aggregate`;Plugin 的 `aggregate_fn` | 默认按 key 对 Case 求均值;自定义聚合可能有白名单,必须明确方向、权重和缺失策略 | 必须检查;自定义聚合按需修改 |
|
| 13 |
+
| Plugin `__init__.py` 的 `TaskPlugin` | 核对输出字段、`leaderboard_columns`、主指标;方向在 Frontend 单独配置 | 按需;不随意更换主指标 |
|
| 14 |
+
| `Worker/src/worker/runner.py::_add_scene_result`、`_process_submission`、`_append_history`;`src/worker/lease.py::finalize` | 核对 Progress 的 `scene_results[id].metrics` → 聚合 → Terminal / History 的 `metrics` | 必须验证;普通新增数值 key 不必改这些通用函数 |
|
| 15 |
+
| `Worker/task_manifest/` | 只在输入协议、Case 集或实际声明的契约变化时修改 | 仅加指标展示通常不需要 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 16 |
|
| 17 |
+
### PhysIQ 实例
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 18 |
|
| 19 |
+
`Worker/src/tasks/_utils/physiq.py::_compute_physiq_metrics` 返回三个分量,公共相机函数输出:
|
| 20 |
|
| 21 |
+
| 精确内部 key(不要改大小写) | 前端简称 | 完整名称 |
|
| 22 |
+
| --- | --- | --- |
|
| 23 |
+
| `PhysIQ/Spatial-IoU` | SP IoU | Spatial IoU |
|
| 24 |
+
| `PhysIQ/SpatioTemporal-IoU` | ST IoU | Spatiotemporal IoU |
|
| 25 |
+
| `PhysIQ/Weighted-Spatial-Iou` | WS IoU | Weighted Spatial IoU |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 26 |
|
| 27 |
+
均为 `[0,1]`、无单位、越高越好,**不是一个 Physics-IQ 综合分数**。
|
| 28 |
+
简称是本项目的紧凑 UI 标签,完整术语见[原论文](https://arxiv.org/html/2501.09038v1)
|
| 29 |
+
及[官方实现](https://github.com/google-deepmind/physics-IQ-benchmark/blob/main/physiq/calculate_and_write_metrics_to_csv.py)。
|
|
|
|
|
|
|
|
|
|
| 30 |
|
| 31 |
+
- VG 四轨 / Motion Transfer:原 key 直接进入最终结果。
|
| 32 |
+
- Properties:保存 `novel_<key>`、`reinit_<key>`;标签用 `NV SP IoU`、`RI SP IoU` 等区分渲染分组。
|
| 33 |
+
- Future Prediction:已经计算并在 Case 中保存 `<key>_train` / `<key>_novel`,但
|
| 34 |
+
`task_future_prediction/__init__.py::aggregate_metrics` 仅保留旧四项,最终结果没有 PhysIQ。
|
| 35 |
+
补齐需单独批准 Worker 聚合修改;不能只在 Frontend 从 Progress 拼出最终成绩。
|
| 36 |
|
| 37 |
+
## 二、Frontend:声明、展示与历史兼容
|
| 38 |
|
| 39 |
+
| 文件位置 / 函数 | 修改内容 | 是否必须 |
|
| 40 |
+
| --- | --- | --- |
|
| 41 |
+
| `src/tasks/<任务>/__init__.py`、`src/tasks/__init__.py` | 给对应任务的 `leaderboard_columns` 末尾追加精确 key,保留旧指标顺序和主指标 | 必须 |
|
| 42 |
+
| `src/tasks/physiq_display.py::register_physiq_display` | 本次 PhysIQ 的集中声明:`column_display_names`、`metric_directions[key]=True`、`optional_metric_columns`;其他指标可在自身任务声明相同属性 | 必须配置名称、方向、可选性 |
|
| 43 |
+
| `src/tasks/physiq_display.py::PHYSIQ_TOOLTIPS` | 短标签对应完整名称和解释;主榜和 History 共用 | 简称需要解释时 |
|
| 44 |
+
| `src/leaderboard/read_evals.py` | `_format_metric_cell` 校验可选值;两个 reader 生成榜单 / History;榜单 attrs 保存原始排序数值和方向 | 新字段走现有通路,无需另写计算 |
|
| 45 |
+
| `src/submission/public_metrics.py::public_metric_groups` | 普通任务从 `leaderboard_columns` 生成;Properties 有自定义分组,需要单独补充 | 自定义分组时必须 |
|
| 46 |
+
| `app.py::_property_novel_columns` / `_property_reinit_columns` | Properties 的显示投影:把对应新增指标放在 LPIPS 后,主榜 / History 同步使用 | 仅有独立投影的任务需要 |
|
| 47 |
+
| `src/display/leaderboard.py::render_leaderboard`、`public_table_js` | 现有三位小数、原始值排序、动态 RANK、高亮、稳定同分规则和刷新选择保留 | 正常无需改排序引擎 |
|
| 48 |
+
| `src/display/table_layout.py::table_resize_js`、`column_width` | History 指标识别、三位小数、Tooltip 和列宽;PhysIQ 已支持短标签 | 新指标名称未被识别时按需补充 |
|
|
|
|
|
|
|
| 49 |
|
| 50 |
+
**兼容规则:** 新数值显示三位小数,`0` 是有效的 `0.000`;旧记录缺字段、None、非法值或非有限值留空。
|
| 51 |
+
缺失项双向排序都靠后,所选指标全缺失时 RANK 为 `-`。比较 Worker 原始数值,不比较三位小数字符串。
|
| 52 |
+
不要回填或重算旧记录,不改存储 schema;普通报告也通过公共分组展示实际保存的值。
|
| 53 |
|
| 54 |
+
## 三、最小验证
|
| 55 |
|
| 56 |
+
在 Frontend 目录,用工作区 Python 环境运行:
|
| 57 |
|
| 58 |
```powershell
|
| 59 |
..\.venv-frontend\Scripts\python.exe physiq_frontend_regression.py
|
|
|
|
| 60 |
..\.venv-frontend\Scripts\python.exe frontend_labels_refresh_regression.py
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 61 |
..\.venv-frontend\Scripts\python.exe vg_rank_history_browser_regression.py
|
| 62 |
```
|
| 63 |
|
| 64 |
+
验收:精确 key 和覆盖任务正确;新列在旧指标最后;主榜 / History / 报告名称一致;旧记录留空、零分有效;
|
| 65 |
+
正反排序、同分、RANK、高亮和手动刷新正常;窄屏能滚到最后一列、没有新增嵌套滚动条。
|
| 66 |
+
发布相关改动还应运行 `publication_order_regression.py`、`traceability_regression.py`。
|
| 67 |
+
测试只用本地隔离数据;不要为了测展示而重启 Worker、重算历史或改生产数据。
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
physiq_frontend_regression.py
CHANGED
|
@@ -8,11 +8,28 @@ from unittest.mock import patch
|
|
| 8 |
|
| 9 |
import pandas as pd
|
| 10 |
import frontend_rank_history_regression as base
|
| 11 |
-
from src.tasks.physiq_display import PHYSIQ_LABELS, register_physiq_display
|
| 12 |
from src.submission.public_metrics import public_metric_values
|
| 13 |
|
| 14 |
|
| 15 |
class PhysIQChecks(unittest.TestCase):
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 16 |
def records(self, task):
|
| 17 |
keys = task.optional_metric_columns
|
| 18 |
return [dict(submission_id=name, task_name=task.name, status="done", display_name=name,
|
|
|
|
| 8 |
|
| 9 |
import pandas as pd
|
| 10 |
import frontend_rank_history_regression as base
|
| 11 |
+
from src.tasks.physiq_display import PHYSIQ_LABELS, PHYSIQ_TOOLTIPS, register_physiq_display
|
| 12 |
from src.submission.public_metrics import public_metric_values
|
| 13 |
|
| 14 |
|
| 15 |
class PhysIQChecks(unittest.TestCase):
|
| 16 |
+
def test_short_labels_and_full_tooltips(self):
|
| 17 |
+
self.assertEqual(list(PHYSIQ_LABELS.values()), ["SP IoU", "ST IoU", "WS IoU"])
|
| 18 |
+
for task in base.TASKS.values():
|
| 19 |
+
for key in getattr(task, "optional_metric_columns", ()):
|
| 20 |
+
label = task.column_display_names[key]
|
| 21 |
+
self.assertLessEqual(len(label), 12)
|
| 22 |
+
self.assertIn(label, PHYSIQ_TOOLTIPS)
|
| 23 |
+
task = base.TASKS["motionTransfer"]
|
| 24 |
+
frame = self.leaderboard(task, self.records(task))
|
| 25 |
+
parser = base.Cells()
|
| 26 |
+
parser.feed(base.render_leaderboard(frame, "PMF"))
|
| 27 |
+
for header in parser.headers:
|
| 28 |
+
label = header["data-column-name"]
|
| 29 |
+
if label in PHYSIQ_TOOLTIPS:
|
| 30 |
+
self.assertIn(PHYSIQ_TOOLTIPS[label], header["title"])
|
| 31 |
+
self.assertEqual(header["data-rank-direction"], "descending")
|
| 32 |
+
|
| 33 |
def records(self, task):
|
| 34 |
keys = task.optional_metric_columns
|
| 35 |
return [dict(submission_id=name, task_name=task.name, status="done", display_name=name,
|
src/display/leaderboard.py
CHANGED
|
@@ -8,6 +8,7 @@ import pandas as pd
|
|
| 8 |
from src.submission.links import validate_url
|
| 9 |
from src.display.labels import column_label
|
| 10 |
from src.tasks.property_estimation import TASK as PROPERTY_ESTIMATION_TASK
|
|
|
|
| 11 |
|
| 12 |
|
| 13 |
PROPERTY_PARAMETER_LABELS = {
|
|
@@ -99,6 +100,8 @@ def render_leaderboard(frame: pd.DataFrame, primary: str = "", max_height: int =
|
|
| 99 |
visible_name = escape(column.split(" · ", 1)[1]) if column in PROPERTY_PARAMETER_LABELS else name
|
| 100 |
label = "Rank" if column == "#" else column_label(visible_name)
|
| 101 |
hint = f'{visible_name}: {"lower" if lower else "higher"} is better' if ranking_direction else f"Sort by {visible_name}"
|
|
|
|
|
|
|
| 102 |
headers.append(
|
| 103 |
f'<th scope="col" data-column-name="{name}" data-rank-direction="{ranking_direction}" aria-sort="none" title="{hint}" '
|
| 104 |
f'class="{"score-composite" if column in bar_columns else ""}">'
|
|
|
|
| 8 |
from src.submission.links import validate_url
|
| 9 |
from src.display.labels import column_label
|
| 10 |
from src.tasks.property_estimation import TASK as PROPERTY_ESTIMATION_TASK
|
| 11 |
+
from src.tasks.physiq_display import PHYSIQ_TOOLTIPS
|
| 12 |
|
| 13 |
|
| 14 |
PROPERTY_PARAMETER_LABELS = {
|
|
|
|
| 100 |
visible_name = escape(column.split(" · ", 1)[1]) if column in PROPERTY_PARAMETER_LABELS else name
|
| 101 |
label = "Rank" if column == "#" else column_label(visible_name)
|
| 102 |
hint = f'{visible_name}: {"lower" if lower else "higher"} is better' if ranking_direction else f"Sort by {visible_name}"
|
| 103 |
+
if column in PHYSIQ_TOOLTIPS:
|
| 104 |
+
hint = escape(PHYSIQ_TOOLTIPS[column] + "; higher is better ([0, 1])", quote=True)
|
| 105 |
headers.append(
|
| 106 |
f'<th scope="col" data-column-name="{name}" data-rank-direction="{ranking_direction}" aria-sort="none" title="{hint}" '
|
| 107 |
f'class="{"score-composite" if column in bar_columns else ""}">'
|
src/display/table_layout.py
CHANGED
|
@@ -1,4 +1,7 @@
|
|
| 1 |
"""Initial widths and spreadsheet-style resizing for submission tables."""
|
|
|
|
|
|
|
|
|
|
| 2 |
|
| 3 |
|
| 4 |
def column_width(column: str) -> int:
|
|
@@ -33,6 +36,7 @@ def column_width(column: str) -> int:
|
|
| 33 |
table_resize_js = r"""() => {
|
| 34 |
if (window.physTableResizeInstalled) return;
|
| 35 |
window.physTableResizeInstalled = true;
|
|
|
|
| 36 |
const widths = new WeakMap();
|
| 37 |
const minimumFor = name => name === '#' ? 76 :
|
| 38 |
['Team', 'Method', 'Submitter', 'Method / Model'].includes(name) ? 130 :
|
|
@@ -85,7 +89,7 @@ table_resize_js = r"""() => {
|
|
| 85 |
headers.forEach((header, index) => {
|
| 86 |
const name = header.dataset.columnName || header.getAttribute('title') || header.textContent.trim();
|
| 87 |
header.dataset.columnName = name;
|
| 88 |
-
const metric = name.match(/\b(PMF|PSNR|SSIM|LPIPS|FVD
|
| 89 |
const parameter = /^(N|NN|E|P|S) /.test(name) ||
|
| 90 |
Boolean(table.closest('.property-material-table') &&
|
| 91 |
!['Completed At', 'ID', 'Team', 'Method', 'Submitter', 'Method / Model', 'Task', 'Status', 'Links', 'Scenes', 'Submission'].includes(name));
|
|
@@ -100,6 +104,7 @@ table_resize_js = r"""() => {
|
|
| 100 |
header.querySelector('.header-content')?.appendChild(badge);
|
| 101 |
header.title = `${name}: ${direction === '↑' ? 'higher' : 'lower'} is better`;
|
| 102 |
}
|
|
|
|
| 103 |
table.querySelectorAll(`tbody td[data-col="${index}"]`).forEach(cell => {
|
| 104 |
cell.dataset.columnKind = kind;
|
| 105 |
if (kind === 'metric' || name === 'Score') {
|
|
@@ -180,4 +185,4 @@ table_resize_js = r"""() => {
|
|
| 180 |
childList: true, characterData: true, subtree: true, attributes: true, attributeFilter: ['style']
|
| 181 |
});
|
| 182 |
install();
|
| 183 |
-
}"""
|
|
|
|
| 1 |
"""Initial widths and spreadsheet-style resizing for submission tables."""
|
| 2 |
+
import json
|
| 3 |
+
|
| 4 |
+
from src.tasks.physiq_display import PHYSIQ_TOOLTIPS
|
| 5 |
|
| 6 |
|
| 7 |
def column_width(column: str) -> int:
|
|
|
|
| 36 |
table_resize_js = r"""() => {
|
| 37 |
if (window.physTableResizeInstalled) return;
|
| 38 |
window.physTableResizeInstalled = true;
|
| 39 |
+
const physiqTooltips = __PHYSIQ_TOOLTIPS__;
|
| 40 |
const widths = new WeakMap();
|
| 41 |
const minimumFor = name => name === '#' ? 76 :
|
| 42 |
['Team', 'Method', 'Submitter', 'Method / Model'].includes(name) ? 130 :
|
|
|
|
| 89 |
headers.forEach((header, index) => {
|
| 90 |
const name = header.dataset.columnName || header.getAttribute('title') || header.textContent.trim();
|
| 91 |
header.dataset.columnName = name;
|
| 92 |
+
const metric = physiqTooltips[name] ? 'PHYSIQ' : name.match(/\b(PMF|PSNR|SSIM|LPIPS|FVD)\b/i)?.[1]?.toUpperCase();
|
| 93 |
const parameter = /^(N|NN|E|P|S) /.test(name) ||
|
| 94 |
Boolean(table.closest('.property-material-table') &&
|
| 95 |
!['Completed At', 'ID', 'Team', 'Method', 'Submitter', 'Method / Model', 'Task', 'Status', 'Links', 'Scenes', 'Submission'].includes(name));
|
|
|
|
| 104 |
header.querySelector('.header-content')?.appendChild(badge);
|
| 105 |
header.title = `${name}: ${direction === '↑' ? 'higher' : 'lower'} is better`;
|
| 106 |
}
|
| 107 |
+
if (physiqTooltips[name]) header.title = `${physiqTooltips[name]}; higher is better ([0, 1])`;
|
| 108 |
table.querySelectorAll(`tbody td[data-col="${index}"]`).forEach(cell => {
|
| 109 |
cell.dataset.columnKind = kind;
|
| 110 |
if (kind === 'metric' || name === 'Score') {
|
|
|
|
| 185 |
childList: true, characterData: true, subtree: true, attributes: true, attributeFilter: ['style']
|
| 186 |
});
|
| 187 |
install();
|
| 188 |
+
}""".replace("__PHYSIQ_TOOLTIPS__", json.dumps(PHYSIQ_TOOLTIPS))
|
src/tasks/physiq_display.py
CHANGED
|
@@ -1,18 +1,29 @@
|
|
| 1 |
"""Optional display contract matching the Worker's recorded PhysIQ components."""
|
| 2 |
|
| 3 |
PHYSIQ_LABELS = {
|
| 4 |
-
"PhysIQ/Spatial-IoU": "
|
| 5 |
-
"PhysIQ/SpatioTemporal-IoU": "
|
| 6 |
-
"PhysIQ/Weighted-Spatial-Iou": "
|
| 7 |
}
|
| 8 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 9 |
|
| 10 |
def register_physiq_display(task) -> None:
|
| 11 |
if task.name.startswith("videoGeneration_") or task.name == "motionTransfer":
|
| 12 |
labels = PHYSIQ_LABELS
|
| 13 |
elif task.name == "propertyEstimation":
|
| 14 |
labels = {f"{prefix}_{key}": f"{title} {label}"
|
| 15 |
-
for prefix, title in (("novel", "
|
| 16 |
for key, label in PHYSIQ_LABELS.items()}
|
| 17 |
else:
|
| 18 |
return
|
|
|
|
| 1 |
"""Optional display contract matching the Worker's recorded PhysIQ components."""
|
| 2 |
|
| 3 |
PHYSIQ_LABELS = {
|
| 4 |
+
"PhysIQ/Spatial-IoU": "SP IoU",
|
| 5 |
+
"PhysIQ/SpatioTemporal-IoU": "ST IoU",
|
| 6 |
+
"PhysIQ/Weighted-Spatial-Iou": "WS IoU",
|
| 7 |
}
|
| 8 |
|
| 9 |
+
PHYSIQ_TOOLTIPS = {
|
| 10 |
+
"SP IoU": "PhysIQ Spatial IoU: overlap of motion regions across time",
|
| 11 |
+
"ST IoU": "PhysIQ Spatiotemporal IoU: mean of per-frame motion-mask IoUs",
|
| 12 |
+
"WS IoU": "PhysIQ Weighted Spatial IoU: overlap of temporal motion occupancy",
|
| 13 |
+
}
|
| 14 |
+
PHYSIQ_TOOLTIPS.update({
|
| 15 |
+
f"{prefix} {label}": f"{title} — {description}"
|
| 16 |
+
for prefix, title in (("NV", "Novel View Synthesis"), ("RI", "Reinitialized Rendering"))
|
| 17 |
+
for label, description in list(PHYSIQ_TOOLTIPS.items())
|
| 18 |
+
})
|
| 19 |
+
|
| 20 |
|
| 21 |
def register_physiq_display(task) -> None:
|
| 22 |
if task.name.startswith("videoGeneration_") or task.name == "motionTransfer":
|
| 23 |
labels = PHYSIQ_LABELS
|
| 24 |
elif task.name == "propertyEstimation":
|
| 25 |
labels = {f"{prefix}_{key}": f"{title} {label}"
|
| 26 |
+
for prefix, title in (("novel", "NV"), ("reinit", "RI"))
|
| 27 |
for key, label in PHYSIQ_LABELS.items()}
|
| 28 |
else:
|
| 29 |
return
|
vg_rank_history_browser_regression.py
CHANGED
|
@@ -90,7 +90,9 @@ async def inspect_browser(port, server_port, baseline):
|
|
| 90 |
lower = await evaluate(snapshot)
|
| 91 |
assert lower["active"] == "LPIPS" and lower["order"][0] == "model-b" and lower["ranks"]["model-b"] == "1st", lower
|
| 92 |
assert await evaluate("document.querySelector('th.ranking-metric').getAttribute('aria-sort')==='ascending'")
|
| 93 |
-
physiq = "
|
|
|
|
|
|
|
| 94 |
await evaluate(f"document.querySelector('th[data-column-name=\"{physiq}\"] button').click()")
|
| 95 |
overlap = await evaluate(snapshot)
|
| 96 |
assert overlap["active"] == physiq and overlap["order"] == ["model-d", "model-b", "model-c", "model-a", "model-e", "model-f"], overlap
|
|
@@ -101,17 +103,25 @@ async def inspect_browser(port, server_port, baseline):
|
|
| 101 |
await evaluate(f"document.querySelector('th[data-column-name=\"{physiq}\"] button').click()")
|
| 102 |
reverse_overlap = await evaluate(snapshot)
|
| 103 |
assert reverse_overlap["order"][-1] == "model-f" and reverse_overlap["ranks"] == overlap["ranks"], reverse_overlap
|
| 104 |
-
empty_metric = "
|
| 105 |
await evaluate(f"document.querySelector('th[data-column-name=\"{empty_metric}\"] button').click()")
|
| 106 |
assert set((await evaluate(snapshot))["ranks"].values()) == {"-"}
|
| 107 |
report["physiq_checks"] = ["original precision", "stable ties", "zero", "missing last both directions", "no ranks for all missing", "refresh preserves selected metric", "active header"]
|
| 108 |
history_values = await evaluate("""(() => {
|
| 109 |
const table=document.querySelector('#history-motionTransfer table:not([aria-hidden="true"])');
|
| 110 |
const headers=Array.from(table.querySelectorAll('thead th:not(.row-number)'));
|
| 111 |
-
const index=headers.findIndex(header=>header.dataset.columnName==='
|
| 112 |
return Array.from(table.querySelectorAll(`tbody td[data-col="${index}"]`)).map(cell=>cell.textContent.trim());
|
| 113 |
})()""")
|
| 114 |
assert "0.000" in history_values and "" in history_values and "0.500" in history_values, history_values
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 115 |
report["rank_checks"] = ["default PMF", "SSIM precision and stable ties", "reverse sort retains ranks", "nonmetric sort", "manual refresh", "LPIPS lower is better", "missing ranks"]
|
| 116 |
for width in (1920, 1440, 1280, 768, 390):
|
| 117 |
await command("Emulation.setDeviceMetricsOverride", dict(width=width, height=1000, deviceScaleFactor=1, mobile=False))
|
|
@@ -177,10 +187,11 @@ def main():
|
|
| 177 |
"PMF": [9, 8, 8, 7, 6, None], "SSIM": [.2, .9, .9, .9000001, .1, None],
|
| 178 |
"LPIPS": [.4, .1, .2, .5, .3, None], "Submission": [f"model-{name}" for name in "abcdef"]})
|
| 179 |
frame.attrs["submission_times"] = {f"model-{name}": index for index, name in enumerate("abcdef")}
|
| 180 |
-
frame["
|
| 181 |
-
frame["
|
| 182 |
-
frame
|
| 183 |
-
frame.attrs["
|
|
|
|
| 184 |
for name, task in fixture.tasks.items():
|
| 185 |
directory = root / "data/results" / name
|
| 186 |
directory.mkdir(parents=True, exist_ok=True)
|
|
|
|
| 90 |
lower = await evaluate(snapshot)
|
| 91 |
assert lower["active"] == "LPIPS" and lower["order"][0] == "model-b" and lower["ranks"]["model-b"] == "1st", lower
|
| 92 |
assert await evaluate("document.querySelector('th.ranking-metric').getAttribute('aria-sort')==='ascending'")
|
| 93 |
+
physiq = "SP IoU"
|
| 94 |
+
await evaluate("document.querySelector('th[data-column-name=\"ST IoU\"] button').click()")
|
| 95 |
+
assert (await evaluate(snapshot))["active"] == "ST IoU"
|
| 96 |
await evaluate(f"document.querySelector('th[data-column-name=\"{physiq}\"] button').click()")
|
| 97 |
overlap = await evaluate(snapshot)
|
| 98 |
assert overlap["active"] == physiq and overlap["order"] == ["model-d", "model-b", "model-c", "model-a", "model-e", "model-f"], overlap
|
|
|
|
| 103 |
await evaluate(f"document.querySelector('th[data-column-name=\"{physiq}\"] button').click()")
|
| 104 |
reverse_overlap = await evaluate(snapshot)
|
| 105 |
assert reverse_overlap["order"][-1] == "model-f" and reverse_overlap["ranks"] == overlap["ranks"], reverse_overlap
|
| 106 |
+
empty_metric = "WS IoU"
|
| 107 |
await evaluate(f"document.querySelector('th[data-column-name=\"{empty_metric}\"] button').click()")
|
| 108 |
assert set((await evaluate(snapshot))["ranks"].values()) == {"-"}
|
| 109 |
report["physiq_checks"] = ["original precision", "stable ties", "zero", "missing last both directions", "no ranks for all missing", "refresh preserves selected metric", "active header"]
|
| 110 |
history_values = await evaluate("""(() => {
|
| 111 |
const table=document.querySelector('#history-motionTransfer table:not([aria-hidden="true"])');
|
| 112 |
const headers=Array.from(table.querySelectorAll('thead th:not(.row-number)'));
|
| 113 |
+
const index=headers.findIndex(header=>header.dataset.columnName==='SP IoU');
|
| 114 |
return Array.from(table.querySelectorAll(`tbody td[data-col="${index}"]`)).map(cell=>cell.textContent.trim());
|
| 115 |
})()""")
|
| 116 |
assert "0.000" in history_values and "" in history_values and "0.500" in history_values, history_values
|
| 117 |
+
compact_headers = await evaluate("""(() => {
|
| 118 |
+
const headers=Array.from(document.querySelectorAll('.public-results th, .history-table th'));
|
| 119 |
+
return headers.filter(header=>/^(?:(NV|RI) )?(SP|ST|WS) IoU$/.test(header.dataset.columnName || ''))
|
| 120 |
+
.map(header=>({label:header.dataset.columnName, title:header.title,
|
| 121 |
+
clipped:header.querySelector('.board-sort')?.scrollWidth > header.querySelector('.board-sort')?.clientWidth}));
|
| 122 |
+
})()""")
|
| 123 |
+
assert compact_headers and all(len(header['label']) <= 12 and 'PhysIQ' in header['title'] and not header['clipped'] for header in compact_headers), compact_headers
|
| 124 |
+
report["physiq_compact_headers"] = len(compact_headers)
|
| 125 |
report["rank_checks"] = ["default PMF", "SSIM precision and stable ties", "reverse sort retains ranks", "nonmetric sort", "manual refresh", "LPIPS lower is better", "missing ranks"]
|
| 126 |
for width in (1920, 1440, 1280, 768, 390):
|
| 127 |
await command("Emulation.setDeviceMetricsOverride", dict(width=width, height=1000, deviceScaleFactor=1, mobile=False))
|
|
|
|
| 187 |
"PMF": [9, 8, 8, 7, 6, None], "SSIM": [.2, .9, .9, .9000001, .1, None],
|
| 188 |
"LPIPS": [.4, .1, .2, .5, .3, None], "Submission": [f"model-{name}" for name in "abcdef"]})
|
| 189 |
frame.attrs["submission_times"] = {f"model-{name}": index for index, name in enumerate("abcdef")}
|
| 190 |
+
frame["SP IoU"] = [.2, .9, .9, .9000001, 0, None]
|
| 191 |
+
frame["ST IoU"] = [.1, .8, .8, .8000001, 0, None]
|
| 192 |
+
frame["WS IoU"] = [None] * 6
|
| 193 |
+
frame.attrs["metric_directions"] = {"SP IoU": True, "ST IoU": True, "WS IoU": True}
|
| 194 |
+
frame.attrs["optional_metric_columns"] = ["SP IoU", "ST IoU", "WS IoU"]
|
| 195 |
for name, task in fixture.tasks.items():
|
| 196 |
directory = root / "data/results" / name
|
| 197 |
directory.mkdir(parents=True, exist_ok=True)
|