File size: 3,844 Bytes
3d587cf
 
552ca98
 
 
 
 
 
 
 
 
3d587cf
552ca98
 
 
78d3f4b
 
 
 
 
552ca98
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
78d3f4b
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
---
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](https://github.com/canglanx/purespace)]   [[Paper](https://openaccess.thecvf.com/content/CVPR2026F/papers/Li_PureSpace_A_Benchmark_for_Abstract_Spatial_Reasoning_in_Vision-Language_Models_CVPRF_2026_paper.pdf)]   [[Supp](https://openaccess.thecvf.com/content/CVPR2026F/supplemental/Li_PureSpace_A_Benchmark_CVPRF_2026_supplemental.pdf)]

<img src="assets/examples.jpg" alt="Examples" width="50%">


## Dataset Structure
```text
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
```python
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},
}
```