Repository navigation
[Refactor] Refactor dataset config aliases and video presets - #1622
Merged
Merged
Conversation
Introduce a DatasetSpec-based resolver for direct datasets, explicit configs, preset aliases, and predefined video shortcuts, replacing the old partial-based video shortcut registry with PREDEFINED_DATASET_SPECS covered by a manifest fixture. Propagate dataset_alias_name, dataset_name, and dataset_class_name through run.py, local/API/MT/video inference, status files, and reporter recovery so output filenames use aliases while dataset-specific behavior keeps the logical dataset name. Tighten config validation by rejecting empty configs, requiring non-empty class and dataset fields, validating video nframe/fps with class __init__ defaults, preserving the ReVSI all-frame override, and clearing Video-MME-v2 1fps presets with nframe=0. Fix composite dataset child eval filenames under aliases and add tests for alias resolution, preset overrides, video shortcut migration, status reporting, composite datasets, and non-config local/API entry points.
Align video dataset sampling branches with build validation by treating fps=0 the same as fps unset when nframe is positive. Update dataset-specific frame extraction paths to use fps <= 0 for nframe sampling, including the MVBench_MP4 read path so fps=0 no longer enters fps-based sampling. Add regression coverage that fps=0,nframe>0 passes validation and that legacy fps < 0 sampling guards do not reappear.
Align CGBench and CGAVCounting helper sampling branches with video build validation by treating local fps=0 as unset when num_frames is positive. Keep the standalone utils save_clue_video_frames behavior unchanged, as it is not part of the self.fps review finding. Extend regression coverage to scan local fps guards and exercise the CGBench fps=0 nframe branch with a fake VideoReader.
Allow DREAM and MVUEval strict build validation to honor their class-level default frame sampling behavior. Expose SiteBenchImage init parameters explicitly so strict config filtering accepts valid image dataset kwargs while still rejecting unknown options. Add regression coverage for both validation paths.
Remove parent-name replacement from composite child eval file generation and use a stable _SUB_ marker to avoid collisions with normal result files. Update SIUO, image concat, and video concat callers to pass only the child dataset name. Adjust alias regression tests to cover the new two-argument helper and collision-resistant filenames.
Keep direct dataset specs independent of dataset imports and derive the effective dataset class name from the constructed dataset object. Propagate the resolved class name into local status updates and API DatasetConfig so reporter recovery can use the actual runtime class. Add regression coverage for direct datasets where the spec has no class before build but status/config records the built class.
# Conflicts: # run.py
# Conflicts: # vlmeval/dataset/video_dataset_config.py
# Conflicts: # vlmeval/dataset/video_dataset_config.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pull Request Description
Summary
This PR refactors VLMEvalKit dataset config handling to separate output aliases from logical dataset names.
Previously, the key under config
datacould be treated both as the output artifact name and as the logical dataset identity. That becomes ambiguous when users want custom output names for the same dataset configuration. This PR introduces a structuredDatasetSpecresolution flow so output naming, dataset construction, evaluation, status tracking, and reporter recovery use the right identity consistently.Motivation
For configs like:
{ "data": { "Video-MME-custom": { "class": "VideoMME", "dataset": "Video-MME", "nframe": 16 } } }Video-MME-customshould only be an output alias, whileVideo-MMEshould remain the logical dataset name used by dataset construction, prompts, judge/evaluate logic, and reporter lookup.This PR makes that distinction explicit.
Main Changes
Dataset alias resolution
DatasetSpecand alias resolution helpers invlmeval/smp/dataset_alias.py.dataset_alias_name: output-side alias.dataset_name: logical dataset name.dataset_class_name: class name used for strict build and reporter/status recovery.build_config: dataset construction config.source: direct dataset, explicit config, preset config, or predefined shortcut..,_,-Config and preset behavior
datakeys are now output aliases.classanddataset.{ "MyAlias": { "preset": "MMBench_Video_8frame_nopack" } }classordataset.Video shortcut unification
DatasetSpec.PREDEFINED_DATASET_SPECS.Inference path updates
Composite dataset evaluation
This avoids overwriting parent prediction files or colliding when an alias does not contain the logical dataset name.
Status and reporter handling
Video sampling validation
fps <= 0as unset for ordinary video datasets.nframe > 0, orfps > 0Dataset-specific fixes
fps=0handling.modelconstructor parameter:SiteBenchImage.__init__signature to keep strict config validation meaningful.Documentation
run.py --help.datakey as output aliasdatasetTests
Ran:
Also passed pre-commit hooks during commits: