purespace / README.md
lijinkai
Update readme
78d3f4b
|
Raw
History Blame Contribute Delete
3.84 kB
metadata
license: cc-by-nc-4.0
task_categories:
  - visual-question-answering
  - image-text-to-text
language:
  - en
tags:
  - spatial-intelligence
  - geometric-reasoning
  - benchmark

PureSpace: A Benchmark for Abstract Spatial Reasoning in Vision-Language Models

[Code]   [Paper]   [Supp]

Examples

Dataset Structure

purespace/
├── images/
│   ├── l3_c221/
│   │   ├── 000009/
│   │   │   ├── 000009_iso.jpg
│   │   │   ├── 000009_top.jpg
│   │   │   └── ...
│   │   └── ...
│   └── ...
│
└── labels/
    ├── rotation/
    │   ├── train/
    │   │   ├── l3_c221.txt
    │   │   └── ...
    │   └── test/
    │       ├── l3_c221.txt
    │       └── ...
    ├── projection/
    │   └── ...
    └── completion/
        └── ...

Usage Example

import os
import glob

# Define dataset directory
data_root = "/path/to/purespace"

# Question texts
q_texts = {
    "rotation": "Which option is a rotation of the given object?",
    "projection": "Which option is a top-down view of the given object?",
    "completion": "Which option fits the given object, in order to make a cube?",
}

# All label files
label_files = sorted(glob.glob(os.path.join(data_root, "labels", "*", "*", "*.txt")))

# Read each label file
for label_file in label_files:
    with open(label_file, "r") as f:
        label_lines = [line.strip().split() for line in f.readlines()]

    # Read each line in label file
    for line in label_lines:

        # Question image
        q_img = os.path.join(data_root, "images", line[0], line[3])

        # Hard option images
        hard_o_imgs = [
            os.path.join(data_root, "images", line[0], rel_path)
            for rel_path in line[4].split(",")
        ]
        # Hard answer idx
        hard_a = int(line[5])

        # Easy option images
        easy_o_imgs = [
            os.path.join(data_root, "images", line[0], rel_path)
            for rel_path in line[6].split(",")
        ]
        # Easy answer idx
        easy_a = int(line[7])

        # Metadata
        metadata = os.path.join(
            data_root, "images", line[0], line[1], f"{line[1]}_metadata.json"
        )

        print(f"\n--- Dataset Sample Preview ---")
        print(f"{'Setting Name:':<16}{line[0]}")
        print(f"{'Object ID:':<16}{line[1]}")
        print(f"{'Task Type:':<16}{line[2]}")
        print(f"\nQuestion Image:")
        print(f"  {q_img}")
        print(f"\nQuestion Text:")
        print(f"  {q_texts[line[2]]}")
        print(f"\nHard Option Images ({len(hard_o_imgs)}):")
        for img in hard_o_imgs:
            print(f"  {img}")
        print(f"{'Hard Answer Index:':<20}{hard_a}")
        print(f"\nEasy Option Images ({len(easy_o_imgs)}):")
        for img in easy_o_imgs:
            print(f"  {img}")
        print(f"{'Easy Answer Index:':<20}{easy_a}")
        print(f"\nMetadata:")
        print(f"  {metadata}")

        break
    break

Citation

@inproceedings{li2026purespace,
    title     = {PureSpace: A Benchmark for Abstract Spatial Reasoning in Vision-Language Models},
    author    = {Li, Jinkai and Zhang, Zhenliang and Fan, Lifeng and Wang, Wei},
    booktitle = {Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR) Findings},
    year      = {2026},
}