SRBench: Mind the Gap in Spatial Reasoning ๐Ÿง 

January 21, 2026 ยท View on GitHub

License Python Hugging Face ArXiv

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:

  1. Clone the repository:
    git clone https://github.com/stogiannidis/srbench.git
    cd srbench
    
  2. Create a virtual environment: Using venv:
    python3 -m venv venv
    source venv/bin/activate
    
    Or using conda:
    conda create -n srbench python=3.12
    conda activate srbench
    
  3. 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

ArgumentDescriptionDefault
-m, --modelModel identifier (required)
-d, --datasetDataset identifier (required)
-b, --batch_sizeBatch size for processing16
--num_workersNumber of data loading workers4
--max_samplesMaximum samples to processNone
--sample_strategySampling strategy (first, random, stratified)first
--device_mapDevice mapping strategyauto
--seedRandom seed for reproducibility42
--cotEnable Chain-of-Thought prompting
--one-shotPath to one-shot example JSON file
-v, --verboseEnable 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:

  1. Fork the repository.
  2. Create a new branch (git checkout -b feature/your_feature).
  3. Commit your changes (git commit -am 'Add new feature').
  4. Push to the branch (git push origin feature/your_feature).
  5. 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.