Preparing VANTAGE-Bench data for inference (run_lmudata.py)
A beginner-friendly guide to turning the public VANTAGE-Bench Hugging Face dataset into a local LMUData folder you can run VANTAGE-Bench's evaluation toolkit inference against.
TL;DR — most participants just run:
hf auth login # once python scripts/run_lmudata.py --all --lmu-root ~/LMUDataRun inference with
--mode infer.Running this from a clone of the PhysicalAI-VANTAGE-Bench dataset repo? It auto-uses the local
data/folder — see "Where are you running this from?".
A. What this script does
run_lmudata.py downloads the public, no-ground-truth VANTAGE-Bench dataset
from Hugging Face (nvidia/PhysicalAI-VANTAGE-Bench) and reshapes it into the
exact folder layout that VANTAGE-Bench's evaluation toolkit's dataset loaders expect (called
LMUData).
- It prepares data for inference and submission generation.
- It is not for local scoring. Ground-truth answers are withheld from the public dataset; scoring happens server-side on the leaderboard.
- It never fabricates answers. Evaluation-only columns are simply not written.
You run this once per machine. After it finishes, you run your model with
VANTAGE-Bench's evaluation toolkit in --mode infer, which produces a submission JSONL
you can submit.
B. The mental model (how the pieces fit)
Hugging Face dataset repo (nvidia/PhysicalAI-VANTAGE-Bench)
│ download
▼
Local HF cache (~/.cache/huggingface/ — files reused)
│ run_lmudata.py reshapes + links/copies
▼
LMUData/ (datasets/<TASK>/… — what toolkit reads)
│ python run.py --mode infer
▼
Predictions ─► submission JSONL (submit to VANTAGE-Bench for scoring)
Key idea: the HF cache is the real local copy of the media. By default, your LMUData folder symlinks into that cache instead of duplicating tens of GB.
Where are you running this from?
This same script ships in two repos and picks its data source automatically.
The source is shown in the run summary as Source: ….
Source resolution priority:
--local-source PATH(explicit) — use that local checkout'sdata/folder.- Auto-local — if the script file itself lives inside a valid PhysicalAI-VANTAGE-Bench checkout (detected by walking the script's own parent folders — no filesystem search).
- HF remote — download from
--hf-repo(defaultnvidia/PhysicalAI-VANTAGE-Bench) via the HF cache.
A. Running from the VANTAGE-Bench's Github repo
- Default: HF remote. Pulls data through the HF cache.
- Nothing special to do — this is the normal path.
python scripts/run_lmudata.py --all --lmu-root ~/LMUData
B. Running from the PhysicalAI-VANTAGE-Bench dataset repo
- If you cloned the dataset repo and run its bundled copy of this script, it
auto-detects the repo and reads
data/locally — no re-download of the primary dataset.python scripts/run_lmudata.py --all --lmu-root ~/LMUData # Source: local-auto:/path/to/PhysicalAI-VANTAGE-Bench - SOT and Grounding still need network. The dataset repo ships the SOT
benchmark + prep script and the RefDrone prep script, but not the SOT
source camera videos (from
nvidia/PhysicalAI-SmartSpaces) or the VisDrone images. Those still download. Local mode only avoids re-fetching the primary VANTAGE data.
C. Explicit local source
python scripts/run_lmudata.py --all --lmu-root ~/LMUData \
--local-source /path/to/PhysicalAI-VANTAGE-Bench
- Takes precedence over auto-detect and
--hf-repo. - The checkout must be complete and post-PR (validated per task).
D. Warnings for local mode
- Stale / pre-PR clone fails validation. Each task checks for its expected
post-PR paths (e.g.
data/pointing/VANTAGE_2DPointing.jsonl,data/event_verification/data_jsons/annotations/). A missing marker fails that task with a clear message — it never silently serves the wrong layout. - Missing Git LFS files (videos/images not pulled) will fail media checks.
Run
git lfs pullin the clone first. - Symlink mode points into the clone. In local mode the default symlinks
reference files inside your dataset clone; moving or
git clean-ing the clone breaks them. Use--copyfor a portable LMUData. --hf-repois ignored when a local source is active (a warning is logged).
C. Before you start (checklist)
- Python environment with the project installed and
huggingface_hubavailable. If a snapshot fails withhuggingface_hub is required, runpip install huggingface_hub. - Hugging Face login (recommended):
hf auth login. The script auto-detects this token — you won't need to pass--hf-token. - ffmpeg — only needed for the SOT task (frame extraction). Skip if you
aren't preparing SOT. Easiest install:
conda install -c conda-forge ffmpeg. - Disk space — symlink mode (default) needs little extra space (media stays
in the HF cache, ~40 GB there).
--copymode duplicates that media into LMUData. SOT adds ~16 GB of source videos to the HF cache. - Choose an LMUData location — an absolute path you control, e.g.
~/LMUDataor/data/LMUData. Pass it with--lmu-root. The script never writes to the current working directory by default.
D. What is the HF cache?
When huggingface_hub downloads files, it stores them in a local cache,
usually:
~/.cache/huggingface/
(overridable with the HF_HOME env var or this script's --hf-cache).
- Downloads are reused: re-running the script, or preparing another task that shares files, won't re-download what's already cached.
- Symlink mode (default) depends on this cache. Your LMUData media entries
are symlinks pointing into the cache. If you delete or move the HF cache,
those symlinks break. (Fix: re-run the prep, or use
--copy.)
Disk Space Requirements
Why disk usage varies
How much disk you need depends mostly on the media mode:
--symlink(default): LMUData itself stays small — its media entries are symlinks into the HF cache (or, in local mode, into your dataset clone). The real bytes live in the cache/clone, which must remain in place for the symlinks to keep working.--copy: LMUData contains real copied media, so it uses more disk but is portable/self-contained and unaffected by HF-cache cleanup.
Hugging Face downloads are cached locally, usually under:
~/.cache/huggingface/
(overridable with HF_HOME or --hf-cache). Cached files are reused across
runs, so you generally download each file only once.
Approximate per-task disk usage
These are rough estimates and may change as the dataset evolves.
| Task | Approx. disk impact | Notes |
|---|---|---|
| VQA | ~7–8 GB | Video files |
| Event Verification | ~1–3 GB | Referenced videos only |
| DVC | ~5–6 GB | Video files |
| Temporal Localization | ~2–5 GB | Video files |
| 2D Pointing | <1 GB | Images |
| Astro2D | <1 GB | Images + empty placeholder labels |
| 2D Grounding / RefDrone | ~300 MB retained, ~600 MB temporary | Downloads VisDrone/RefDrone image archive, extracts images, deletes zip |
| SOT | ~16 GB HF SmartSpaces cache + extracted frame outputs | Downloads source camera videos and extracts frames |
Total disk recommendation
For a full --all run using the default symlink mode, plan for roughly:
- ~21–22 GB for the VANTAGE HF dataset cache
- ~16 GB for the SmartSpaces/SOT source-video cache
- ~300 MB retained Grounding workdir/images
- SOT extracted frames and task metadata
- relatively small LMUData task folders because most media are symlinked
Recommended free disk for default symlink mode:
- minimum: ~50–60 GB free
- safer: ~70+ GB free
For --copy mode:
- LMUData contains real copied media in addition to the HF cache
- plan for roughly ~80–100 GB free
- safer on shared/HPC systems: 100+ GB free
These figures are approximate and may shift as the benchmark grows.
SOT runtime note
SOT is the slowest task to prepare. It downloads source camera videos from
SmartSpaces and uses ffmpeg to extract sequence frames. Depending on network
speed and storage speed, this may take a long time. It is normal for SOT
preparation to run much longer than the other tasks.
Check local disk usage
df -h
du -sh ~/.cache/huggingface 2>/dev/null || true
du -sh ~/LMUData 2>/dev/null || true
Advanced disk-space notes
- If disk is limited, use the default symlink mode.
- If portability is important, use
--copy. - Do not delete the HF cache if using symlink mode, because symlinks may break.
E. Recommended participant command (default: symlink)
python scripts/run_lmudata.py \
--all \
--lmu-root /path/to/LMUData
--allprepares all eight tasks.- Media is symlinked from the HF cache (disk-efficient).
- Already-prepared tasks are skipped automatically (safe to re-run).
If you only want some tasks (e.g. skip the large SOT download):
python scripts/run_lmudata.py \
--tasks vqa,event_verification,dvc,temporal,pointing,astro2d,grounding \
--lmu-root /path/to/LMUData
F. Portable / self-contained command (copy mode)
Use --copy when you want a LMUData folder with real media files inside it —
portable across machines, and unaffected by HF-cache cleanup:
python scripts/run_lmudata.py \
--all \
--lmu-root /path/to/LMUData \
--copy
Trade-off: this duplicates tens of GB of media into LMUData.
G. Dry-run (simulation, no writes)
Preview exactly what would happen — no downloads, no files written, the LMUData folder isn't even created:
python scripts/run_lmudata.py \
--all \
--lmu-root /path/to/LMUData \
--dry-run
The summary header shows the media mode (media=symlink by default), and each
task prints the HF files it would fetch and the paths it would write.
H. SOT-specific prerequisites
SOT (single-object tracking) is the heaviest task. It downloads source camera
videos from
nvidia/PhysicalAI-SmartSpaces
and extracts frames.
- ffmpeg is required for frame extraction. The shipped prep script has no
ffmpeg-free path. The wrapper auto-discovers ffmpeg on your
PATHand in common conda envs (~/miniconda3/envs/*/bin,/opt/conda/envs/*/bin, …) and bridges it onto the subprocess automatically. - HF token is auto-detected in this order:
--hf-token→HF_TOKENenv → the token fromhf auth login. If you've logged in, nothing to pass. - Source videos: ~16 GB pulled into the HF cache; expect a multi-minute run.
gt.jsoncontains only the publicinit_bbox— no hidden per-frame trajectories. If ffmpeg is missing, you'll get a clear message with install options:
conda install -c conda-forge ffmpeg # recommended; auto-detected
sudo apt-get install -y ffmpeg # Debian/Ubuntu
# or a static build from https://johnvansickle.com/ffmpeg/
If no token is found, the message lists the three ways to provide one
(hf auth login, HF_TOKEN, --hf-token).
I. RefDrone / Grounding prerequisites
The grounding task materializes 1503 VisDrone images via the shipped
prep_refdrone_data.py.
| Requirement | Needed? | Notes |
|---|---|---|
| Internet access | yes | Downloads from github.com + huggingface.co. |
| GitHub HTTPS mirror | primary | Ultralytics release (~311 MB), size + SHA-256 verified. Sufficient on its own. |
Google Drive / gdown |
optional | Fallback only, used if the HTTPS mirror fails. Install with pip install gdown only then. |
| Disk | ~600 MB transient | Zip downloaded, images extracted, zip then deleted (~290 MB remains). |
| System packages | none | Pure-Python extraction. |
If you already have the images staged, pass --skip-grounding-images to write
annotations.json without re-downloading.
J. Common troubleshooting
- Wrong LMUData path / Toolkit can't find data. VANTAGE-Bench's evaluation
toolkit resolves
LMUDataRoot()from$LMUData(if it points to an existing dir), else~/LMUData. Make them match:export LMUData=/path/to/LMUData python -c "from vlmeval.smp import LMUDataRoot; print(LMUDataRoot())" - Broken / dangling symlinks. In symlink mode, deleting or moving the HF
cache breaks LMUData media links. Fix by re-running the prep, or rebuild with
--copyfor a self-contained folder. - Missing ffmpeg (SOT). Install via conda/apt (see section H). A conda-env ffmpeg is auto-detected.
- HF auth / token issues. Run
hf auth login, orexport HF_TOKEN=hf_xxx, or pass--hf-token. If a download 401/403s, confirm any required dataset license acceptance and that your token has read access. - Use
--mode infer, not--mode all. These TSVs are inference-only and omit GT columns.--mode allwould callevaluate()and crash; scoring is server-side anyway.
K. What gets created under LMUData
LMUData/
└── datasets/
├── VANTAGE_VQA/ VANTAGE_VQA.tsv + videos/
├── VANTAGE_EventVerification/ VANTAGE_EventVerification.tsv + videos/
├── VANTAGE_DVC/ VANTAGE_DVC.tsv + videos/
├── VANTAGE_Temporal/ VANTAGE_Temporal.tsv + videos/
├── VANTAGE_2DPointing/ VANTAGE_2DPointing.tsv + images_annotated/
├── Astro2D/ images/ + labels/ (empty placeholders)
├── VANTAGE_2DGrounding/ annotations.json + images/
└── VANTAGE_SOT/ <seq>/gt.json + <seq>/frames/f0X.png
Inference-only TSV schemas (no GT columns):
| Task | Columns |
|---|---|
| VANTAGE_VQA | index, video, question, options |
| VANTAGE_EventVerification | index, video, system_prompt, question |
| VANTAGE_DVC | index, video, question |
| VANTAGE_Temporal | index, video, question (video = bare stem, no .mp4) |
| VANTAGE_2DPointing | index, question_id, image_path, question, A, B, C, D |
- Astro2D
labels/*.txtare intentionally empty — they exist only so the loader doesn't drop images; they contain no ground truth. - VANTAGE_2DGrounding
annotations.jsonomitsbboxes— the loader takes its no-GT branch.Note: a
LMUData/images/folder may appear later — that is the toolkit's runtime artifact (frame caching / image dumping during inference), not produced by this prep script. It's safe to ignore.
L. Advanced options
| Flag | Purpose |
|---|---|
--tasks a,b,c |
Prepare a subset. Choices: vqa, event_verification, dvc, temporal, pointing, astro2d, grounding, sot. |
--all |
Prepare all eight tasks (default if neither --tasks nor --all given). |
--lmu-root PATH |
Output root (absolute). Default ~/LMUData. Never CWD. |
--local-source PATH |
Use a local PhysicalAI-VANTAGE-Bench checkout's data/ instead of HF. Wins over --hf-repo. Auto-enabled when the script lives inside such a repo. |
--symlink |
Default. Symlink media (from the HF cache, or the local checkout in local mode). |
--copy |
Copy real media into LMUData (portable, self-contained; uses more disk). |
--force |
Rebuild the index file even if the task already looks complete; re-places missing media. |
--force-clean |
Destructive. Wipe a task's media dir before re-staging. |
--dry-run |
Print the plan; no HF calls, no writes. |
--hf-token TOKEN |
HF token. Optional — auto-detected from HF_TOKEN / hf auth login. Needed for SOT. |
--hf-repo REPO |
Source repo override (testing/simulation only). Production default: nvidia/PhysicalAI-VANTAGE-Bench. |
--skip-grounding-images |
For grounding: write annotations.json but don't download VisDrone images. |
--write-manifest |
Write .vantage_prep_manifest.json telemetry at the LMU root (off by default). |
--verbose / -v |
Debug logging (snapshot paths, per-file decisions). |
--symlink and --copy are mutually exclusive.
Idempotency & safety
- Re-running is safe. A task that already passes its integrity check is
skipped (no download, no writes) unless you pass
--force. - Interrupted runs recover. A partial task fails its integrity check, so the next normal run rebuilds just that task. SOT resumes cheaply — already downloaded videos and extracted frames are reused from the HF cache.
- Non-destructive by default. Without
--force-clean, the script only adds missing files and (under--force) overwrites the index file. It never deletes media on its own.
Per-task failure isolation
Each task runs independently. If one fails (missing source, no token, no
ffmpeg, mirror down), it's marked failed in the summary and the other tasks
continue. The process exits non-zero if any task failed, zero otherwise.
After preparing: run inference
export LMUData=/path/to/LMUData
python run.py --data VANTAGE_VQA --model <YourModel> --mode infer
Repeat per task (or pass multiple to --data). Each run emits a
*.submission.jsonl next to the prediction file — that's what you submit.
Scoring is done server-side against the withheld ground truth.