Skip to content

Commit 321d511

Browse files
[refactor] eval: consolidate FVD into common.fvd, remove benchmarks/fvd (#1380)
Co-authored-by: abaghyangor <abaghyangor@gmail.com>
1 parent ba75ad8 commit 321d511

21 files changed

Lines changed: 690 additions & 1605 deletions

File tree

.agents/memory/evaluation-registry/README.md

Lines changed: 29 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ _Last updated: 2026-03-02_
1212

1313
| Metric | Category | Status | Location | Trust |
1414
|--------|----------|--------|----------|-------|
15-
| **FVD** | Distribution | ✅ Implemented | `benchmarks/fvd/` | High |
15+
| **FVD** | Distribution | ✅ Implemented | `fastvideo/eval/metrics/common/fvd/` | High |
1616
| **SSIM** | Reference | ✅ Implemented | `fastvideo/tests/ssim/` | High |
1717
| **LPIPS** | Perceptual | ✅ Implemented | `scripts/lora_extraction/` | Medium |
1818
| **Loss trajectory** | Training signal | ✅ Implemented | W&B `train_loss` | Medium |
@@ -27,8 +27,8 @@ _Last updated: 2026-03-02_
2727
### FVD — Fréchet Video Distance
2828

2929
**Category**: Distribution-level quality metric
30-
**Status**: ✅ Fully implemented in `benchmarks/fvd/`
31-
**Trust**: High — standard protocol, I3D feature extractor
30+
**Status**: ✅ Registered as the `common.fvd` eval metric in `fastvideo/eval/metrics/common/fvd/`
31+
**Trust**: High — standard protocol, I3D feature extractor (CLIP / VideoMAE backbones also available, research-grade)
3232

3333
#### What It Measures
3434
FVD measures the distance between the **distribution** of generated videos and
@@ -59,30 +59,39 @@ Lower FVD = generated videos are more statistically similar to real videos.
5959
#### How to Use
6060

6161
```python
62-
# Programmatic
63-
from benchmarks.fvd import compute_fvd_with_config, FVDConfig
62+
# Programmatic — drive the metric directly for custom kwargs
63+
from fastvideo.eval import get_metric
6464

65-
config = FVDConfig.fvd2048_16f() # Standard: 2048 videos, 16 frames
66-
results = compute_fvd_with_config('data/real/', 'outputs/gen/', config)
67-
print(f"FVD: {results['fvd']:.2f}")
65+
metric = get_metric("common.fvd", extractor="i3d") # or "clip" / "videomae"
66+
metric.to("cuda")
67+
metric.setup()
68+
metric.reset()
69+
70+
# First sample carries the reference set; later samples reuse the cache.
71+
metric.accumulate({"video": gen_tensors[0], "reference": real_tensors})
72+
for gen in gen_tensors[1:]:
73+
metric.accumulate({"video": gen})
74+
75+
result = metric.finalize()
76+
print(f"FVD: {result.score:.2f}")
6877
```
6978

7079
```bash
71-
# CLI
72-
python -m benchmarks.fvd.cli \
73-
--real-path data/real/ \
74-
--gen-path outputs/gen/ \
75-
--protocol fvd2048_16f
80+
# CLI — folder of generated mp4s vs a reference folder
81+
python examples/inference/eval/eval_fvd.py \
82+
--gen-dir outputs/gen/ \
83+
--reference-dir data/real/ \
84+
--extractor i3d \
85+
--output fvd_scores.json
7686
```
7787

78-
**Preset protocols**:
79-
| Protocol | Videos | Frames | Use Case |
80-
|----------|--------|--------|----------|
81-
| `fvd2048_16f` | 2048 | 16 | Standard benchmark (papers) |
82-
| `fvd2048_128f` | 2048 | 128 | Long video evaluation |
83-
| `quick_test` | 100 | 16 | Fast dev iteration |
88+
**Feature extractors**: `i3d` (default, standard FVD spec used in papers),
89+
`clip`, `videomae` (research-grade; not directly comparable to published
90+
FVD numbers).
8491

85-
**Feature extractors**: `i3d` (default, standard), `clip`, `videomae`
92+
**Protocol**: standard FVD uses 2048 generated + 2048 reference videos at
93+
16 frames each. A warning fires below 256 — the score becomes
94+
statistically unreliable.
8695

8796
#### Interpretation
8897
| FVD Range | Interpretation |

.agents/onboarding/worldmodel-training/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ Read `.agents/memory/evaluation-registry/README.md` for the full metric catalog.
258258
|--------|-------------|-------|
259259
| **Loss trajectory** | Every run, real-time from W&B | Medium |
260260
| **SSIM** | When comparing against reference outputs | High |
261-
| **FVD** | For benchmarking model quality (`benchmarks/fvd/`) | High |
261+
| **FVD** | For benchmarking model quality (`common.fvd` eval metric; example: `examples/inference/eval/eval_fvd.py`) | High |
262262
| **LPIPS** | LoRA merge validation | Medium |
263263
| **Human preference** | Major checkpoints | Highest |
264264

.agents/workflows/evaluation-development.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,5 +89,4 @@ The following land in follow-up PRs:
8989

9090
- **MIND** metrics (depends on a separate `vipe` submodule).
9191
- **VBench-2.0** sibling package.
92-
- Native conversion of **FVD** under `fastvideo/eval/metrics/fvd/`.
9392
- The training-time `EvalCallback`.

benchmarks/fvd/README.md

Lines changed: 0 additions & 106 deletions
This file was deleted.

benchmarks/fvd/__init__.py

Lines changed: 0 additions & 37 deletions
This file was deleted.

benchmarks/fvd/cli.py

Lines changed: 0 additions & 77 deletions
This file was deleted.

0 commit comments

Comments
 (0)