SRBench: Mind the Gap in Spatial Reasoning ๐ง
January 21, 2026 ยท View on GitHub
Welcome to SRBench, the ultimate test for Vision-Language Models (VLMs) in spatial reasoning! ๐ This repository provides everything you need to evaluate, analyze, and push the boundaries of VLM capabilities.
Welcome to SRBench! This repository contains the source code for evaluating spatial reasoning in Vision-Language Models (VLMs). Below is an overview of the repository structure, installation, usage instructions, and contribution guidelines.
Overview
SRBench is a comprehensive benchmarking suite for evaluating spatial reasoning capabilities in Vision-Language Models. The project includes:
- Model Evaluation: Scripts for evaluating various VLMs on spatial reasoning tasks
- Data Processing: Tools for creating and processing spatial reasoning datasets
- Analysis Tools: Utilities for computing accuracy and analyzing results
- Flexible Evaluation: Support for different prompting strategies (Chain-of-Thought, one-shot examples)
Repository Structure
The project is organized as follows:
SRBench/
โโโ scripts/ # Execution scripts
โ โโโ run_closed.sh # Script to compute accuracy from results
โ โโโ run.sh # Main evaluation script
โโโ src/ # Source code of the project
โ โโโ __init__.py # Package initialization
โ โโโ eval.py # Main evaluation engine for VLMs
โ โโโ eval_closed.py # Evaluation script for closed models
โ โโโ data/ # Data processing utilities
โ โ โโโ __init__.py # Package initialization
โ โ โโโ create_data.py # Script for data creation
โ โ โโโ create_images.py # Script to create images
โ โ โโโ create_prompts.py # Script to generate prompts
โ โ โโโ folding_pil.py # PIL-based folding utilities
โ โ โโโ images_dalle.py # DALL-E image generation utilities
โ โ โโโ mrt.py # MRT utilities
โ โโโ eval/ # Evaluation utilities
โ โ โโโ __init__.py # Package initialization
โ โ โโโ acc.py # Accuracy calculation utilities
โ โโโ utils/ # Utility functions
โ โโโ __init__.py # Package initialization
โ โโโ vlm/ # VLM-specific utilities
โ โโโ __init__.py # Package initialization
โ โโโ base.py # Base VLM classes
โ โโโ vlm_engine.py # VLM engine implementation
โโโ .gitignore # Files and directories to ignore
โโโ requirements.txt # Required packages
โโโ LICENSE # MIT License file
โโโ README.md # Project documentation
๐ ๏ธ Installation
Get up and running in a few simple steps:
- Clone the repository:
git clone https://github.com/stogiannidis/srbench.git cd srbench - Create a virtual environment:
Using
venv:
Or usingpython3 -m venv venv source venv/bin/activateconda:conda create -n srbench python=3.12 conda activate srbench - Install the required packages:
pip install -r requirements.txt
๐ Usage
Evaluating Models
To evaluate a model on the SRBench dataset, use the following commands:
-
Standard Evaluation:
python src/eval.py --model <model_id> --dataset <dataset_id> --batch_size 16 --seed 42 -
Chain-of-Thought Prompting:
python src/eval.py --model <model_id> --dataset <dataset_id> --cot --batch_size 16 -
One-Shot Examples:
python src/eval.py --model <model_id> --dataset <dataset_id> --one-shot <path_to_example.json> --batch_size 16
Running Batch Evaluations
The main evaluation script is configured in scripts/run.sh. You can run it with:
bash scripts/run.sh
This script evaluates multiple models (InternVL, Qwen, LLaVA, etc.) on the SRBench dataset with Chain-of-Thought prompting.
Computing Accuracy
To compute accuracy from evaluation results:
bash scripts/run_closed.sh
This processes the CSV files in the output directory and calculates model accuracy.
Command-line Arguments for eval.py
| Argument | Description | Default |
|---|---|---|
-m, --model | Model identifier (required) | |
-d, --dataset | Dataset identifier (required) | |
-b, --batch_size | Batch size for processing | 16 |
--num_workers | Number of data loading workers | 4 |
--max_samples | Maximum samples to process | None |
--sample_strategy | Sampling strategy (first, random, stratified) | first |
--device_map | Device mapping strategy | auto |
--seed | Random seed for reproducibility | 42 |
--cot | Enable Chain-of-Thought prompting | |
--one-shot | Path to one-shot example JSON file | |
-v, --verbose | Enable verbose logging |
Citation
@misc{stogiannidis2025mindgapbenchmarkingspatial,
title={Mind the Gap: Benchmarking Spatial Reasoning in Vision-Language Models},
author={Ilias Stogiannidis and Steven McDonagh and Sotirios A. Tsaftaris},
year={2025},
eprint={2503.19707},
archivePrefix={arXiv},
primaryClass={cs.CV},
url={https://arxiv.org/abs/2503.19707},
}
๐ Contributing
We welcome contributions from the community! To get involved, please follow these steps:
- Fork the repository.
- Create a new branch (
git checkout -b feature/your_feature). - Commit your changes (
git commit -am 'Add new feature'). - Push to the branch (
git push origin feature/your_feature). - Open a Pull Request.
๐ License
This project is licensed under the MIT License. See the LICENSE file for more details.
๐ฌ Contact
Have questions or feedback? Feel free to open an issue or reach out via email.