While run.py supports simple evaluation using --model and --data arguments, you can use a JSON configuration file for more complex scenarios involving multiple models or datasets with different settings. Use the --config argument to pass the path to your JSON file.
Config JSON Structure
The JSON file must contain two top-level dictionary keys: model and data.
1. model Configuration
Each entry in the model dictionary uses a user-defined name as the key. The value is a dictionary containing:
class: The class name of the model (defined in vlmeval/vlm/__init__.py for open-source models or vlmeval/api/__init__.py for API models).- Other kwargs: Model-specific parameters (e.g.,
temperature, img_detail). Note that the model argument is required by most model classes. - Shortcut: If a model is already defined in
supported_VLM within vlmeval/config.py, you can use an empty dictionary {} to use its default settings.
2. data Configuration
Each entry in the data dictionary uses a name (ideally the official dataset name) as the key. The value is a dictionary containing:
class: The class name of the dataset (defined in vlmeval/dataset/__init__.py).- Other kwargs: Dataset-specific parameters (e.g.,
nframe, fps, use_subtitle). The dataset argument is typically required. For video datasets, nframe or fps is usually required. - Shortcut: If a dataset is defined in
supported_video_datasets within vlmeval/dataset/video_dataset_config.py, you can use an empty dictionary {} to use its default settings.
Execution and Output
Run the evaluation using:
python run.py --config config.json
Results are saved in $WORK_DIR using the pattern: {$WORK_DIR}/{$MODEL_NAME}/{$MODEL_NAME}_{$DATASET_NAME}_*.
{
"model": {
"GPT4o_20240806_T00_HIGH": {
"class": "GPT4V",
"model": "gpt-4o-2024-08-06",
"temperature": 0,
"img_detail": "high"
},
"GPT4o_20241120": {}
},
"data": {
"MME-RealWorld-Lite": {
"class": "MMERealWorld",
"dataset": "MME-RealWorld-Lite"
},
"Video-MME_16frame_subs": {
"class": "VideoMME",
"dataset": "Video-MME",
"nframe": 16,
"use_subtitle": true
}
}
}