Spaces:
Running
Running
Align VEFX-Bench v1.0 protocol and metadata
#1
by xiangbog - opened
- README.md +25 -9
- examples/batch_scoring.py +1 -1
- examples/multi_gpu_scoring.py +2 -2
- examples/quick_start.py +2 -1
- index.html +21 -6
- vefx_reward/inference.py +17 -5
README.md
CHANGED
|
@@ -11,13 +11,15 @@ short_description: VEFX-Bench reference code & inference utils
|
|
| 11 |
|
| 12 |
<div align="center">
|
| 13 |
|
| 14 |
-
# VEFX-Bench
|
| 15 |
|
| 16 |
### Benchmarking Generic Video Editing and Visual Effects
|
| 17 |
|
| 18 |
</div>
|
| 19 |
|
| 20 |
-
|
|
|
|
|
|
|
| 21 |
|
| 22 |
| Dimension | What it measures |
|
| 23 |
|---|---|
|
|
@@ -29,9 +31,9 @@ short_description: VEFX-Bench reference code & inference utils
|
|
| 29 |
|
| 30 |
## 🏆 Model Leaderboard
|
| 31 |
|
| 32 |
-
VEFX-Reward scores on 1–4 scale.
|
| 33 |
|
| 34 |
-
> **📅 Updated:
|
| 35 |
|
| 36 |
| Rank | Model | Type | IF ↑ | RQ ↑ | EE ↑ | GeoAgg ↑ |
|
| 37 |
|:---:|---|---|:---:|:---:|:---:|:---:|
|
|
@@ -93,14 +95,23 @@ Each demo shows the **original video** (left) alongside the **edited video** (ri
|
|
| 93 |
|
| 94 |
## 📦 VEFX-Bench Dataset
|
| 95 |
|
| 96 |
-
The benchmark dataset is hosted on
|
| 97 |
|
| 98 |
| | |
|
| 99 |
|---|---|
|
| 100 |
| 🎬 **300** Source Videos (720p) | 📝 `prompts.json` with editing instructions |
|
| 101 |
| 📂 **9** Task Categories | 🗂️ `benchmark_meta.json` with category labels |
|
| 102 |
|
| 103 |
-
**Task Categories:**
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 104 |
|
| 105 |
### Download and Evaluate
|
| 106 |
|
|
@@ -108,7 +119,12 @@ The benchmark dataset is hosted on HuggingFace at **[VEFX-Reward/VEFX-Bench](htt
|
|
| 108 |
from huggingface_hub import snapshot_download
|
| 109 |
|
| 110 |
# Download the benchmark dataset
|
| 111 |
-
snapshot_download(
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 112 |
```
|
| 113 |
|
| 114 |
**Evaluation workflow:**
|
|
@@ -171,7 +187,7 @@ scores = model.score(
|
|
| 171 |
instruction="Remove the woman with the grey backpack walking on the right side of the frame.",
|
| 172 |
)
|
| 173 |
print(scores)
|
| 174 |
-
# {'IF': 2.34, 'RQ': 1.93, 'EE': 1.82, 'Overall':
|
| 175 |
```
|
| 176 |
|
| 177 |
### CLI Usage
|
|
@@ -239,7 +255,7 @@ VEFXReward(
|
|
| 239 |
|
| 240 |
#### `model.score(original_video, edited_video, instruction) → dict`
|
| 241 |
|
| 242 |
-
Score a single video edit. Returns `{'IF': float, 'RQ': float, 'EE': float, 'Overall': float}`.
|
| 243 |
|
| 244 |
#### `model.score_batch(original_videos, edited_videos, instructions) → list[dict]`
|
| 245 |
|
|
|
|
| 11 |
|
| 12 |
<div align="center">
|
| 13 |
|
| 14 |
+
# VEFX-Bench v1.0
|
| 15 |
|
| 16 |
### Benchmarking Generic Video Editing and Visual Effects
|
| 17 |
|
| 18 |
</div>
|
| 19 |
|
| 20 |
+
> **Frozen release:** VEFX-Bench v1.0 — frozen on 2026-08-03. See the immutable dataset, manifest, and checkpoint identifiers under [Reproducibility](#-reproducibility).
|
| 21 |
+
|
| 22 |
+
**VEFX-Bench** is a comprehensive benchmark for evaluating text-driven video editing and visual effects. It includes **5,049 annotated examples** spanning **9 categories** and **32 subcategories**, with a frozen **300-item v1.0 test set** evaluated by **VEFX-Reward** — a VLM-based reward model that scores edits across three dimensions on a 1–4 scale:
|
| 23 |
|
| 24 |
| Dimension | What it measures |
|
| 25 |
|---|---|
|
|
|
|
| 31 |
|
| 32 |
## 🏆 Model Leaderboard
|
| 33 |
|
| 34 |
+
VEFX-Reward scores each dimension on a 1–4 scale. **Overall is the primary GeoAgg metric; it is not the arithmetic average of IF, RQ, and EE.** For item `j`, define `i_j=(IF_j-1)/3`, `r_j=(RQ_j-1)/3`, and `e_j=(EE_j-1)/3`, then compute `g_j=1+3*(i_j^2*r_j*e_j)^(1/4)`. The leaderboard computes **Overall = (1/300)·Σ_j g_j**: GeoAgg is computed per item first, then the 300 values are averaged. Missing or failed items receive `(1,1,1)`. The arithmetic Mean is diagnostic only and is not used for ranking.
|
| 35 |
|
| 36 |
+
> **📅 Updated: August 3, 2026** — For the latest results & submissions, visit the **[live leaderboard →](https://vefx-leaderboard.com/)**
|
| 37 |
|
| 38 |
| Rank | Model | Type | IF ↑ | RQ ↑ | EE ↑ | GeoAgg ↑ |
|
| 39 |
|:---:|---|---|:---:|:---:|:---:|:---:|
|
|
|
|
| 95 |
|
| 96 |
## 📦 VEFX-Bench Dataset
|
| 97 |
|
| 98 |
+
The canonical frozen benchmark dataset is hosted on Hugging Face at **[xiangbog/VEFX-Bench](https://huggingface.co/datasets/xiangbog/VEFX-Bench/tree/3bf997e7eb4fa0d0c2d56cce5ddfccc1dfbda235)**. Submit and inspect results on the public **[VEFX-Leaderboard](https://vefx-leaderboard.com/)**.
|
| 99 |
|
| 100 |
| | |
|
| 101 |
|---|---|
|
| 102 |
| 🎬 **300** Source Videos (720p) | 📝 `prompts.json` with editing instructions |
|
| 103 |
| 📂 **9** Task Categories | 🗂️ `benchmark_meta.json` with category labels |
|
| 104 |
|
| 105 |
+
**Task Categories:** Attribute Editing · Camera Angle Editing · Camera Motion Editing · Creative Edit · Instance Editing · Instance Motion Editing · Quantity Editing · Style Editing · Visual Effect Editing
|
| 106 |
+
|
| 107 |
+
### 🔒 Reproducibility
|
| 108 |
+
|
| 109 |
+
| Artifact | Frozen identifier |
|
| 110 |
+
|---|---|
|
| 111 |
+
| Dataset revision | `3bf997e7eb4fa0d0c2d56cce5ddfccc1dfbda235` |
|
| 112 |
+
| `benchmark_meta.json` SHA-256 | `277d89f5cf23af4163fe6ee120654210f51d19c6dee2d3aa76a3248471d1f333` |
|
| 113 |
+
| Reward model revision | `a15a8dbe1b3eb07ee0919e8de059f170436ec9ff` |
|
| 114 |
+
| `model.safetensors` SHA-256 | `c3c0d03f770f0a73631206821922213de75413bb517f7d7a2fd9ab1f2c38f59d` |
|
| 115 |
|
| 116 |
### Download and Evaluate
|
| 117 |
|
|
|
|
| 119 |
from huggingface_hub import snapshot_download
|
| 120 |
|
| 121 |
# Download the benchmark dataset
|
| 122 |
+
snapshot_download(
|
| 123 |
+
repo_id="xiangbog/VEFX-Bench",
|
| 124 |
+
repo_type="dataset",
|
| 125 |
+
revision="3bf997e7eb4fa0d0c2d56cce5ddfccc1dfbda235",
|
| 126 |
+
local_dir="./vefx_bench",
|
| 127 |
+
)
|
| 128 |
```
|
| 129 |
|
| 130 |
**Evaluation workflow:**
|
|
|
|
| 187 |
instruction="Remove the woman with the grey backpack walking on the right side of the frame.",
|
| 188 |
)
|
| 189 |
print(scores)
|
| 190 |
+
# {'IF': 2.34, 'RQ': 1.93, 'EE': 1.82, 'Overall': 2.082, 'GeoAgg': 2.082, 'Mean': 2.03}
|
| 191 |
```
|
| 192 |
|
| 193 |
### CLI Usage
|
|
|
|
| 255 |
|
| 256 |
#### `model.score(original_video, edited_video, instruction) → dict`
|
| 257 |
|
| 258 |
+
Score a single video edit. Returns `{'IF': float, 'RQ': float, 'EE': float, 'Overall': float, 'GeoAgg': float, 'Mean': float}`. `Overall` and `GeoAgg` are identical item-level v1.0 scores; `Mean` is diagnostic only.
|
| 259 |
|
| 260 |
#### `model.score_batch(original_videos, edited_videos, instructions) → list[dict]`
|
| 261 |
|
examples/batch_scoring.py
CHANGED
|
@@ -39,7 +39,7 @@ def main():
|
|
| 39 |
results.append({**row, **scores})
|
| 40 |
print(f"[{i+1}/{len(rows)}] IF={scores['IF']:.2f} RQ={scores['RQ']:.2f} EE={scores['EE']:.2f} Overall={scores['Overall']:.2f}")
|
| 41 |
|
| 42 |
-
fieldnames = list(rows[0].keys()) + ["IF", "RQ", "EE", "Overall"]
|
| 43 |
with open(args.output, "w", newline="") as f:
|
| 44 |
writer = csv.DictWriter(f, fieldnames=fieldnames)
|
| 45 |
writer.writeheader()
|
|
|
|
| 39 |
results.append({**row, **scores})
|
| 40 |
print(f"[{i+1}/{len(rows)}] IF={scores['IF']:.2f} RQ={scores['RQ']:.2f} EE={scores['EE']:.2f} Overall={scores['Overall']:.2f}")
|
| 41 |
|
| 42 |
+
fieldnames = list(rows[0].keys()) + ["IF", "RQ", "EE", "Overall", "GeoAgg", "Mean"]
|
| 43 |
with open(args.output, "w", newline="") as f:
|
| 44 |
writer = csv.DictWriter(f, fieldnames=fieldnames)
|
| 45 |
writer.writeheader()
|
examples/multi_gpu_scoring.py
CHANGED
|
@@ -38,7 +38,7 @@ def worker_main(args):
|
|
| 38 |
f"IF={scores['IF']:.2f} RQ={scores['RQ']:.2f} EE={scores['EE']:.2f}", flush=True)
|
| 39 |
except Exception as e:
|
| 40 |
print(f"[GPU {args.gpu_id}] [{i+1}/{len(shard)}] ERROR: {e}", flush=True)
|
| 41 |
-
results.append({**item, "IF": None, "RQ": None, "EE": None, "Overall": None, "error": str(e)})
|
| 42 |
|
| 43 |
with open(args.output_file, "w") as f:
|
| 44 |
json.dump(results, f)
|
|
@@ -104,7 +104,7 @@ def main():
|
|
| 104 |
with open(of) as f:
|
| 105 |
all_results.extend(json.load(f))
|
| 106 |
|
| 107 |
-
fieldnames = list(rows[0].keys()) + ["IF", "RQ", "EE", "Overall"]
|
| 108 |
with open(args.output, "w", newline="") as f:
|
| 109 |
writer = csv.DictWriter(f, fieldnames=fieldnames, extrasaction="ignore")
|
| 110 |
writer.writeheader()
|
|
|
|
| 38 |
f"IF={scores['IF']:.2f} RQ={scores['RQ']:.2f} EE={scores['EE']:.2f}", flush=True)
|
| 39 |
except Exception as e:
|
| 40 |
print(f"[GPU {args.gpu_id}] [{i+1}/{len(shard)}] ERROR: {e}", flush=True)
|
| 41 |
+
results.append({**item, "IF": None, "RQ": None, "EE": None, "Overall": None, "GeoAgg": None, "Mean": None, "error": str(e)})
|
| 42 |
|
| 43 |
with open(args.output_file, "w") as f:
|
| 44 |
json.dump(results, f)
|
|
|
|
| 104 |
with open(of) as f:
|
| 105 |
all_results.extend(json.load(f))
|
| 106 |
|
| 107 |
+
fieldnames = list(rows[0].keys()) + ["IF", "RQ", "EE", "Overall", "GeoAgg", "Mean"]
|
| 108 |
with open(args.output, "w", newline="") as f:
|
| 109 |
writer = csv.DictWriter(f, fieldnames=fieldnames, extrasaction="ignore")
|
| 110 |
writer.writeheader()
|
examples/quick_start.py
CHANGED
|
@@ -31,7 +31,8 @@ def main():
|
|
| 31 |
print(f" Instructional Following (IF): {scores['IF']:.2f}")
|
| 32 |
print(f" Render Quality (RQ): {scores['RQ']:.2f}")
|
| 33 |
print(f" Edit Exclusivity (EE): {scores['EE']:.2f}")
|
| 34 |
-
print(f" Overall
|
|
|
|
| 35 |
print("=" * 50)
|
| 36 |
|
| 37 |
|
|
|
|
| 31 |
print(f" Instructional Following (IF): {scores['IF']:.2f}")
|
| 32 |
print(f" Render Quality (RQ): {scores['RQ']:.2f}")
|
| 33 |
print(f" Edit Exclusivity (EE): {scores['EE']:.2f}")
|
| 34 |
+
print(f" Overall (GeoAgg, primary) : {scores['Overall']:.2f}")
|
| 35 |
+
print(f" Mean (diagnostic) : {scores['Mean']:.2f}")
|
| 36 |
print("=" * 50)
|
| 37 |
|
| 38 |
|
index.html
CHANGED
|
@@ -3,7 +3,7 @@
|
|
| 3 |
<head>
|
| 4 |
<meta charset="UTF-8">
|
| 5 |
<meta name="viewport" content="width=device-width, initial-scale=1">
|
| 6 |
-
<title>VEFX-Code · Reference code for VEFX-Bench</title>
|
| 7 |
<style>
|
| 8 |
:root { --fg:#1a1a1a; --muted:#666; --bg:#fff; --card:#f7f7f9; --accent:#5b6cff; --border:#e5e7eb; }
|
| 9 |
* { box-sizing:border-box; }
|
|
@@ -22,6 +22,7 @@
|
|
| 22 |
th { background:var(--card); font-weight:600; }
|
| 23 |
td.num, th.num { text-align:center; }
|
| 24 |
code { background:var(--card); padding:.15em .4em; border-radius:4px; font-size:.9em; }
|
|
|
|
| 25 |
pre { background:var(--card); padding:1em; border-radius:6px; overflow-x:auto; }
|
| 26 |
pre code { background:none; padding:0; }
|
| 27 |
.grid { display:grid; grid-template-columns:1fr 1fr; gap:1em; margin:1em 0; }
|
|
@@ -35,13 +36,14 @@
|
|
| 35 |
<body>
|
| 36 |
|
| 37 |
<h1>🎬 VEFX-Code</h1>
|
| 38 |
-
<p class="tagline">Reference code & inference utilities for
|
| 39 |
|
| 40 |
<div class="pill-row">
|
| 41 |
<a class="pill" href="https://huggingface.co/spaces/VEFX-Reward/VEFX-Code/tree/main" target="_blank">📂 Browse Files</a>
|
| 42 |
<a class="pill" href="https://huggingface.co/spaces/VEFX-Reward/VEFX-Code/blob/main/README.md" target="_blank">📖 Full README</a>
|
| 43 |
-
<a class="pill" href="https://huggingface.co/datasets/
|
| 44 |
-
<a class="pill" href="https://huggingface.co/VEFX-Reward/VEFX-Reward-4B" target="_blank">🤖
|
|
|
|
| 45 |
</div>
|
| 46 |
|
| 47 |
<h2>📊 What's in VEFX-Bench</h2>
|
|
@@ -53,8 +55,21 @@
|
|
| 53 |
<div class="card"><h3>Edit Exclusivity (EE)</h3><p>Were only the intended regions modified, without side-effects?</p></div>
|
| 54 |
</div>
|
| 55 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 56 |
<h2>🏆 Model Leaderboard</h2>
|
| 57 |
-
<p>
|
| 58 |
<table>
|
| 59 |
<thead><tr><th class="num">Rank</th><th>Model</th><th>Type</th><th class="num">IF ↑</th><th class="num">RQ ↑</th><th class="num">EE ↑</th><th class="num">GeoAgg ↑</th></tr></thead>
|
| 60 |
<tbody>
|
|
@@ -89,7 +104,7 @@ python examples/quick_start.py \
|
|
| 89 |
<p>See <a href="https://huggingface.co/spaces/VEFX-Reward/VEFX-Code/tree/main/examples" target="_blank">examples/</a> for batch & multi-GPU scoring scripts.</p>
|
| 90 |
|
| 91 |
<footer>
|
| 92 |
-
Released under Apache-2.0. Code lives in the <a href="https://huggingface.co/spaces/VEFX-Reward/VEFX-Code/tree/main" target="_blank">Files tab</a>.
|
| 93 |
</footer>
|
| 94 |
|
| 95 |
</body>
|
|
|
|
| 3 |
<head>
|
| 4 |
<meta charset="UTF-8">
|
| 5 |
<meta name="viewport" content="width=device-width, initial-scale=1">
|
| 6 |
+
<title>VEFX-Code · Reference code for VEFX-Bench v1.0</title>
|
| 7 |
<style>
|
| 8 |
:root { --fg:#1a1a1a; --muted:#666; --bg:#fff; --card:#f7f7f9; --accent:#5b6cff; --border:#e5e7eb; }
|
| 9 |
* { box-sizing:border-box; }
|
|
|
|
| 22 |
th { background:var(--card); font-weight:600; }
|
| 23 |
td.num, th.num { text-align:center; }
|
| 24 |
code { background:var(--card); padding:.15em .4em; border-radius:4px; font-size:.9em; }
|
| 25 |
+
td code { overflow-wrap:anywhere; word-break:break-all; }
|
| 26 |
pre { background:var(--card); padding:1em; border-radius:6px; overflow-x:auto; }
|
| 27 |
pre code { background:none; padding:0; }
|
| 28 |
.grid { display:grid; grid-template-columns:1fr 1fr; gap:1em; margin:1em 0; }
|
|
|
|
| 36 |
<body>
|
| 37 |
|
| 38 |
<h1>🎬 VEFX-Code</h1>
|
| 39 |
+
<p class="tagline">Reference code & inference utilities for <strong>VEFX-Bench v1.0</strong> — frozen on 2026-08-03.</p>
|
| 40 |
|
| 41 |
<div class="pill-row">
|
| 42 |
<a class="pill" href="https://huggingface.co/spaces/VEFX-Reward/VEFX-Code/tree/main" target="_blank">📂 Browse Files</a>
|
| 43 |
<a class="pill" href="https://huggingface.co/spaces/VEFX-Reward/VEFX-Code/blob/main/README.md" target="_blank">📖 Full README</a>
|
| 44 |
+
<a class="pill" href="https://huggingface.co/datasets/xiangbog/VEFX-Bench/tree/3bf997e7eb4fa0d0c2d56cce5ddfccc1dfbda235" target="_blank">📦 Frozen v1.0 Dataset</a>
|
| 45 |
+
<a class="pill" href="https://huggingface.co/VEFX-Reward/VEFX-Reward-4B/tree/a15a8dbe1b3eb07ee0919e8de059f170436ec9ff" target="_blank">🤖 Frozen Reward Model</a>
|
| 46 |
+
<a class="pill" href="https://vefx-leaderboard.com/" target="_blank">🏆 Live VEFX-Leaderboard</a>
|
| 47 |
</div>
|
| 48 |
|
| 49 |
<h2>📊 What's in VEFX-Bench</h2>
|
|
|
|
| 55 |
<div class="card"><h3>Edit Exclusivity (EE)</h3><p>Were only the intended regions modified, without side-effects?</p></div>
|
| 56 |
</div>
|
| 57 |
|
| 58 |
+
<h2>🗂️ Frozen v1.0 Task Taxonomy</h2>
|
| 59 |
+
<p>Attribute Editing · Camera Angle Editing · Camera Motion Editing · Creative Edit · Instance Editing · Instance Motion Editing · Quantity Editing · Style Editing · Visual Effect Editing</p>
|
| 60 |
+
|
| 61 |
+
<h2>🔒 Reproducibility</h2>
|
| 62 |
+
<table>
|
| 63 |
+
<tbody>
|
| 64 |
+
<tr><th>Dataset revision</th><td><code>3bf997e7eb4fa0d0c2d56cce5ddfccc1dfbda235</code></td></tr>
|
| 65 |
+
<tr><th>benchmark_meta.json SHA-256</th><td><code>277d89f5cf23af4163fe6ee120654210f51d19c6dee2d3aa76a3248471d1f333</code></td></tr>
|
| 66 |
+
<tr><th>Reward model revision</th><td><code>a15a8dbe1b3eb07ee0919e8de059f170436ec9ff</code></td></tr>
|
| 67 |
+
<tr><th>model.safetensors SHA-256</th><td><code>c3c0d03f770f0a73631206821922213de75413bb517f7d7a2fd9ab1f2c38f59d</code></td></tr>
|
| 68 |
+
</tbody>
|
| 69 |
+
</table>
|
| 70 |
+
|
| 71 |
<h2>🏆 Model Leaderboard</h2>
|
| 72 |
+
<p><strong>Overall is the primary GeoAgg metric, not the arithmetic average.</strong> For each item <code>j</code>, first compute <code>i=(IF-1)/3</code>, <code>r=(RQ-1)/3</code>, and <code>e=(EE-1)/3</code>, then <code>g_j=1+3·(i²·r·e)^(1/4)</code>. The leaderboard uses <code>Overall=(1/300)·Σg_j</code>: item-level GeoAgg first, then the mean over 300 items. Missing or failed items receive scores <code>(1,1,1)</code>. The arithmetic Mean is diagnostic only.</p>
|
| 73 |
<table>
|
| 74 |
<thead><tr><th class="num">Rank</th><th>Model</th><th>Type</th><th class="num">IF ↑</th><th class="num">RQ ↑</th><th class="num">EE ↑</th><th class="num">GeoAgg ↑</th></tr></thead>
|
| 75 |
<tbody>
|
|
|
|
| 104 |
<p>See <a href="https://huggingface.co/spaces/VEFX-Reward/VEFX-Code/tree/main/examples" target="_blank">examples/</a> for batch & multi-GPU scoring scripts.</p>
|
| 105 |
|
| 106 |
<footer>
|
| 107 |
+
Released under Apache-2.0. Code lives in the <a href="https://huggingface.co/spaces/VEFX-Reward/VEFX-Code/tree/main" target="_blank">Files tab</a>; results and submissions are on the <a href="https://vefx-leaderboard.com/" target="_blank">live leaderboard</a>.
|
| 108 |
</footer>
|
| 109 |
|
| 110 |
</body>
|
vefx_reward/inference.py
CHANGED
|
@@ -6,7 +6,7 @@ Usage:
|
|
| 6 |
|
| 7 |
model = VEFXReward("VEFX-Reward/VEFX-Reward-4B", device="cuda")
|
| 8 |
scores = model.score("original.mp4", "edited.mp4", "add a hat to the person")
|
| 9 |
-
# {'IF': 3.21, 'RQ': 2.85, 'EE': 3.54, 'Overall':
|
| 10 |
"""
|
| 11 |
|
| 12 |
import json
|
|
@@ -56,7 +56,7 @@ class VEFXReward:
|
|
| 56 |
model = VEFXReward("VEFX-Reward/VEFX-Reward-4B")
|
| 57 |
scores = model.score("original.mp4", "edited.mp4", "make it snowy")
|
| 58 |
print(scores)
|
| 59 |
-
# {'IF': 3.2, 'RQ': 2.9, 'EE': 3.5, 'Overall':
|
| 60 |
"""
|
| 61 |
|
| 62 |
def __init__(
|
|
@@ -177,7 +177,17 @@ class VEFXReward:
|
|
| 177 |
scores = {DIMS[j]: round(float(soft[0, j]), 3) for j in range(num_dims)}
|
| 178 |
else:
|
| 179 |
scores = {DIMS[j]: round(float(logits_np[0, j]), 3) for j in range(self.output_dim)}
|
| 180 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 181 |
return scores
|
| 182 |
|
| 183 |
@torch.no_grad()
|
|
@@ -195,8 +205,10 @@ class VEFXReward:
|
|
| 195 |
instruction: The editing instruction text.
|
| 196 |
|
| 197 |
Returns:
|
| 198 |
-
Dictionary with keys ``'IF'``, ``'RQ'``, ``'EE'``, ``'Overall'``
|
| 199 |
-
|
|
|
|
|
|
|
| 200 |
"""
|
| 201 |
batch = self._build_batch(original_video, edited_video, instruction)
|
| 202 |
logits = self.model(**batch, return_dict=True)["logits"]
|
|
|
|
| 6 |
|
| 7 |
model = VEFXReward("VEFX-Reward/VEFX-Reward-4B", device="cuda")
|
| 8 |
scores = model.score("original.mp4", "edited.mp4", "add a hat to the person")
|
| 9 |
+
# {'IF': 3.21, 'RQ': 2.85, 'EE': 3.54, 'Overall': 3.189, 'GeoAgg': 3.189, 'Mean': 3.20}
|
| 10 |
"""
|
| 11 |
|
| 12 |
import json
|
|
|
|
| 56 |
model = VEFXReward("VEFX-Reward/VEFX-Reward-4B")
|
| 57 |
scores = model.score("original.mp4", "edited.mp4", "make it snowy")
|
| 58 |
print(scores)
|
| 59 |
+
# {'IF': 3.2, 'RQ': 2.9, 'EE': 3.5, 'Overall': 3.19, 'GeoAgg': 3.19, 'Mean': 3.2}
|
| 60 |
"""
|
| 61 |
|
| 62 |
def __init__(
|
|
|
|
| 177 |
scores = {DIMS[j]: round(float(soft[0, j]), 3) for j in range(num_dims)}
|
| 178 |
else:
|
| 179 |
scores = {DIMS[j]: round(float(logits_np[0, j]), 3) for j in range(self.output_dim)}
|
| 180 |
+
# VEFX-Bench v1.0 item-level Overall. Normalize scores to [0,1],
|
| 181 |
+
# apply the weighted geometric aggregate (IF weight 2), then map
|
| 182 |
+
# back to [1,4]. Dataset Overall is the mean of these item values.
|
| 183 |
+
i = max(0.0, min(1.0, (scores["IF"] - 1.0) / 3.0))
|
| 184 |
+
r = max(0.0, min(1.0, (scores["RQ"] - 1.0) / 3.0))
|
| 185 |
+
e = max(0.0, min(1.0, (scores["EE"] - 1.0) / 3.0))
|
| 186 |
+
overall = 1.0 + 3.0 * ((i ** 2) * r * e) ** 0.25
|
| 187 |
+
|
| 188 |
+
scores["Overall"] = round(overall, 3)
|
| 189 |
+
scores["GeoAgg"] = scores["Overall"]
|
| 190 |
+
scores["Mean"] = round(sum(scores[d] for d in DIMS) / len(DIMS), 3)
|
| 191 |
return scores
|
| 192 |
|
| 193 |
@torch.no_grad()
|
|
|
|
| 205 |
instruction: The editing instruction text.
|
| 206 |
|
| 207 |
Returns:
|
| 208 |
+
Dictionary with keys ``'IF'``, ``'RQ'``, ``'EE'``, ``'Overall'``,
|
| 209 |
+
``'GeoAgg'``, and ``'Mean'``. ``Overall`` and ``GeoAgg`` are the
|
| 210 |
+
same primary item-level v1.0 score; ``Mean`` is diagnostic only.
|
| 211 |
+
All values use the continuous 1–4 scale.
|
| 212 |
"""
|
| 213 |
batch = self._build_batch(original_video, edited_video, instruction)
|
| 214 |
logits = self.model(**batch, return_dict=True)["logits"]
|