Add reproducible evaluation installation and weight setup

#1
README.md CHANGED
@@ -9,7 +9,7 @@ configs:
9
 
10
  # Helixbench
11
 
12
- A frozen 1,015-sample audio-video benchmark. This private staging release contains the **first frame** and **`caption_av` only** for each sample, plus the six-metric evaluation entrypoint. The sample IDs and prompts are fixed.
13
 
14
  | Metric | Scope | Protocol |
15
  |---|---:|---|
@@ -22,19 +22,30 @@ A frozen 1,015-sample audio-video benchmark. This private staging release contai
22
 
23
  The dataset is `data/test.zip` in ImageFolder format. `metadata.jsonl` also exposes the AV-only captions and IDs as a directly readable file. The evaluation source is browsable under `evaluation/`; `evaluation.zip` additionally bundles the verified GT features. Each row has `sample_id`, `caption_av`, `scene`, `interaction`, and `first_frame_sha256`; `file_name` points to the PNG inside the archive. No video-only or audio-only captions are in the release. `evaluation.zip` contains the Python package and frozen GT PaSST/VGGish features. The Spatial target vocabulary is frozen in `evaluation/src/helixbench/resources/spatial_targets150.jsonl`; this preserves the historical detector prompts without releasing other captions.
24
 
 
 
 
 
 
 
 
 
 
 
 
 
 
25
  ## Evaluate generated videos
26
 
27
- Unpack `evaluation.zip`, then install from its `evaluation` directory. Provide one MP4 for every sample ID, at 768×512, 121 frames/24 fps, stereo 48 kHz audio with at least 5 seconds. The generated JSONL rows must contain `sample_id`, absolute `path`, and SHA256 `sha256`.
28
 
29
  ```bash
30
- python -m pip install -e evaluation
31
- helixbench verify-package
32
- helixbench prepare --generated /absolute/generated.jsonl --model-id my_model --run-dir /absolute/run
33
- helixbench run --run-dir /absolute/run --metric all --deps-root /absolute/deps --weights-root /absolute/weights --torch-home /absolute/torch
34
- helixbench aggregate --run-dir /absolute/run
35
- helixbench verify --run-dir /absolute/run
36
  ```
37
 
38
- The runner needs the exact external model repositories and weights listed in `evaluation/provenance/DEPENDENCIES.md`, plus `ffmpeg` and `ffprobe`. The included GT features are verified by SHA256, so GT videos are not needed for KL/FAD. `--gt` remains available if you have the exact GT media and want to extract those features again. The entrypoint produces exactly six metrics; it does not combine them into a single score.
39
 
40
  `data/test/metadata.jsonl` and all 1,015 PNG files are SHA-checked against the frozen release manifest before upload. The package's `verify-package` checks the frozen cohort, Spatial vocabulary and scoring engine hashes. Evaluation code is based on the private GitHub Helixbench repository at commit `1f9b199`, with an AV-only data adaptation and packaged GT features. It has not been checked against every historical model end to end; the original full1015 pipeline was previously validated on an A10G with historical AudioX outputs.
 
9
 
10
  # Helixbench
11
 
12
+ A frozen 1,015-sample audio-video benchmark. This public release contains the **first frame** and **`caption_av` only** for each sample, plus the six-metric evaluation entrypoint. The sample IDs and prompts are fixed.
13
 
14
  | Metric | Scope | Protocol |
15
  |---|---:|---|
 
22
 
23
  The dataset is `data/test.zip` in ImageFolder format. `metadata.jsonl` also exposes the AV-only captions and IDs as a directly readable file. The evaluation source is browsable under `evaluation/`; `evaluation.zip` additionally bundles the verified GT features. Each row has `sample_id`, `caption_av`, `scene`, `interaction`, and `first_frame_sha256`; `file_name` points to the PNG inside the archive. No video-only or audio-only captions are in the release. `evaluation.zip` contains the Python package and frozen GT PaSST/VGGish features. The Spatial target vocabulary is frozen in `evaluation/src/helixbench/resources/spatial_targets150.jsonl`; this preserves the historical detector prompts without releasing other captions.
24
 
25
+ ## Install the evaluation environment
26
+
27
+ Download and unpack `evaluation.zip`. On Linux with an NVIDIA GPU, a compatible driver, `python3`, `git`, `curl`, `ffmpeg`, and `ffprobe`, run:
28
+
29
+ ```bash
30
+ R=/absolute/path/to/helixbench_runtime
31
+ bash evaluation/install.sh "$R"
32
+ "$R/env/bin/python" evaluation/download_weights.py "$R"
33
+ "$R/env/bin/helixbench" verify-package
34
+ ```
35
+
36
+ `install.sh` creates a Python 3.12.15 environment with PyTorch 2.7.0/CUDA 12.8, clones four public model repositories at fixed Git commits, applies the included ImageBind compatibility shim, and installs the evaluation package. `download_weights.py` downloads public weights and checks their SHA256, including PaSST and Grounding DINO. Keep the unpacked `evaluation` directory: the editable installation and packaged GT features refer to it. See [the exact dependency list](evaluation/provenance/DEPENDENCIES.md).
37
+
38
  ## Evaluate generated videos
39
 
40
+ Provide one MP4 for every sample ID, at 768×512, 121 frames/24 fps, stereo 48 kHz audio with at least 5 seconds. The generated JSONL rows must contain `sample_id`, absolute `path`, and SHA256 `sha256`. A complete manifest has exactly 1,015 rows.
41
 
42
  ```bash
43
+ "$R/env/bin/helixbench" prepare --generated /absolute/generated.jsonl --model-id my_model --run-dir /absolute/run
44
+ "$R/env/bin/helixbench" run --run-dir /absolute/run --metric all --deps-root "$R/deps" --weights-root "$R/weights" --torch-home "$R/torch"
45
+ "$R/env/bin/helixbench" aggregate --run-dir /absolute/run
46
+ "$R/env/bin/helixbench" verify --run-dir /absolute/run
 
 
47
  ```
48
 
49
+ The included GT features are verified by SHA256, so GT videos are not needed for KL/FAD. `--gt` remains available if you have the exact GT media and want to extract those features again. The entrypoint produces exactly six metrics; it does not combine them into a single score.
50
 
51
  `data/test/metadata.jsonl` and all 1,015 PNG files are SHA-checked against the frozen release manifest before upload. The package's `verify-package` checks the frozen cohort, Spatial vocabulary and scoring engine hashes. Evaluation code is based on the private GitHub Helixbench repository at commit `1f9b199`, with an AV-only data adaptation and packaged GT features. It has not been checked against every historical model end to end; the original full1015 pipeline was previously validated on an A10G with historical AudioX outputs.
RELEASE_FILES.json CHANGED
@@ -1,23 +1,31 @@
1
  {
2
  "README.md": {
3
- "bytes": 3301,
4
- "sha256": "ba0e4043e20750ef19e05b7dcfe26b956b47d1e227ecb9b615bceefa39b9ae45"
5
  },
6
  "data/test.zip": {
7
  "bytes": 568170324,
8
  "sha256": "c6a48f1535d36f45a01cce2cb1e6eb4117319aa984c80b067ba1e89497c7d38c"
9
  },
10
  "evaluation.zip": {
11
- "bytes": 6706128,
12
- "sha256": "c799dc58a457a6186612f6c6549e04725060ff907d1250b6c88abe733c3ce076"
 
 
 
 
13
  },
14
  "evaluation/examples/INPUT_FORMAT.md": {
15
  "bytes": 573,
16
  "sha256": "908142d777a71d2365da374bde425db115a9db2cb944289e26974ac232fff14a"
17
  },
 
 
 
 
18
  "evaluation/provenance/DEPENDENCIES.md": {
19
- "bytes": 1353,
20
- "sha256": "481329fa4333cd4159a9d6e62cdbdceda17c82b3d482705c0fd5f339faa4e248"
21
  },
22
  "evaluation/pyproject.toml": {
23
  "bytes": 489,
 
1
  {
2
  "README.md": {
3
+ "bytes": 3971,
4
+ "sha256": "3ec3876373f75f259132429595faa84e494a346bbbabbb28e0915bf4c7947d28"
5
  },
6
  "data/test.zip": {
7
  "bytes": 568170324,
8
  "sha256": "c6a48f1535d36f45a01cce2cb1e6eb4117319aa984c80b067ba1e89497c7d38c"
9
  },
10
  "evaluation.zip": {
11
+ "bytes": 6431892,
12
+ "sha256": "0d6373079f273ee786244d3799f8ac9cdb0cea33a74f3996ec3ab198fff6d90a"
13
+ },
14
+ "evaluation/download_weights.py": {
15
+ "bytes": 3708,
16
+ "sha256": "02516b5d6d9f8567bc1aefe295004c3d5d5605eabb0345d6de45acc8d32d9644"
17
  },
18
  "evaluation/examples/INPUT_FORMAT.md": {
19
  "bytes": 573,
20
  "sha256": "908142d777a71d2365da374bde425db115a9db2cb944289e26974ac232fff14a"
21
  },
22
+ "evaluation/install.sh": {
23
+ "bytes": 2949,
24
+ "sha256": "6bb4f7b39e9236cea462cfaed2b0399499ede5869e09e4ca695c98182b1bdac1"
25
+ },
26
  "evaluation/provenance/DEPENDENCIES.md": {
27
+ "bytes": 1765,
28
+ "sha256": "14ba27d13793f1706efb34be949df5dc6f476a4e43b81a33b7461c492edf5117"
29
  },
30
  "evaluation/pyproject.toml": {
31
  "bytes": 489,
evaluation.zip CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:c799dc58a457a6186612f6c6549e04725060ff907d1250b6c88abe733c3ce076
3
- size 6706128
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:0d6373079f273ee786244d3799f8ac9cdb0cea33a74f3996ec3ab198fff6d90a
3
+ size 6431892
evaluation/download_weights.py ADDED
@@ -0,0 +1,97 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """Download and hash-check the exact public model weights used by Helixbench.
2
+
3
+ Usage: /absolute/runtime/env/bin/python evaluation/download_weights.py /absolute/runtime
4
+ """
5
+ from __future__ import annotations
6
+
7
+ import hashlib
8
+ import json
9
+ import subprocess
10
+ import sys
11
+ from pathlib import Path
12
+
13
+ from huggingface_hub import snapshot_download
14
+
15
+
16
+ WEIGHTS = (
17
+ (
18
+ "weights/vggish-10086976.pth",
19
+ "https://github.com/harritaylor/torchvggish/releases/download/v0.1/vggish-10086976.pth",
20
+ "10086976245803799d9194e9a73d9b6c1549c71d1b80106f5cade5608a561f4b",
21
+ ),
22
+ (
23
+ "weights/synchformer_state_dict.pth",
24
+ "https://github.com/hkchengrex/MMAudio/releases/download/v0.1/synchformer_state_dict.pth",
25
+ "8aff082f2df5c3bc52759db0c865c7ee772ae6400b860d1b7e90413f2defb67c",
26
+ ),
27
+ (
28
+ "weights/music_speech_audioset_epoch_15_esc_89.98.pt",
29
+ "https://huggingface.co/lukewys/laion_clap/resolve/main/music_speech_audioset_epoch_15_esc_89.98.pt",
30
+ "51c68f12f9d7ea25fdaaccf741ec7f81e93ee594455410f3bca4f47f88d8e006",
31
+ ),
32
+ (
33
+ "deps/ImageBind/.checkpoints/imagebind_huge.pth",
34
+ "https://dl.fbaipublicfiles.com/imagebind/imagebind_huge.pth",
35
+ "d6f6c22bedcc90708448d5d2fbb7b2db9c73f505dc89bd0b2e09b23af1b62157",
36
+ ),
37
+ (
38
+ "torch/hub/checkpoints/passt-s-f128-p16-s10-ap.476-swa.pt",
39
+ "https://github.com/kkoutini/PaSST/releases/download/v0.0.1-audioset/passt-s-f128-p16-s10-ap.476-swa.pt",
40
+ "302903fa8c4aee817b11dc982da0b29aaf8d11a3e722420476d0a12c9db70c2c",
41
+ ),
42
+ )
43
+ EVAL_DIR = Path(__file__).resolve().parent
44
+
45
+
46
+ def sha256(path: Path) -> str:
47
+ digest = hashlib.sha256()
48
+ with path.open("rb") as stream:
49
+ for block in iter(lambda: stream.read(8 * 1024 * 1024), b""):
50
+ digest.update(block)
51
+ return digest.hexdigest()
52
+
53
+
54
+ def main() -> None:
55
+ if len(sys.argv) != 2 or not Path(sys.argv[1]).is_absolute():
56
+ raise SystemExit("Usage: python evaluation/download_weights.py /absolute/path/to/runtime")
57
+ prefix = Path(sys.argv[1])
58
+ results = []
59
+ for relative, url, expected in WEIGHTS:
60
+ target = prefix / relative
61
+ target.parent.mkdir(parents=True, exist_ok=True)
62
+ if not target.is_file() or sha256(target) != expected:
63
+ temporary = target.with_name(target.name + ".part")
64
+ subprocess.run(
65
+ ["curl", "-fL", "--retry", "6", "--retry-all-errors", url, "-o", str(temporary)],
66
+ check=True,
67
+ )
68
+ actual = sha256(temporary)
69
+ if actual != expected:
70
+ raise ValueError(f"Weight SHA256 mismatch: {relative}: {actual}")
71
+ temporary.replace(target)
72
+ results.append({"path": relative, "sha256": expected, "bytes": target.stat().st_size})
73
+ print(f"verified {relative}", flush=True)
74
+
75
+ expected_dino = json.loads((EVAL_DIR / "src/helixbench/resources/dino_expected.json").read_text())
76
+ dino = prefix / "weights/dino"
77
+ snapshot_download(
78
+ repo_id="IDEA-Research/grounding-dino-tiny",
79
+ revision=expected_dino["revision"],
80
+ allow_patterns=list(expected_dino["model_files"]),
81
+ local_dir=dino,
82
+ token=False,
83
+ )
84
+ for name, expected in expected_dino["model_files"].items():
85
+ if sha256(dino / name) != expected:
86
+ raise ValueError(f"DINO SHA256 mismatch: {name}")
87
+ results.append({
88
+ "path": "weights/dino",
89
+ "revision": expected_dino["revision"],
90
+ "files": len(expected_dino["model_files"]),
91
+ })
92
+ (prefix / "WEIGHTS_READY.json").write_text(json.dumps(results, indent=2) + "\n")
93
+ print("All weights ready", flush=True)
94
+
95
+
96
+ if __name__ == "__main__":
97
+ main()
evaluation/install.sh ADDED
@@ -0,0 +1,63 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env bash
2
+ # Install the exact third-party source revisions used by the six-metric runner.
3
+ # Usage: bash evaluation/install.sh /absolute/path/to/runtime
4
+ set -euo pipefail
5
+
6
+ EVAL_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
7
+ PREFIX="${1:?Usage: bash evaluation/install.sh /absolute/path/to/runtime}"
8
+ if [[ "$PREFIX" != /* ]]; then
9
+ echo "The runtime path must be absolute: $PREFIX" >&2
10
+ exit 2
11
+ fi
12
+ for executable in python3 git ffmpeg ffprobe curl; do
13
+ command -v "$executable" >/dev/null || { echo "Missing executable: $executable" >&2; exit 2; }
14
+ done
15
+ mkdir -p "$PREFIX"/{deps,weights,torch}
16
+
17
+ python3 -m venv "$PREFIX/bootstrap_env"
18
+ "$PREFIX/bootstrap_env/bin/python" -m pip install 'uv==0.12.24'
19
+ UV="$PREFIX/bootstrap_env/bin/uv"
20
+ "$UV" python install 3.12.15
21
+ if [[ ! -x "$PREFIX/env/bin/python" ]]; then
22
+ "$UV" venv --python 3.12.15 "$PREFIX/env"
23
+ fi
24
+ "$UV" pip install --python "$PREFIX/env/bin/python" \
25
+ torch==2.7.0 torchvision==0.22.0 torchaudio==2.7.0 \
26
+ --index-url https://download.pytorch.org/whl/cu128
27
+ "$UV" pip install --python "$PREFIX/env/bin/python" \
28
+ numpy==2.5.2 scipy==1.18.1 transformers==4.57.3 librosa==0.11.0 \
29
+ timm==1.0.28 av==16.1.0 einops==0.8.1 fvcore==0.1.5.post20221221 \
30
+ fairscale==0.4.13 iopath==0.1.10 ftfy==6.3.1 omegaconf==2.3.0 \
31
+ huggingface-hub==0.36.2 boto3 soundfile scikit-learn pandas matplotlib \
32
+ h5py braceexpand webdataset wget regex tqdm packaging sentencepiece \
33
+ opencv-python-headless imageio-ffmpeg==0.6.0 psutil torchlibrosa==0.1.0 \
34
+ progressbar2 resampy 'setuptools==78.1.0' 'wandb==0.30.0'
35
+
36
+ while read -r name repo revision; do
37
+ destination="$PREFIX/deps/$name"
38
+ if [[ ! -d "$destination/.git" ]]; then
39
+ git clone "https://github.com/$repo.git" "$destination"
40
+ fi
41
+ git -C "$destination" fetch origin "$revision"
42
+ git -C "$destination" checkout --detach "$revision"
43
+ actual="$(git -C "$destination" rev-parse HEAD)"
44
+ if [[ "$actual" != "$revision" ]]; then
45
+ echo "Wrong Git revision in $destination: $actual" >&2
46
+ exit 1
47
+ fi
48
+ done <<'REPOS'
49
+ av-benchmark hkchengrex/av-benchmark f351b9a6fc6abde746d5f8e1d4c47c883319cb41
50
+ ImageBind facebookresearch/ImageBind 53680b02d7e37b19b124fa37bae4b6c98c38f5be
51
+ CLAP LAION-AI/CLAP 590b52df03a5e480634b8714135d3534313be860
52
+ hear21passt kkoutini/passt_hear21 5f1cce6a54b88faf0abad82ed428355e7931213a
53
+ REPOS
54
+
55
+ # The benchmark's ImageBind entrypoint requires this frozen compatibility shim.
56
+ cp "$EVAL_DIR/src/helixbench/engines/imagebind_compat_init.py" \
57
+ "$PREFIX/deps/ImageBind/imagebind/__init__.py"
58
+ "$UV" pip install --python "$PREFIX/env/bin/python" --no-deps -e "$PREFIX/deps/CLAP"
59
+ "$UV" pip install --python "$PREFIX/env/bin/python" --no-deps -e "$EVAL_DIR"
60
+ "$PREFIX/env/bin/helixbench" verify-package
61
+ "$UV" pip freeze --python "$PREFIX/env/bin/python" > "$PREFIX/environment.freeze.txt"
62
+ echo "Source and Python dependencies ready in $PREFIX"
63
+ echo "Next: $PREFIX/env/bin/python $EVAL_DIR/download_weights.py $PREFIX"
evaluation/provenance/DEPENDENCIES.md CHANGED
@@ -1,14 +1,25 @@
1
- # 第三方依赖与权重
2
 
3
- 本目录不内嵌第三方仓库或模型权重。运行前把仓库置于 `--deps-root` 下:
 
 
 
4
 
5
- | 路径 | 固定版本 | 用途 |
6
  |---|---|---|
7
- | `av-benchmark/` | `hkchengrex/av-benchmark` commit `f351b9a6fc6abde746d5f8e1d4c47c883319cb41` | VGGish、Synchformer 实现 |
8
- | `ImageBind/` | `facebookresearch/ImageBind` commit `53680b02d7e37b19b124fa37bae4b6c98c38f5be` | ImageBind |
9
- | `CLAP/src/` | `LAION-AI/CLAP` commit `590b52df03a5e480634b8714135d3534313be860` | CLAP |
10
- | `hear21passt/` | PaSST 源码 commit `5f1cce6a54b88faf0abad82ed428355e7931213a` | KL |
11
 
12
- `--weights-root` 至少放 `vggish-10086976.pth`、`synchformer_state_dict.pth`、`music_speech_audioset_epoch_15_esc_89.98.pt` 及本地 `dino/` 模型。ImageBind 权重按其原仓库的加载约定缓存。`--torch-home/hub/checkpoints/passt-s-f128-p16-s10-ap.476-swa.pt` 的 SHA256 必须是 `302903fa8c4aee817b11dc982da0b29aaf8d11a3e722420476d0a12c9db70c2c`。PaSST 使用 CPU FP32;VGGish 使用 CPU FP32;CLAP、ImageBind、Synchformer、DINO 需要与历史环境相容的 PyTorch/CUDA。
 
 
 
 
13
 
14
- 历史 Python/CUDA 依赖版本与第三方权重来源可查原目录 `benchmark1015_all_metrics_v3/bootstrap.sh`、`extras.sh`、`weights.py`、`runtime_provenance.json`。这份整理版尚未在干净环境完成全依赖安装和 MP4 全流程验收。
 
 
 
 
 
1
+ # Third-party dependencies and weights
2
 
3
+ Run `bash evaluation/install.sh /absolute/runtime` and then
4
+ `/absolute/runtime/env/bin/python evaluation/download_weights.py /absolute/runtime`.
5
+ These scripts fetch third-party source and weights; this release does not redistribute
6
+ them. The source repositories must appear under `--deps-root`:
7
 
8
+ | Path | Upstream repository and fixed commit | Purpose |
9
  |---|---|---|
10
+ | `av-benchmark/` | [`hkchengrex/av-benchmark`](https://github.com/hkchengrex/av-benchmark) commit `f351b9a6fc6abde746d5f8e1d4c47c883319cb41` | VGGish, Synchformer |
11
+ | `ImageBind/` | [`facebookresearch/ImageBind`](https://github.com/facebookresearch/ImageBind) commit `53680b02d7e37b19b124fa37bae4b6c98c38f5be` | ImageBind |
12
+ | `CLAP/src/` | [`LAION-AI/CLAP`](https://github.com/LAION-AI/CLAP) commit `590b52df03a5e480634b8714135d3534313be860` | CLAP |
13
+ | `hear21passt/` | [`kkoutini/passt_hear21`](https://github.com/kkoutini/passt_hear21) commit `5f1cce6a54b88faf0abad82ed428355e7931213a` | KL |
14
 
15
+ `download_weights.py` contains the public download URLs and full SHA256 for
16
+ PaSST, VGGish, Synchformer, CLAP, ImageBind, and Grounding DINO. The PaSST
17
+ checkpoint belongs at `--torch-home/hub/checkpoints/passt-s-f128-p16-s10-ap.476-swa.pt`
18
+ and has SHA256 `302903fa8c4aee817b11dc982da0b29aaf8d11a3e722420476d0a12c9db70c2c`.
19
+ The packaged GT PaSST and VGGish features were extracted with these models.
20
 
21
+ PaSST and VGGish run on CPU FP32. CLAP, ImageBind, Synchformer, and
22
+ Grounding DINO require a compatible NVIDIA GPU. The installation script pins
23
+ the Python and major runtime versions used in the historical A10G validation.
24
+ The public package has not yet passed a complete fresh-environment six-metric
25
+ run; installation and score validation are separate checks.