haoningwu commited on
Commit
099b612
Β·
verified Β·
1 Parent(s): afa73f9

Upload README.md

Browse files
Files changed (1) hide show
  1. README.md +186 -3
README.md CHANGED
@@ -1,3 +1,186 @@
1
- ---
2
- license: mit
3
- ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # SpatialScore: Towards Unified Evaluation for Multimodal Spatial Understanding (CVPR 2026 Highlight)
2
+ This repository contains the official PyTorch implementation of SpatialScore: https://arxiv.org/abs/2505.17012/.
3
+
4
+ Our new version paper has been accepted by CVPR 2026, and we have updated our up-to-date code and data!
5
+ Feel free to reach out for discussions!
6
+
7
+ <div align="center">
8
+ <img src="./assets/dataset.png">
9
+ </div>
10
+
11
+ Current Leaderboard (You are welcome to test your models on SpatialScore!):
12
+
13
+ <div align="center">
14
+ <img src="./assets/SpatialScore.png">
15
+ </div>
16
+
17
+ ## Some Information
18
+ [Project Page](https://haoningwu3639.github.io/SpatialScore/) $\cdot$ [Paper](https://arxiv.org/abs/2505.17012/) $\cdot$ [SpatialScore_Benchmark](https://huggingface.co/datasets/haoningwu/SpatialScore) $\cdot$ [SpatialCorpus](https://huggingface.co/datasets/haoningwu/SpatialCorpus) $\cdot$ [Model](https://huggingface.co/haoningwu/SpatialScore)
19
+
20
+ ## News
21
+ - [2026.5] We have updated our up-to-date code and data!
22
+ - [2026.4] Glad to share that **SpatialScore** has been accepted to **CVPR 2026** and selected as **Highlight**.
23
+ - [2025.5] ~~We have released version_0 of our evaluation code, supporting most mainstream models.~~
24
+ - [2025.5] ~~We have released version_0 of SpatialScore, which is available on [Huggingface](https://huggingface.co/datasets/haoningwu/SpatialScore).~~
25
+ - [2025.5] Our pre-print paper is released on arXiv.
26
+
27
+ ## Requirements
28
+ - Python >= 3.10 (Recommend to use [Anaconda](https://www.anaconda.com/download/#linux) or [Miniconda](https://docs.conda.io/en/latest/miniconda.html))
29
+ - [PyTorch >= 2.8.0](https://pytorch.org/)
30
+ - accelerate == 1.13.0
31
+ - xformers==0.0.32.post1
32
+ - flash-attn==2.8.2
33
+ - vllm == 0.11.0
34
+ - triton == 3.4.0
35
+ - triton_kernels (please refer to [gpt_oss](https://wheels.vllm.ai/gpt-oss/triton-kernels/) for version supporting gpt_oss)
36
+ - transformers == 4.57.3
37
+
38
+ The aforementioned dependencies are necessary for conducting evaluations on SpatialScore.
39
+ If you intend to utilize SpatialAgent; since it requires invoking various spatial perception tools, you may need to consult the following repositories to install the corresponding tool dependencies, and download their corresponding pre-trained checkpoints, including [Rex-Omni](https://github.com/IDEA-Research/Rex-Omni), [Map-Anything](https://github.com/facebookresearch/map-anything), [GroundingDINO](https://github.com/IDEA-Research/GroundingDINO) and [DetAny3D](https://github.com/OpenDriveLab/DetAny3D).
40
+
41
+ A suitable [conda](https://conda.io/) environment named `SpatialScore` can be created and activated with:
42
+
43
+ ```
44
+ conda env create -f environment.yaml
45
+ conda activate SpatialScore
46
+ ```
47
+
48
+ ## Dataset
49
+ Please check out [SpaitalScore](https://huggingface.co/datasets/haoningwu/SpatialScore) to download our proposed benchmark (`SpatialScore`).
50
+
51
+ If you cannot access Huggingface, you can use [hf-mirror](https://hf-mirror.com/) to download models.
52
+
53
+ ```
54
+ export HF_ENDPOINT=https://hf-mirror.com # Add this before huggingface-cli download
55
+ ```
56
+
57
+ You can follow the commands below to prepare the data:
58
+
59
+ ```
60
+ huggingface-cli download --resume-download --repo-type dataset haoningwu/SpatialScore --local-dir ./ --local-dir-use-symlinks False
61
+ unzip SpatialScore_benchmark.zip
62
+ ```
63
+
64
+ ## SFT with SpatialCorpus
65
+ Please check out [SpaitalCorpus](https://huggingface.co/datasets/haoningwu/SpatialCorpus) to download our introduced training resources (`SpatialCorpus`).
66
+
67
+ You can follow the commands below to prepare the data:
68
+
69
+ ```
70
+ huggingface-cli download --resume-download --repo-type dataset haoningwu/SpatialCorpus --local-dir ./ --local-dir-use-symlinks False
71
+ unzip SpatialCorpus.zip
72
+ ```
73
+
74
+ Our codebase integrates the training script for Qwen3-VL.
75
+ Once you have prepared the dataset and configured the corresponding data paths, you can use the following script to conduct SFT on the Qwen3-VL model using SpatialCorpus:
76
+
77
+ ```
78
+ cd Qwen3-VL/qwen-vl-finetune
79
+ bash ./scripts/sft_qwen3_8b.sh
80
+ ```
81
+
82
+ For further details, please refer to the official [Qwen3-VL](https://github.com/qwenlm/qwen3-vl) tutorial.
83
+
84
+
85
+ ## Evaluation
86
+ Considering the current mainstream model architectures, we have prioritized support for the Qwen2.5-VL and Qwen3-VL series models.
87
+ You can evaluate them on SpatialScore using the following commands:
88
+
89
+ ```
90
+ CUDA_VISIBLE_DEVICES=0,1 python test_qwen.py --model_name qwen3vl-4b --model_path ./huggingface/Qwen3-VL-4B-Instruct --dataset_json_path ./SpatialScore_benchmark/SpatialScore_benchmark.ndjson --output_dir ./eval_results
91
+ ```
92
+
93
+ Now, the All-in-one script supporting all other models is also available.
94
+ You can evaluate other models on SpatialScore using the following commands:
95
+
96
+ ```
97
+ CUDA_VISIBLE_DEVICES=0,1 python test_all_in_one.py --model_name llava-ov-7b --model_path ../huggingface/LLaVA-OneVision-7B --dataset_json_path ./SpatialScore_benchmark/SpatialScore_benchmark.ndjson --output_dir ./eval_results
98
+ ```
99
+
100
+ Our final evaluation encompassed rule-based evaluation and LLM-based answer extraction, which are combined to calculate the final accuracy.
101
+ Therefore, you need to configure [GPT-OSS](https://github.com/openai/gpt-oss) and download the corresponding [GPT-OSS-20B](https://huggingface.co/openai/gpt-oss-20b) checkpoint before running the following script to compute the final score:
102
+
103
+ ```
104
+ MKL_THREADING_LAYER=GNU CUDA_VISIBLE_DEVICES=0 python ./evaluate_results.py --input ./eval_results/qwen3vl-4b
105
+ ```
106
+
107
+ ## Inference with SpatialAgent
108
+ Before using SpatialAgent, you need to install the additional dependencies required by the toolbox according to the Requirements section.
109
+
110
+ In addition, you should download the checkpoints for the spatial perception tools being used and place them in the `./SpatialAgent/checkpoints/` directory, which should have a structure similar to the following:
111
+
112
+ ```
113
+ ./SpatialAgent/checkpoints
114
+ β”œβ”€β”€ dinov2-large
115
+ β”œβ”€β”€ Orient-Anything
116
+ β”‚ β”œβ”€β”€ base100p
117
+ β”‚ β”œβ”€β”€ base100p2
118
+ β”‚ β”œβ”€β”€ base25p
119
+ β”‚ β”œβ”€β”€ base50p
120
+ β”‚ β”œβ”€β”€ base75p
121
+ β”‚ β”œβ”€β”€ base75p2
122
+ β”‚ β”œβ”€β”€ celarge
123
+ β”‚ β”œβ”€β”€ cropbaseEx03
124
+ β”‚ β”œβ”€β”€ croplargeEX03
125
+ β”‚ β”œβ”€β”€ croplargeEX2
126
+ β”‚ β”œβ”€β”€ cropsmallEx03
127
+ β”‚ β”œβ”€β”€ mixreallarge
128
+ β”‚ └── ronormsigma1
129
+ └── RAFT
130
+
131
+ ./SpatialAgent/DepthAnythingV2
132
+ └── ckpt
133
+ β”‚ β”œβ”€β”€ hypersim.pth
134
+ β”‚ └── vkitti.pth
135
+
136
+ ./SpatialAgent/DetAny3D
137
+ β”œβ”€β”€ GroundingDINO
138
+ β”‚ └── weights
139
+ β”‚ └── groundingdino_swinb_cogcoor.pth
140
+ β”œβ”€β”€ checkpoints/detany3d
141
+ β”‚ β”œβ”€β”€ detany3d_ckpts
142
+ β”‚ β”œβ”€β”€ dino_ckpts
143
+ β”‚ β”œβ”€β”€ sam_ckpts
144
+ β”‚ └── unidepth_ckpts
145
+ └── models--bert-base-uncased
146
+ ```
147
+
148
+ Furthermore, for [DetAny3D](https://github.com/OpenDriveLab/DetAny3D) and [DepthAnythingV2](https://github.com/DepthAnything/Depth-Anything-V2), you will also need to refer to their respective repositories, download the required checkpoints, and place them in their corresponding directories.
149
+
150
+ Our SpatialAgent supports two reasoning paradigms: Plan-Execute and ReAct. You can perform inference using the following script:
151
+
152
+ ```
153
+ # Plan-Execute paradigm
154
+ CUDA_VISIBLE_DEVICES=0 python inference_plan-execute.py --start 0 --end 1000 --prompt_format cota --model_path ../huggingface/Qwen3-VL-4B-Instruct --model_name qwen3vl-4b
155
+
156
+ # ReAct paradigm
157
+ CUDA_VISIBLE_DEVICES=0 python inference_ReAct.py --start 0 --end 1000 --execute --prompt_format cota --model_path ../huggingface/Qwen3-VL-4B-Instruct --model_name qwen3vl-4b
158
+ ```
159
+
160
+ ## Citation
161
+ If you use this code and data for your research or project, please cite:
162
+
163
+ @inproceedings{wu2026spatialscore,
164
+ author = {Wu, Haoning and Huang, Xiao and Chen, Yaohui and Zhang, Ya and Wang, Yanfeng and Xie, Weidi},
165
+ title = {SpatialScore: Towards Comprehensive Evaluation for Spatial Intelligence},
166
+ booktitle = {Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR)},
167
+ year = {2026},
168
+ }
169
+
170
+ ## TODO
171
+ - [x] Release Paper
172
+ - [x] Update the final version paper
173
+ - [x] Release version_0 SpatialScore Benchmark
174
+ - [x] Release version_0 Code of Evaluation
175
+ - [x] Release version_0 Base Code of SpatialAgent
176
+ - [x] Release our training resources SpatialCorpus and the SFT models
177
+ - [x] Update SpatialScore Benchmark
178
+ - [x] Update Code of Evaluation
179
+ - [x] Update Code of SpatialAgent
180
+
181
+ ## Acknowledgements
182
+ Many thanks to the code bases from [transformers](https://github.com/huggingface/transformers), [Qwen3-VL](https://github.com/qwenlm/qwen3-vl), and [TACO](https://github.com/SalesforceAIResearch/TACO).
183
+
184
+
185
+ ## Contact
186
+ If you have any questions, please feel free to contact haoningwu3639@gmail.com.