Datasets:
Download code/reproduce.sh from spatial-evidence-bench/SpatialEvidenceBench: direct link, hf CLI and curl.
- Browser
- Download file 2.52 kB
-
https://huggingface.co/datasets/spatial-evidence-bench/SpatialEvidenceBench/resolve/main/code/reproduce.sh
- Command line
-
hf download hf://datasets/spatial-evidence-bench/SpatialEvidenceBench/code/reproduce.sh
-
curl -L -o reproduce.sh https://huggingface.co/datasets/spatial-evidence-bench/SpatialEvidenceBench/resolve/main/code/reproduce.sh
2.52 kB
| set -euo pipefail | |
| ROOT="$(cd "$(dirname "$0")/.." && pwd)" | |
| PY="${PY:-python3}" | |
| SEED=20261106 | |
| echo "[1/9] 生成场景规格" | |
| "$PY" "$ROOT/n_full/generate_dataset.py" --config "$ROOT/configs/scenes.json" --out "$ROOT/dataset" | |
| echo "[2/9] 渲染 4,800 张图(8 卡分片)" | |
| for i in 0 1 2 3 4 5 6 7; do | |
| CUDA_VISIBLE_DEVICES="$i" blender -b --python "$ROOT/scripts/blender_render.py" -- \ | |
| --specs "$ROOT/dataset/scene_specs_test.jsonl" --out "$ROOT/dataset/render_all" \ | |
| --config "$ROOT/configs/scenes.json" --device GPU --threads 16 --shard "$i" --shards 8 | |
| done | |
| echo "[3/9] 计算几何真值" | |
| "$PY" "$ROOT/scripts/geometry_truth.py" --meta "$ROOT/dataset/render_all" --out "$ROOT/dataset/truth_all.jsonl" | |
| echo "[4/9] 生成五条件提示" | |
| "$PY" "$ROOT/scripts/build_prompts.py" --truth "$ROOT/dataset/truth_all.jsonl" --out "$ROOT/dataset/prompts_all.jsonl" | |
| echo "[5/9] 合成域推理(两个基座,7 卡分片)" | |
| for model in qwen3vl qwen25vl; do | |
| for i in 0 1 2 3 4 5 6; do | |
| CUDA_VISIBLE_DEVICES="$((i+1))" PYTHONPATH="$ROOT:$ROOT/envs/qwen3vl_overlay_4576" \ | |
| "$PY" "$ROOT/scripts/run_models.py" --prompts "$ROOT/dataset/prompts_all.jsonl" \ | |
| --images "$ROOT/dataset/render_all" --model-key "$model" \ | |
| --out "$ROOT/predictions/synth_$model/${model}_shard$i.jsonl" --shard "$i" --shards 7 | |
| done | |
| done | |
| echo "[6/9] VCG 见证(test 集)" | |
| "$PY" "$ROOT/scripts/vcg_witness.py" --truth "$ROOT/dataset/truth_test.jsonl" \ | |
| --root "$ROOT/dataset/render_all" --out "$ROOT/predictions/vcg/vcg_test.jsonl" | |
| echo "[7/9] 门控对比" | |
| for model in qwen3vl qwen25vl; do | |
| "$PY" "$ROOT/scripts/vcg_gate.py" --truth "$ROOT/dataset/truth_test.jsonl" \ | |
| --witness "$ROOT/predictions/vcg/vcg_test.jsonl" \ | |
| --params "$ROOT/predictions/vcg/vcg_params.json" \ | |
| --pred "$ROOT/predictions/synth_$model/${model}_shard*.jsonl" \ | |
| --check-pred "$ROOT/predictions/synth_qwen25vl/qwen25vl_shard*.jsonl" \ | |
| --out "$ROOT/analysis/vcg_test_$model.json" | |
| done | |
| echo "[8/9] 2×2 指标与结果导出" | |
| for model in qwen3vl qwen25vl; do | |
| "$PY" "$ROOT/analysis/metrics.py" --prompts "$ROOT/dataset/prompts_all.jsonl" \ | |
| --pred-dir "$ROOT/predictions/synth_$model" --model "$model" \ | |
| --out "$ROOT/analysis/matrix_$model.json" --csv "$ROOT/results/results_core.csv" | |
| done | |
| "$PY" "$ROOT/analysis/export_results.py" | |
| echo "[9/9] 表格、图与稿件" | |
| "$PY" "$ROOT/analysis/make_matrix_tables.py" | |
| "$PY" "$ROOT/analysis/make_v2_figs.py" | |
| echo "done at seed $SEED" | |