Minette Kaunismäki Claude Sonnet 5.5 commited on
Commit
469df9e
·
1 Parent(s): b7b4a25

Add Ref2V benchmark results and price/speed Pareto on all modalities

Browse files

- Add ref2v_bench_v0_results.csv (Rapidata Elo, price, speed) and a
"Reference to Video" modality with a Ref2V Bench v0 dataset.
- Add a "Cost and speed" Pareto plot (generation time vs price) to every
dataset that has both price and time.
- Widen the Model Type filter so the new label fits.
- Replace the sticky Model column shadow in the leaderboard with a thin
divider line.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

Files changed (3) hide show
  1. app.py +93 -2
  2. data/ref2v_bench_v0_results.csv +14 -0
  3. ui.py +110 -25
app.py CHANGED
@@ -1,5 +1,7 @@
1
  import asyncio
 
2
  import json
 
3
  from collections import defaultdict
4
  from pathlib import Path
5
 
@@ -701,6 +703,12 @@ button.theme-toggle[data-mode="light"] .theme-icon-moon { display: block !import
701
  flex: 1 1 0% !important;
702
  min-width: 0 !important;
703
  }
 
 
 
 
 
 
704
  .view-filters > .block,
705
  .view-filters .form,
706
  .view-filters .block {
@@ -1224,7 +1232,7 @@ button.theme-toggle[data-mode="light"] .theme-icon-moon { display: block !import
1224
  min-width: 180px;
1225
  max-width: 260px;
1226
  background: var(--pruna-table-sticky) !important;
1227
- box-shadow: 8px 0 10px -8px rgba(0, 0, 0, 0.35) !important;
1228
  }
1229
  .ranking-table th.model-cell,
1230
  .prose .ranking-table th.model-cell {
@@ -1232,7 +1240,7 @@ button.theme-toggle[data-mode="light"] .theme-icon-moon { display: block !import
1232
  left: var(--rank-col-width);
1233
  z-index: 5;
1234
  background: var(--pruna-bg-header) !important;
1235
- box-shadow: 0 1px 0 var(--pruna-hairline), 8px 0 10px -8px rgba(0, 0, 0, 0.35) !important;
1236
  }
1237
  .ranking-table tbody tr:hover .rank,
1238
  .ranking-table tbody tr:hover .model-cell {
@@ -2475,6 +2483,55 @@ def load_text_to_video_dataframe(path):
2475
  return load_video_generation_dataframe(path)
2476
 
2477
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2478
  df = load_oneig_dataframe(oneig_path)
2479
 
2480
  oneig_metric_columns = [
@@ -2555,6 +2612,12 @@ image_to_video_path = _resolve_data_path(
2555
  space_root.parent / "i2v-pro.csv",
2556
  )
2557
 
 
 
 
 
 
 
2558
  qwen_df = load_qwen_combined_dataframe(qwen_path)
2559
  aa_df = load_artificial_analysis_dataframe(aa_path)
2560
  arena_df = load_arena_ai_dataframe(arena_path)
@@ -2720,7 +2783,35 @@ image_to_video_metric_ids = _metric_ids_for(
2720
  image_to_video_df, ["datapoint_elo", "rapidata_elo"]
2721
  )
2722
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2723
  datasets = [
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2724
  {
2725
  "id": "text_to_video",
2726
  "name": "VBench-2.0 Dataset",
 
1
  import asyncio
2
+ import io
3
  import json
4
+ import re
5
  from collections import defaultdict
6
  from pathlib import Path
7
 
 
703
  flex: 1 1 0% !important;
704
  min-width: 0 !important;
705
  }
706
+ @media (min-width: 701px) {
707
+ .view-filters .form > .filter-modality {
708
+ flex: 0 0 210px !important;
709
+ min-width: 210px !important;
710
+ }
711
+ }
712
  .view-filters > .block,
713
  .view-filters .form,
714
  .view-filters .block {
 
1232
  min-width: 180px;
1233
  max-width: 260px;
1234
  background: var(--pruna-table-sticky) !important;
1235
+ box-shadow: inset -1px 0 0 var(--pruna-border) !important;
1236
  }
1237
  .ranking-table th.model-cell,
1238
  .prose .ranking-table th.model-cell {
 
1240
  left: var(--rank-col-width);
1241
  z-index: 5;
1242
  background: var(--pruna-bg-header) !important;
1243
+ box-shadow: 0 1px 0 var(--pruna-hairline), inset -1px 0 0 var(--pruna-border) !important;
1244
  }
1245
  .ranking-table tbody tr:hover .rank,
1246
  .ranking-table tbody tr:hover .model-cell {
 
2483
  return load_video_generation_dataframe(path)
2484
 
2485
 
2486
+ def _read_commented_csv(path):
2487
+ """Read a CSV whose leading lines are '#' comments."""
2488
+ lines = Path(path).read_text(encoding="utf-8").splitlines(keepends=True)
2489
+ start = 0
2490
+ while start < len(lines) and lines[start].startswith("#"):
2491
+ start += 1
2492
+ return pd.read_csv(
2493
+ io.StringIO("".join(lines[start:])), na_values=["N/A", "n/a", ""]
2494
+ )
2495
+
2496
+
2497
+ def load_reference_to_video_dataframe(path):
2498
+ """Load ref2v_bench results for the leaderboard and Pareto plots."""
2499
+ raw = _read_commented_csv(path)
2500
+ raw = raw.dropna(subset=["model_id"]).reset_index(drop=True)
2501
+ raw["model_id"] = raw["model_id"].astype(str).str.strip()
2502
+ raw["display_name"] = raw["display_name"].astype(str).str.strip()
2503
+
2504
+ df = raw.rename(
2505
+ columns={
2506
+ "display_name": "Model",
2507
+ "rapidata_elo": "Rapidata Elo",
2508
+ "min_generation_s": "Min Generation Time (s)",
2509
+ "median_generation_s": "Median Generation Time (s)",
2510
+ "p20_generation_s": "P20 Generation Time (s)",
2511
+ "generation_s_per_output_video_s": "Time / Output Video Second (s)",
2512
+ "price_usd_per_second": "Price / Second of Video (USD)",
2513
+ }
2514
+ )
2515
+ df = df.drop(
2516
+ columns=[c for c in df.columns if c.startswith("compass_")]
2517
+ + ["model_id", "n_generations", "n_generations_all"],
2518
+ errors="ignore",
2519
+ )
2520
+ df = _as_numeric(
2521
+ df,
2522
+ [
2523
+ "Rapidata Elo",
2524
+ "Min Generation Time (s)",
2525
+ "Median Generation Time (s)",
2526
+ "P20 Generation Time (s)",
2527
+ "Time / Output Video Second (s)",
2528
+ "Price / Second of Video (USD)",
2529
+ ],
2530
+ )
2531
+ df = _apply_video_timings(df, replace_displayed_time=True)
2532
+ return df.reset_index(drop=True)
2533
+
2534
+
2535
  df = load_oneig_dataframe(oneig_path)
2536
 
2537
  oneig_metric_columns = [
 
2612
  space_root.parent / "i2v-pro.csv",
2613
  )
2614
 
2615
+ ref2v_path = _resolve_data_path(
2616
+ data_dir / "ref2v_bench_v0_results.csv",
2617
+ space_root.parent / "ref2v_bench_v0_results.csv",
2618
+ )
2619
+ ref2v_df = load_reference_to_video_dataframe(ref2v_path)
2620
+
2621
  qwen_df = load_qwen_combined_dataframe(qwen_path)
2622
  aa_df = load_artificial_analysis_dataframe(aa_path)
2623
  arena_df = load_arena_ai_dataframe(arena_path)
 
2783
  image_to_video_df, ["datapoint_elo", "rapidata_elo"]
2784
  )
2785
 
2786
+ ref2v_metric_ids = _metric_ids_for(ref2v_df, ["rapidata_elo"])
2787
+ ref2v_price_note = "Prices include reference fees"
2788
+ for _name, _note in zip(
2789
+ ref2v_df["Model"], ref2v_df.get("price_footnote", [None] * len(ref2v_df))
2790
+ ):
2791
+ if isinstance(_note, str) and _note.strip():
2792
+ _cost = re.search(r"about (\$[\d.\u2013-]+/s)", _note)
2793
+ ref2v_price_note += (
2794
+ f", except {_name}, which received no reference video and so paid none"
2795
+ + (f" (about {_cost.group(1)} with them)" if _cost else "")
2796
+ )
2797
+ ref2v_price_note += "."
2798
+
2799
  datasets = [
2800
+ {
2801
+ "id": "ref2v",
2802
+ "name": "Ref2V Bench v0",
2803
+ "modality": "reference_to_video",
2804
+ "data": ref2v_df,
2805
+ "columns": [
2806
+ col for col in text_to_video_display_columns if col in ref2v_df.columns
2807
+ ],
2808
+ "metric_ids": ref2v_metric_ids,
2809
+ "note": (
2810
+ "Rapidata Elo from pairwise preference, voters see only the two "
2811
+ "videos. " + ref2v_price_note
2812
+ ),
2813
+ "samples": None,
2814
+ },
2815
  {
2816
  "id": "text_to_video",
2817
  "name": "VBench-2.0 Dataset",
data/ref2v_bench_v0_results.csv ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # ref2v_bench_v0 results, one row per model. Sources: build_results_table.py docstring.
2
+ # Human eval: Rapidata shows voters the two videos only. Elo over all clips; rank 1 = best.
3
+ # Price and time on the 111 prompts every model completed. price_usd_per_second = billed cost incl. reference fees / output s; generation_s = provider wait (queue included), not upload or download.
4
+ # compass_<prompt set>_<metric>: mean score; _n videos scored; _se standard error (pooled spread); _z standard errors from the 7-model average (|z| < 2 is roughly noise). Prompt sets are never pooled.
5
+ # Scales: visual_quality 0-1 (DOVER++ technical), audio_quality ~1-10 (Audiobox PQ), the rest 1-5 (Gemini judges; lip sync by SyncNet). stable_speaking_frontal_face is only the lip-sync filter. Lip sync on OpenS2V has too few videos to report.
6
+ model_id,display_name,provider,endpoint,rapidata_elo,rapidata_elo_ci,rapidata_rank,price_usd_per_second,generation_s_per_output_video_s,median_generation_s,n_generations,n_generations_all,min_generation_s,p20_generation_s,mean_generation_s,list_price_usd_per_second,price_usd_per_second_image_refs,price_usd_per_second_video_ref,price_usd_per_typical_clip,price_footnote,compass_multiref_compass_anatomical_consistency,compass_multiref_compass_anatomical_consistency_n,compass_multiref_compass_anatomical_consistency_se,compass_multiref_compass_anatomical_consistency_z,compass_multiref_compass_audio_quality,compass_multiref_compass_audio_quality_n,compass_multiref_compass_audio_quality_se,compass_multiref_compass_audio_quality_z,compass_multiref_compass_audio_task_following,compass_multiref_compass_audio_task_following_n,compass_multiref_compass_audio_task_following_se,compass_multiref_compass_audio_task_following_z,compass_multiref_compass_detail_binding,compass_multiref_compass_detail_binding_n,compass_multiref_compass_detail_binding_se,compass_multiref_compass_detail_binding_z,compass_multiref_compass_detail_preservation,compass_multiref_compass_detail_preservation_n,compass_multiref_compass_detail_preservation_se,compass_multiref_compass_detail_preservation_z,compass_multiref_compass_source_correctness,compass_multiref_compass_source_correctness_n,compass_multiref_compass_source_correctness_se,compass_multiref_compass_source_correctness_z,compass_multiref_compass_speech_content_accuracy,compass_multiref_compass_speech_content_accuracy_n,compass_multiref_compass_speech_content_accuracy_se,compass_multiref_compass_speech_content_accuracy_z,compass_multiref_compass_speech_lip_synchronization,compass_multiref_compass_speech_lip_synchronization_n,compass_multiref_compass_speech_lip_synchronization_se,compass_multiref_compass_speech_lip_synchronization_z,compass_multiref_compass_stable_speaking_frontal_face,compass_multiref_compass_stable_speaking_frontal_face_n,compass_multiref_compass_stable_speaking_frontal_face_se,compass_multiref_compass_stable_speaking_frontal_face_z,compass_multiref_compass_temporal_order_following,compass_multiref_compass_temporal_order_following_n,compass_multiref_compass_temporal_order_following_se,compass_multiref_compass_temporal_order_following_z,compass_multiref_compass_visual_event_sound_alignment,compass_multiref_compass_visual_event_sound_alignment_n,compass_multiref_compass_visual_event_sound_alignment_se,compass_multiref_compass_visual_event_sound_alignment_z,compass_multiref_compass_visual_quality,compass_multiref_compass_visual_quality_n,compass_multiref_compass_visual_quality_se,compass_multiref_compass_visual_quality_z,compass_multiref_compass_visual_task_following,compass_multiref_compass_visual_task_following_n,compass_multiref_compass_visual_task_following_se,compass_multiref_compass_visual_task_following_z,compass_opens2v_eval_anatomical_consistency,compass_opens2v_eval_anatomical_consistency_n,compass_opens2v_eval_anatomical_consistency_se,compass_opens2v_eval_anatomical_consistency_z,compass_opens2v_eval_audio_quality,compass_opens2v_eval_audio_quality_n,compass_opens2v_eval_audio_quality_se,compass_opens2v_eval_audio_quality_z,compass_opens2v_eval_audio_task_following,compass_opens2v_eval_audio_task_following_n,compass_opens2v_eval_audio_task_following_se,compass_opens2v_eval_audio_task_following_z,compass_opens2v_eval_detail_binding,compass_opens2v_eval_detail_binding_n,compass_opens2v_eval_detail_binding_se,compass_opens2v_eval_detail_binding_z,compass_opens2v_eval_detail_preservation,compass_opens2v_eval_detail_preservation_n,compass_opens2v_eval_detail_preservation_se,compass_opens2v_eval_detail_preservation_z,compass_opens2v_eval_speech_lip_synchronization,compass_opens2v_eval_speech_lip_synchronization_n,compass_opens2v_eval_speech_lip_synchronization_se,compass_opens2v_eval_speech_lip_synchronization_z,compass_opens2v_eval_stable_speaking_frontal_face,compass_opens2v_eval_stable_speaking_frontal_face_n,compass_opens2v_eval_stable_speaking_frontal_face_se,compass_opens2v_eval_stable_speaking_frontal_face_z,compass_opens2v_eval_temporal_order_following,compass_opens2v_eval_temporal_order_following_n,compass_opens2v_eval_temporal_order_following_se,compass_opens2v_eval_temporal_order_following_z,compass_opens2v_eval_visual_event_sound_alignment,compass_opens2v_eval_visual_event_sound_alignment_n,compass_opens2v_eval_visual_event_sound_alignment_se,compass_opens2v_eval_visual_event_sound_alignment_z,compass_opens2v_eval_visual_quality,compass_opens2v_eval_visual_quality_n,compass_opens2v_eval_visual_quality_se,compass_opens2v_eval_visual_quality_z,compass_opens2v_eval_visual_task_following,compass_opens2v_eval_visual_task_following_n,compass_opens2v_eval_visual_task_following_se,compass_opens2v_eval_visual_task_following_z
7
+ p_video_2_pro_reference,P-Video 2 Pro Reference,replicate,prunaai/p-video-2-pro-reference,1033,17,2,0.0462104,2.28478,14.0119,111,130,7.65198,10.0467,17.0844,0.035,0.0386462,0.0735259,0.31,,3.8689,82,0.10718,-0.101591,7.48157,82,0.0859189,1.30774,4.77083,48,0.149249,0.957173,4.87805,82,0.0380168,-0.939528,4.72764,82,0.0836426,0.40603,4.91837,49,0.0797278,0.269433,4.67308,52,0.119709,0.590681,4.32502,16,0.204044,2.26479,2.90909,55,0.199959,-0.716404,4.69355,62,0.113031,0.0886122,4.78261,69,0.0582419,-1.50969,0.152517,82,0.00347198,-11.2026,4.53445,82,0.0759313,1.95537,4.15625,48,0.128152,-0.525695,6.85765,48,0.109265,-0.0731109,4.27273,11,0.418506,0.44341,5,48,0.00646454,0.553139,4.59606,48,0.124882,-0.286497,4.16178,2,0.741891,0.407439,3.2,5,0.727029,-0.668081,4.85714,14,0.136551,0.173231,4.87179,39,0.0831586,0.191592,0.173233,48,0.00569378,-5.0973,4.59774,47,0.0789107,-1.1962
8
+ gemini_omni_1_1_flash,Gemini Omni 1.1 Flash,wavespeed,google/gemini-omni-1.1-flash/reference-to-video,1124,17,1,0.1,8.78015,46.2765,111,117,34.186,39.9785,65.6533,0.1,0.1,0.1,0.8,,4.2378,82,0.10718,3.34031,7.19456,82,0.0859189,-2.03276,4.70833,48,0.149249,0.53841,4.96341,82,0.0380168,1.30595,4.18089,82,0.0836426,-6.13069,4.80769,52,0.0773938,-1.15247,4.23077,52,0.119709,-3.10417,4.66283,22,0.17401,4.59704,3.76364,55,0.199959,3.55719,4.75,64,0.111251,0.597455,4.96203,79,0.0544311,1.68083,0.223415,82,0.00347198,9.21745,4.56723,82,0.0759313,2.38699,4.20714,35,0.150076,-0.109784,6.66536,35,0.127959,-1.56512,4.4,10,0.438933,0.712734,5,35,0.00757049,0.472333,4.16667,35,0.146247,-3.18077,4.37053,1,1.04919,0.487065,3,3,0.938591,-0.730579,5,12,0.147492,1.12896,4.92593,27,0.0999442,0.701027,0.222455,35,0.00666787,3.02944,4.79564,35,0.0914431,1.13196
9
+ kling_3_0_omni_pro,Kling 3.0 Omni Pro,wavespeed,kwaivgi/kling-video-o3-pro/reference-to-video,921,17,6,0.14,37.429,272.644,111,125,133.942,202.143,279.875,0.14,0.14,0.14,1.12,"Kling received no reference video (its API can't add sound to a video input, so we sent one frame), so it paid no reference-video fee on the 21 reference-video prompts.
10
+ At the other models' fees ($0.06–0.13 per reference-video second) it would cost about $0.148–0.157/s.",3.75,81,0.107839,-1.20356,7.23066,81,0.0864477,-1.60264,4.60417,48,0.149249,-0.159529,4.83539,81,0.0382508,-2.049,4.7284,81,0.0841573,0.412491,4.925,40,0.0882425,0.318599,4.71154,52,0.119709,0.911973,2.53796,8,0.288562,-4.59151,2.38889,54,0.201802,-3.28764,4.64286,56,0.118932,-0.342004,4.85938,64,0.0604742,-0.184554,0.185875,81,0.00349334,-1.58501,4.16782,81,0.0763986,-2.85554,4.14205,44,0.13385,-0.609437,7.1283,44,0.114124,2.30154,4.2,10,0.438933,0.257084,5,44,0.00675199,0.529591,4.65152,44,0.130435,0.150819,2.30744,1,1.04919,-1.47929,3,5,0.727029,-0.943173,4.72727,11,0.15405,-0.689484,4.65385,26,0.101848,-1.98351,0.193628,44,0.00594696,-1.45065,4.63254,43,0.0824994,-0.722339
11
+ minimax_h3,MiniMax H3,wavespeed,minimax/h3/reference-to-video,987,17,4,0.112617,40.0517,282.27,111,127,130.438,208.691,299.486,0.1,0.1,0.158178,0.8,,3.92073,82,0.10718,0.381982,7.38123,82,0.0859189,0.139846,4.6875,48,0.149249,0.398822,4.93902,82,0.0380168,0.664383,4.7832,82,0.0836426,1.07023,4.85714,49,0.0797278,-0.498486,4.80392,51,0.120877,1.66743,3.885,26,0.160066,0.138059,3.46296,54,0.201802,2.03477,4.67213,61,0.113954,-0.100052,4.86111,72,0.0570157,-0.165299,0.198768,82,0.00347198,2.11847,4.40083,81,0.0763986,0.194454,4.31383,47,0.129508,0.696565,6.84768,47,0.110422,-0.162594,3.36364,11,0.418506,-1.72882,5,47,0.00653295,0.547347,4.71749,47,0.126203,0.678674,4.055,4,0.524596,0.372662,4.4,5,0.727029,0.982472,4.83333,12,0.147492,-0.00104824,4.83784,37,0.0853766,-0.211118,0.206642,47,0.00575403,0.762264,4.7356,47,0.0789107,0.550857
12
+ minimax_h3_max,MiniMax H3 Max,fal,minimax/h3-max/reference-to-video,1030,17,3,0.0969066,2.08629,10.3881,111,129,5.11202,6.60513,15.6002,0.08,0.08,0.157958,0.64,,3.78354,82,0.10718,-0.898065,7.41123,82,0.0859189,0.489073,4.58333,48,0.149249,-0.299117,4.88618,82,0.0380168,-0.725673,4.68767,82,0.0836426,-0.0718716,4.92,50,0.0789265,0.292854,4.73585,53,0.118575,1.12572,4.19443,22,0.17401,1.90522,3.5,54,0.201802,2.2183,4.74603,63,0.112131,0.55738,4.86957,69,0.0582419,-0.0166641,0.188244,82,0.00347198,-0.912534,4.41048,82,0.0759313,0.322712,4.06383,47,0.129508,-1.23381,6.78496,47,0.110422,-0.730621,4.81818,11,0.418506,1.74675,5,47,0.00653295,0.547347,4.77305,47,0.126203,1.11888,4.49758,2,0.741891,0.860069,3.8,5,0.727029,0.157195,5,13,0.141706,1.17506,4.97436,39,0.0831586,1.42495,0.203966,47,0.00575403,0.297244,4.60851,47,0.0789107,-1.05966
13
+ seedance_2_5,Seedance 2.5,wavespeed,bytedance/seedance-2.5/text-to-video,985,17,5,0.370093,30.0721,206.055,111,121,130.958,178.206,224.864,0.36,0.36,0.406542,2.88,,4.02134,82,0.10718,1.32068,7.38576,82,0.0859189,0.192623,4.66667,48,0.149249,0.259234,4.9878,82,0.0380168,1.94751,4.79675,82,0.0836426,1.23223,4.85,40,0.0882425,-0.531332,4.62745,51,0.120877,0.207517,3.80772,17,0.197952,-0.278735,2.98182,55,0.199959,-0.352693,4.55,60,0.1149,-1.16217,4.97183,71,0.0574158,1.76424,0.188524,82,0.00347198,-0.831838,4.29557,82,0.0759313,-1.19067,4.55128,39,0.142172,2.3047,6.8551,39,0.121219,-0.0869478,3.88889,9,0.462676,-0.428525,4.98291,39,0.00717176,-1.88493,4.69801,39,0.138544,0.477557,4.1214,2,0.741891,0.353016,4,3,0.938591,0.334849,4.58333,12,0.147492,-1.69606,4.90909,22,0.110721,0.480747,0.202191,39,0.00631668,-0.0102518,4.65449,39,0.0866269,-0.434531
14
+ wan_3_0,Wan 3.0,wavespeed,alibaba/wan-3.0/reference-to-video,921,17,6,0.123453,26.9252,192.698,111,124,115.08,139.634,201.333,0.1,0.1,0.208145,0.8,,3.57622,82,0.10718,-2.83236,7.49946,82,0.0859189,1.51598,4.375,48,0.149249,-1.69499,4.9065,82,0.0380168,-0.191036,4.95122,82,0.0836426,3.07904,5,32,0.0986581,1.04516,4.43396,53,0.118575,-1.42024,3.62734,9,0.272059,-0.865839,2.36,50,0.209719,-3.30128,4.73016,63,0.112131,0.415822,4.78723,47,0.0705686,-1.18044,0.202543,82,0.00347198,3.20577,4.32546,82,0.0759313,-0.79695,4.13095,42,0.137,-0.676396,6.9204,42,0.11681,0.468866,3.66667,9,0.462676,-0.908823,4.99206,42,0.00691088,-0.630993,4.82011,42,0.133504,1.41016,3.50279,3,0.605752,-0.588872,4.4,5,0.727029,0.982472,4.83333,12,0.147492,-0.00104824,4.81818,11,0.156582,-0.240643,0.213674,42,0.0060869,1.87588,4.8204,42,0.0834757,1.53658
ui.py CHANGED
@@ -23,7 +23,7 @@ MAX_COMPARE_MODELS = 4
23
  DEFAULT_COMPARE_PROMPTS = 3
24
  MAX_COMPARE_PROMPTS = 8
25
  MAX_PARETO_METRICS = 8
26
- _PARETO_SLOT_COUNT = 1 + MAX_PARETO_METRICS * 8
27
  _PARETO_PRICE_COLUMN = "Price / Image (USD)"
28
  _PARETO_VIDEO_PRICE_COLUMN = "Price / Second of Video (USD)"
29
  _PARETO_PRICE_COLUMNS = (_PARETO_PRICE_COLUMN, _PARETO_VIDEO_PRICE_COLUMN)
@@ -56,10 +56,12 @@ TAB_ABOUT = "about"
56
  MODALITY_TEXT_TO_VIDEO = "text_to_video"
57
  MODALITY_IMAGE_TO_VIDEO = "image_to_video"
58
  MODALITY_VIDEO_TO_VIDEO = "video_to_video"
 
59
  MODALITY_TEXT_TO_IMAGE = "text_to_image"
60
  MODALITY_CHOICES = [
61
  ("Text to Video", MODALITY_TEXT_TO_VIDEO),
62
  ("Image to Video", MODALITY_IMAGE_TO_VIDEO),
 
63
  ("Video to Video", MODALITY_VIDEO_TO_VIDEO),
64
  ("Text to Image", MODALITY_TEXT_TO_IMAGE),
65
  ]
@@ -903,6 +905,25 @@ def _pareto_fill_colors(models):
903
  ]
904
 
905
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
906
  def _build_pareto_figure(
907
  data,
908
  score_column,
@@ -911,6 +932,12 @@ def _build_pareto_figure(
911
  x_hover_prefix="",
912
  x_hover_suffix="",
913
  x_axis_type="linear",
 
 
 
 
 
 
914
  ):
915
  scatter = (
916
  data[["Model", score_column, x_column]]
@@ -923,7 +950,9 @@ def _build_pareto_figure(
923
 
924
  x_values = scatter[x_column].astype(float).tolist()
925
  scores = scatter[score_column].astype(float).tolist()
926
- on_frontier = _pareto_frontier_mask(x_values, scores)
 
 
927
 
928
  dominated = scatter.loc[[not flag for flag in on_frontier]].copy()
929
  frontier = scatter.loc[on_frontier].sort_values(x_column).copy()
@@ -936,7 +965,7 @@ def _build_pareto_figure(
936
  hover = (
937
  "<b>%{text}</b><br>"
938
  f"{escape(x_title)}: {x_hover_prefix}%{{x:.4f}}{x_hover_suffix}"
939
- "<br>Score: %{y:.4f}<extra></extra>"
940
  )
941
 
942
  fig = go.Figure()
@@ -1017,7 +1046,7 @@ def _build_pareto_figure(
1017
  fig.update_layout(
1018
  title=None,
1019
  xaxis_title=x_title,
1020
- yaxis_title=score_label,
1021
  autosize=True,
1022
  height=420,
1023
  margin={"l": 56, "r": 28, "t": 28, "b": 80},
@@ -1036,26 +1065,12 @@ def _build_pareto_figure(
1036
  )
1037
  axis_font = {"color": "#fafafa", "size": 13}
1038
  tick_font = {"color": "#a3a3a3", "size": 12}
1039
- x_axis_ticks = {}
1040
- if x_axis_type == "log":
1041
- positive_x = scatter.loc[scatter[x_column] > 0, x_column].astype(float)
1042
- if not positive_x.empty:
1043
- minimum = positive_x.min()
1044
- maximum = positive_x.max()
1045
- tick_values = [
1046
- factor * (10**exponent)
1047
- for exponent in range(
1048
- floor(log10(minimum)),
1049
- ceil(log10(maximum)) + 1,
1050
- )
1051
- for factor in (1, 2, 5)
1052
- if minimum * 0.8 <= factor * (10**exponent) <= maximum * 1.2
1053
- ]
1054
- x_axis_ticks = {
1055
- "tickmode": "array",
1056
- "tickvals": tick_values,
1057
- "ticktext": [f"{value:g}" for value in tick_values],
1058
- }
1059
  fig.update_xaxes(
1060
  type=x_axis_type,
1061
  **x_axis_ticks,
@@ -1067,6 +1082,8 @@ def _build_pareto_figure(
1067
  color="#d4d4d4",
1068
  )
1069
  fig.update_yaxes(
 
 
1070
  showgrid=True,
1071
  gridcolor="rgba(74, 57, 98, 0.55)",
1072
  zeroline=False,
@@ -1077,6 +1094,35 @@ def _build_pareto_figure(
1077
  return fig
1078
 
1079
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1080
  def _is_log_scale(scale):
1081
  return scale == "Logarithmic"
1082
 
@@ -1286,6 +1332,7 @@ def _pareto_slot_updates(
1286
  _pareto_plot_update(time_fig),
1287
  ]
1288
  )
 
1289
  return updates
1290
 
1291
 
@@ -1455,7 +1502,8 @@ def _filter_row(datasets, metrics, default_dataset_id, default_metric_id=None):
1455
  type="value",
1456
  filterable=False,
1457
  scale=1,
1458
- min_width=170,
 
1459
  )
1460
  dataset_dd = gr.Dropdown(
1461
  choices=_dataset_choices(datasets, modality=default_modality),
@@ -1668,6 +1716,41 @@ def render_image_workspace(datasets, metrics, default_dataset_id, default_metric
1668
  slot_time_scale,
1669
  )
1670
  )
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1671
 
1672
  with gr.TabItem(
1673
  "Samples",
@@ -2502,6 +2585,8 @@ def render_image_workspace(datasets, metrics, default_dataset_id, default_metric
2502
  slot_time,
2503
  )
2504
  ],
 
 
2505
  ]
2506
  pareto_all_scale_outputs = [
2507
  *[
 
23
  DEFAULT_COMPARE_PROMPTS = 3
24
  MAX_COMPARE_PROMPTS = 8
25
  MAX_PARETO_METRICS = 8
26
+ _PARETO_SLOT_COUNT = 3 + MAX_PARETO_METRICS * 8
27
  _PARETO_PRICE_COLUMN = "Price / Image (USD)"
28
  _PARETO_VIDEO_PRICE_COLUMN = "Price / Second of Video (USD)"
29
  _PARETO_PRICE_COLUMNS = (_PARETO_PRICE_COLUMN, _PARETO_VIDEO_PRICE_COLUMN)
 
56
  MODALITY_TEXT_TO_VIDEO = "text_to_video"
57
  MODALITY_IMAGE_TO_VIDEO = "image_to_video"
58
  MODALITY_VIDEO_TO_VIDEO = "video_to_video"
59
+ MODALITY_REFERENCE_TO_VIDEO = "reference_to_video"
60
  MODALITY_TEXT_TO_IMAGE = "text_to_image"
61
  MODALITY_CHOICES = [
62
  ("Text to Video", MODALITY_TEXT_TO_VIDEO),
63
  ("Image to Video", MODALITY_IMAGE_TO_VIDEO),
64
+ ("Reference to Video", MODALITY_REFERENCE_TO_VIDEO),
65
  ("Video to Video", MODALITY_VIDEO_TO_VIDEO),
66
  ("Text to Image", MODALITY_TEXT_TO_IMAGE),
67
  ]
 
905
  ]
906
 
907
 
908
+ def _log_axis_ticks(values):
909
+ """Tick dict with clean 1/2/5 steps for a log axis, or {} if not possible."""
910
+ positive = [float(v) for v in values if v and float(v) > 0]
911
+ if not positive:
912
+ return {}
913
+ minimum, maximum = min(positive), max(positive)
914
+ tick_values = [
915
+ factor * (10**exponent)
916
+ for exponent in range(floor(log10(minimum)), ceil(log10(maximum)) + 1)
917
+ for factor in (1, 2, 5)
918
+ if minimum * 0.8 <= factor * (10**exponent) <= maximum * 1.2
919
+ ]
920
+ return {
921
+ "tickmode": "array",
922
+ "tickvals": tick_values,
923
+ "ticktext": [f"{value:g}" for value in tick_values],
924
+ }
925
+
926
+
927
  def _build_pareto_figure(
928
  data,
929
  score_column,
 
932
  x_hover_prefix="",
933
  x_hover_suffix="",
934
  x_axis_type="linear",
935
+ y_title=None,
936
+ y_lower_is_better=False,
937
+ y_hover_label="Score",
938
+ y_hover_suffix="",
939
+ y_axis_type="linear",
940
+ y_hover_prefix="",
941
  ):
942
  scatter = (
943
  data[["Model", score_column, x_column]]
 
950
 
951
  x_values = scatter[x_column].astype(float).tolist()
952
  scores = scatter[score_column].astype(float).tolist()
953
+ on_frontier = _pareto_frontier_mask(
954
+ x_values, [-value for value in scores] if y_lower_is_better else scores
955
+ )
956
 
957
  dominated = scatter.loc[[not flag for flag in on_frontier]].copy()
958
  frontier = scatter.loc[on_frontier].sort_values(x_column).copy()
 
965
  hover = (
966
  "<b>%{text}</b><br>"
967
  f"{escape(x_title)}: {x_hover_prefix}%{{x:.4f}}{x_hover_suffix}"
968
+ f"<br>{escape(y_hover_label)}: {y_hover_prefix}%{{y:.4f}}{y_hover_suffix}<extra></extra>"
969
  )
970
 
971
  fig = go.Figure()
 
1046
  fig.update_layout(
1047
  title=None,
1048
  xaxis_title=x_title,
1049
+ yaxis_title=y_title or score_label,
1050
  autosize=True,
1051
  height=420,
1052
  margin={"l": 56, "r": 28, "t": 28, "b": 80},
 
1065
  )
1066
  axis_font = {"color": "#fafafa", "size": 13}
1067
  tick_font = {"color": "#a3a3a3", "size": 12}
1068
+ x_axis_ticks = (
1069
+ _log_axis_ticks(scatter[x_column]) if x_axis_type == "log" else {}
1070
+ )
1071
+ y_axis_ticks = (
1072
+ _log_axis_ticks(scatter[score_column]) if y_axis_type == "log" else {}
1073
+ )
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1074
  fig.update_xaxes(
1075
  type=x_axis_type,
1076
  **x_axis_ticks,
 
1082
  color="#d4d4d4",
1083
  )
1084
  fig.update_yaxes(
1085
+ type=y_axis_type,
1086
+ **y_axis_ticks,
1087
  showgrid=True,
1088
  gridcolor="rgba(74, 57, 98, 0.55)",
1089
  zeroline=False,
 
1094
  return fig
1095
 
1096
 
1097
+ def _speed_price_figure(data):
1098
+ """Generation time vs price; both lower-is-better, frontier = bottom-left."""
1099
+ price_column = _pareto_price_column(data)
1100
+ time_column = _pareto_time_column(data)
1101
+ if data is None or price_column is None or time_column is None:
1102
+ return None
1103
+ return _build_pareto_figure(
1104
+ data,
1105
+ score_column=price_column,
1106
+ x_column=time_column,
1107
+ x_title=_PARETO_TIME_TITLES.get(time_column, "Generation time (s)"),
1108
+ x_hover_suffix="s",
1109
+ x_axis_type="log",
1110
+ y_title=_PARETO_PRICE_TITLES.get(price_column, "Price (USD)"),
1111
+ y_lower_is_better=True,
1112
+ y_hover_label="Price",
1113
+ y_hover_prefix="$",
1114
+ y_axis_type="log",
1115
+ )
1116
+
1117
+
1118
+ def _speed_price_updates(data):
1119
+ fig = _speed_price_figure(data)
1120
+ return [
1121
+ gr.update(visible=fig is not None),
1122
+ _pareto_plot_update(fig),
1123
+ ]
1124
+
1125
+
1126
  def _is_log_scale(scale):
1127
  return scale == "Logarithmic"
1128
 
 
1332
  _pareto_plot_update(time_fig),
1333
  ]
1334
  )
1335
+ updates.extend(_speed_price_updates(data))
1336
  return updates
1337
 
1338
 
 
1502
  type="value",
1503
  filterable=False,
1504
  scale=1,
1505
+ min_width=210,
1506
+ elem_classes="filter-modality",
1507
  )
1508
  dataset_dd = gr.Dropdown(
1509
  choices=_dataset_choices(datasets, modality=default_modality),
 
1716
  slot_time_scale,
1717
  )
1718
  )
1719
+ with gr.Column(
1720
+ visible=False, elem_classes="pareto-metric-block"
1721
+ ) as speed_price_group:
1722
+ gr.Markdown(
1723
+ "#### Cost and speed",
1724
+ elem_classes="pareto-metric-title",
1725
+ )
1726
+ with gr.Row(
1727
+ equal_height=True, elem_classes="pareto-layout"
1728
+ ):
1729
+ with gr.Column(
1730
+ scale=1, min_width=320, elem_classes="pareto-col"
1731
+ ):
1732
+ gr.Markdown(
1733
+ "#### Time vs price",
1734
+ elem_classes="pareto-subhead",
1735
+ )
1736
+ speed_price_plot = gr.Plot(
1737
+ value=None,
1738
+ show_label=False,
1739
+ elem_classes="pareto-plot",
1740
+ )
1741
+ # Empty half so the plot matches the width of the others.
1742
+ with gr.Column(
1743
+ scale=1, min_width=320, elem_classes="pareto-col"
1744
+ ):
1745
+ gr.HTML("", padding=False)
1746
+ gr.HTML(
1747
+ "<p class='pareto-note-copy'>Lower is better on both "
1748
+ "axes, so the best models sit at the bottom-left. "
1749
+ "Green points are on the frontier. Hover a point to "
1750
+ "see which model it is.</p>",
1751
+ padding=False,
1752
+ elem_classes="pareto-note",
1753
+ )
1754
 
1755
  with gr.TabItem(
1756
  "Samples",
 
2585
  slot_time,
2586
  )
2587
  ],
2588
+ speed_price_group,
2589
+ speed_price_plot,
2590
  ]
2591
  pareto_all_scale_outputs = [
2592
  *[